This shows you the differences between two versions of the page.
pm:lab:lab0xc0-3 [2020/03/30 11:36] ana.constantinescu [Generating PWM using ATmega Timers] |
pm:lab:lab0xc0-3 [2020/03/31 17:01] (current) constantin.ghilinta [Generating PWM using ATmega Timers] |
||
---|---|---|---|
Line 3: | Line 3: | ||
For more in-depth knowledge about the capabilities and the timing peripherals and how to program them you can find more information in the ATmega324 datasheet ({{:pm:doc8272.pdf|Datasheet ATmega324}}). | For more in-depth knowledge about the capabilities and the timing peripherals and how to program them you can find more information in the ATmega324 datasheet ({{:pm:doc8272.pdf|Datasheet ATmega324}}). | ||
- | Sketch is available here: | + | |
===== PWM (Pulse Width Modulation) ===== | ===== PWM (Pulse Width Modulation) ===== | ||
Line 235: | Line 235: | ||
TCCR1A |= _BV(WGM10); //Just WGM10 is in TCCR1A | TCCR1A |= _BV(WGM10); //Just WGM10 is in TCCR1A | ||
- | //WGM11, WGM12 and WGM13 will be set in TCCR1B | + | //WGM12 will be set in TCCR1B |
TCCR1B |= _BV(WGM12); | TCCR1B |= _BV(WGM12); | ||
Line 329: | Line 329: | ||
===== Tasks ===== | ===== Tasks ===== | ||
- | {{:pm:lab:lab3:lab2_0xc2.zip|}} | + | Sketch is available here: {{:pm:lab:lab3:lab2_0xc2.zip|}} |
1. Compile the code sketch in the archive and run it. | 1. Compile the code sketch in the archive and run it. |