Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

PWM not working with multiple pins on Atmega328p

2 posters

Go down  Message [Page 1 of 1]

momos



Hello,

I am on version 1.0.0 revision 1376.

The Atmega328p does not seem to be working properly, when using
multiple pins in fast PWM mode.
Sometimes (when loading the circuit) at least one of the pins is stuck high until the circuit is reloaded.

Unfortunately, this behavior does not always occur.
So you might have to reload the circuit multiple times to trigger the problem.

I have included an example to attempt to showcase the problem, which is similar to the example m328_LED_PWM_Tim2_Interrupt, included in SimulIDE except that it makes use of more pins.

Any help would be greatly appreciated.
Best regards and thanks for your time.
Attachments
PWM not working with multiple pins on Atmega328p AttachmentArchive.zip
You don't have permission to download attachments.
(3 Kb) Downloaded 3 times

arcachofo

arcachofo

Thanks for reporting.
I will have a look.

arcachofo

arcachofo

I could reproduce the issue.

For me it is always PORTD3 not working.
Is it always the same in your experience?

momos



Hi, thanks for the fast answer.

I had the problem with different PWM pins. Sometimes even two at the same time. But it is very random.

arcachofo

arcachofo

Ok thanks, that helps.

arcachofo

arcachofo

Solved at Rev 1377.

momos likes this post

momos



Wow, that was fast. Thank you very much for your hard work.

arcachofo

arcachofo

Most of these bugs are just silly errors, very easy to fix.
If someone reports it, usually they are fixed immediately or in the next day.

In this case it was a variable not initialized, and the fix was just adding this line of code:
m_comMatch = 0;

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum