Problem Description: Normally, the firmware output a PWM of constant 80% duty cycle and 2.5KHz frequency by PWM1 port. After our device has run several hours, the PWM output change to constant 1% duty cycle and 2.5KHz. The 1% duty must not be set by firmware, it is a abnormal value. I had try to turn off the device and power-on again, and reset the MCU by /RESET pin, but the error state is still held. Then i try to burn the firmware into flash by BDM, the error is removed and the duty of PWM output is normal. Additional, i had check the firmware image by reading from the fault device by BDM, the image is same with the normal one.
Please help to analysis the error. Thanks!
Hi,
Can you reproduce the fault? Have you tried another chip?
Do you initialize the PWMDTYx register with a constant or a variable/pointer?
Does the rest of the MCU work correctly during the PWM failure?
Regards,
Daniel
After the fault is removed by re-burn the flash, these deives has been running for about twenty-four hours, currently they seem normal. The rest of MCU should be working correctly, such as CAN communication, we can read state and control the deivce ON/OFF by CAN, but changing duty by CAN is invalid, in other words, only the PWM duty part is abnormal.
While running without external CAN command, the PWMDTY01 register is set with a two bytes constant.
In the previous test, ten of evleven devices has the failure, then we thought it is a common phenomenon, so we don't try another chip.
Daniel, thanks for your support.