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

Fast PWM mode does not work properly on ATmega328P.

2 posters

Go down  Message [Page 1 of 1]

tomas714



Hello,

it looks like Fast PWM mode is not working properly in the mode where the TOP value is defined by the ORC0A register. The mode is selected using bits WGM00/01/02 = 1/1/1 in registers TCCR0A/B.

I checked the correct bit settings in the program and in the MCU monitor, but the PWM was incorrect. It looks like the value in OCR0A is ignored and the value 0xFF is considered to be the TOP value.

Attached is both the program and the schematic.

PS: I am useing Simulide 1.1.0-RC at Rev 1987

Have a nice day.
Thanks.
Attachments
Fast PWM mode does not work properly on ATmega328P. Attachmentprogram-and-schematic.zip
You don't have permission to download attachments.
(6 Kb) Downloaded 2 times

arcachofo

arcachofo

Hi, thanks for reporting.
Problem solved at Rev 1988.

As a workaround set the OCRx registers after TCCRxx registers.
For example:
Code:
   TCCR0A |= (1 << COM0B1);
    TCCR0A |= (1 << WGM00);
    TCCR0A |= (1 << WGM01);
    TCCR0B |= (1 << WGM02);
    TCCR0B |= (1 << CS01);

    OCR0A = 88;
    OCR0B = 44;

Back to top  Message [Page 1 of 1]

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