Post Go back to editing

ADuC841 PWM: random full duty cycle periode

Hello everybody! 

I'm working with the ADuC841's PMW on the "Single Variable Resolution" Mode on pins P3.4 and P3.3 (configured in sfr CFG841) and I'm having an awkward malfunctioning. 

Periodically PWM output presents periods where duty cycle jumps to 100% out of nowhere even when PWM0L and PWM0H presents differents values.

On yellow you can see the PWM output signal inverted. 

I have founded on the "ADuC841 Silicon Anomaly" document that PWM operation presents an issue when RAM Address 0x2E is modified causing the PWM timer to be reset. And the workaround proposed is to obviate that memory address but it didn't work for me. 

Does anyone have had a similar problem? Or does anyone know how solve it?

Thanks.

Best regards,

Federico D. Ceccarelli

Parents
  • In your code you have double "PWM1L" def. but the PWM0L def. is missing.

    PWM1H = 0x04;
    PWM1L = 0xCD;               <-

    PWM0H = 0x00;
    PWM1L = 0x2                   <- typo ?!?

    Also the datasheet says:

    In any of the 16-bit modes ofoperation (Modes 1, 3, 4, 6), user software
    should write to the PWM0L or PWM1L SFRs first. This value is
    written to a hidden SFR.

  • Hello AK1,

    Thanks for pointing out the mistake. It is a really good observation. I think may be it is a typo on the project.  I'll try to correct it and test it in the future.

    Unfortunately the equipment isn't available by the moment for new testing.

Reply Children
No Data