Skip to content

328pb Timer3 and PWM issue  #1

Open
@epccs

Description

@epccs

https://www.avrfreaks.net/forum/atmega328pb-timer-34-output-compare-pwm-issue

At some point, I plan to spin the Lux board with a 328pb, and use Timer3 to replace the PWM from Timer0 (which is needed for millis timer in fast PWM mode, rather than the phase-correct PWM mode that works best with the LED's)

When configuring Timer 1 and Timer 3 identically for both channels with all the correct DDR bits set for output, the PWM waveform on the first three output pins is good (e.g., OC1A, OC1B, and OC3A.) but OC3B will have a continuous low output.

To get the OC3B output to work correctly set the port D bit 2 pin value high: e.g., "PORTD |= 4;". Timers OC3B or OC4B are used to accomplish a modulated signal, but that [hack] uses Port D bit 2 to control the combination of the two timer outputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions