Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

328pb Timer3 and PWM issue #1

Open
epccs opened this issue Aug 6, 2019 · 0 comments
Open

328pb Timer3 and PWM issue #1

epccs opened this issue Aug 6, 2019 · 0 comments

Comments

@epccs
Copy link
Owner

epccs commented Aug 6, 2019

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant