Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

PWM on arduino pins 0, 1 and 2 #3

Closed
Xplorer001 opened this issue May 3, 2016 · 1 comment
Closed

PWM on arduino pins 0, 1 and 2 #3

Xplorer001 opened this issue May 3, 2016 · 1 comment

Comments

@Xplorer001
Copy link

I was porting the code to our Atmega328pb board named Tit; noticed that the additional PWM output pins 0, 1 and 2 do not work..

The fix is simple, as you may already know it :), is to define relevant timers on pins_arduino.h file.

if defined(AVR_ATmega328PB)

TIMER3A,
TIMER4A,
TIMER4B,

else

NOT_ON_TIMER, /* 0 - port D */
NOT_ON_TIMER,   
NOT_ON_TIMER,
// on the ATmega168, digital pin 3 has hardware pwm

endif

Will send a pull request once all the testing is done.
`

@awatterott
Copy link
Member

Thank you for the info. I have added the timers.

dewhisna added a commit to dewhisna/ATmega328PB-Testing that referenced this issue Nov 7, 2017
Apparently, Atmel/Microchip changed the specs on the ATmega328PB sometime between 2015 and 2017.
In the 2015 datasheet, there was only 3 bits defined in efuse, like the m328p has.
But, in the 2017 datasheet (and on the parts I received in Nov 2017), there is a new bit defined in efuse -- bit watterott#3, called CFD (disable Clock Failure Detection).
The default for this bit is '0', which disables the CFD.  Interesting change on their part, seeing as how this new ATmega328PB canNOT drive a standard AT-cut 16MHz crystal to save its life.
This update adds support to the avrdude.conf file for this bit to allow programming of it and to avoid the error message generated because the device has it set already.
It also updates the value in the boards.txt file to default this bit to the Atmel/Microchip defined value of '0', rather than '1' (the old not-programmed default).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants