AMcTools Forum 
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
ATmega168b and PWM (Read 5208 times)
mixjoe
YaBB Newbies
*
Offline

I Love YaBB 2!

Posts: 10

ATmega168b and PWM
04/22/12 at 21:02:50
 
According pag. 131 of ATmega168 d/s, by setting

[b]COM1A1=1 COM1A0=0[/b]

Clear OC1A/OC1B on Compare Match when upcounting.
Set OC1A/OC1B on Compare Match when
downcounting


and by setting:

[b]COM1A1=1 COM1A0=1[/b]

Set OC1A/OC1B on Compare Match when upcounting.
Clear OC1A/OC1B on Compare Match
when downcounting)


On VMlab waveforms seems are inverted between them: when I set the first option should be result in a inverted wave ([color=#ff0000]but I see not-inverted in VMlab Scope[/color]), while the second option should be result in a "non inverted" wave ([color=#ff0000]but I see inverted wave in VMlab scope[/color])

Am I mistaking?

Thanks in advance

Back to top
 
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: ATmega168b and PWM
Reply #1 - 04/23/12 at 19:35:15
 
Yes, that's correct but only in the phase correct and phase/frequency correct waveform generation modes. Are you sure the right one is selected in the WGM bits?
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print