I'm using the 1284P in my Nixie clock projects, with no issues except for this one - pin 20 is connected to the gate of a 2N7000 through a 4k resistor, driving some LEDs. A piezo buzzer is connected to another pin and when tone() is executed, PWM on pin 20 is affected. There also appears to be some conflict between PWM on pin 20 and commands issued to the MCP23017 on the I2C bus, but I haven't investigated that further. The sketch is about 2500 lines, and I haven't spent much time trying to narrow the possibilities.
I'm using the Bobuino/Skinny Bob configuration, and all boards that I've built have the same issue. I can avoid pin 20, but if anyone has clues as to what is happening, I'd like to know.
Thank you. Is there a way around this such as a substitute for tone(). I'm not sure but I think Timer3 is not used. I just need a short beep to confirm key presses, nothing more.
If you're using the separate core (the one that works with all the 40-pin ones and includes it's own copy of the core) you could also modify the core to use a different timer for tone...
One more pwm pin is available. I'll try it, but I have to cut a trace and run a wire. Now that I know what's happening, I'll try a timer free tone library first. Thanks for the help!
MitchSF:
I've searched and I can't find documentation on which pins the three timers are related to. Please post a link or that information. Thanks again.
It's in the datasheet, pin configurations page, the pins for each timer are marked OC (for output compare) then the number of the timer and a letter indicating the channel, ex OC2A. Then cross reference with Arduino pin mapping.
MitchSF:
Is there a way around this such as a substitute for tone(). I'm not sure but I think Timer3 is not used. I just need a short beep to confirm key presses, nothing more.
If you use an active piezo buzzer then you don't need to use tone().