Re: duty cycle 改變問題??
|
||||
---|---|---|---|---|
新會員
|
听的出來吧!!!!!至少它的聲音大小會變化吧!!!哈哈!
發表於: 2007/7/11 18:17
|
|||
|
Re: duty cycle 改變問題??
|
||||
---|---|---|---|---|
版主
|
Duty 的改變Buzzer是聽不太出來的,因為Period (頻率) 並沒有改變,用示波器或接個 LED 看看比較明顯。
發表於: 2007/7/11 16:20
|
|||
|
Re: duty cycle 改變問題??
|
||||
---|---|---|---|---|
高級會員
|
我前面問題應該是ok 可能我DUTY改變太大我是用教學版可能是警告的聲音
想請一下 如果我的PWM輸出腳位是要驅動MOS 那我可以直接接到MOS嗎 還是說還要經過什麼電路後才接到MOS
發表於: 2007/7/11 15:34
|
|||
|
Re: duty cycle 改變問題??
|
||||
---|---|---|---|---|
資深會員
|
有把PWM的高頻率用RC電路濾波嗎?
發表於: 2007/7/11 13:10
|
|||
不要問我哪裡來,我只是個流浪天涯的工程師
|
||||
|
Re: duty cycle 改變問題??
|
||||
---|---|---|---|---|
資深會員
|
如果你的pwm輸出腳有接buzzer應該會有一點聲音吧...沒看到電路也不知道...但可以肯定的是沒接東西只有MCU是不會有聲音的...好可怕,嚇人哦~
發表於: 2007/7/11 9:58
|
|||
|
Re: duty cycle 改變問題??
|
||||
---|---|---|---|---|
高級會員
|
我自己後來有加了 但是好像有聲音嗡嗡的叫那是什麼原因阿 是因為DUTY 切換的關係ㄇ
發表於: 2007/7/11 9:43
|
|||
|
Re: duty cycle 改變問題??
|
||||
---|---|---|---|---|
資深會員
|
你好像少寫了一行ADdelay
void main() { while(1) { TRISC2=0; T2CON=0X04; CCP1INIT(); ADdelay(1000); CCP1INIT_1(); ADdelay(1000);.....少了這一行 } }
發表於: 2007/7/11 0:16
|
|||
|
duty cycle 改變問題??
|
||||
---|---|---|---|---|
高級會員
|
想請問ㄧ下我已經寫了ㄧ個頻率固定為20K但是我的duty必須要能改變 我下面程式是0.2 變0.4 持續動作 我中間有加了delay但是看到的好像都只有duty=0.2 是不是我的delay不夠長呢??
void CCP1INIT() { CCPR1L=0X31; //F=20K hz duty=0.2 CCP1CON=0X3C; PR2=0XF9; } void CCP1INIT_1() { CCPR1L=0X63; //F=20K hz duty=0.4 CCP1CON=0X3C; PR2=0XF9; } void ADdelay(unsigned char i) { while(i--); } **************************************** void main() { while(1) { TRISC2=0; T2CON=0X04; CCP1INIT(); ADdelay(1000); CCP1INIT_1(); } }
發表於: 2007/7/10 22:27
|
|||
|