Dear Dialog_Support,
I am using timer0 pwm0 to operate and control LED brightness using timer0_set(uint16_t pwm_on, uint16_t pwm_high, uint16_t pwm_low); function. If i give timer0_set(0xFF, 0XFF, 0) then also my LED is not getting ON fully. Then i have used timer0's PWM1 then LED should fully turn OFF when i call timer0_set(0xFF, 0xFF, 0) but my LED is not going to OFF fully. LED glows at 5-10% brightness. And if i call timer0_stop function, then LED turns OFF fully. What could be the reason?
Keywords:
Device:
Hi Ruchi Patel,
The timer when operating in PWM mode will load the values TIMER0_RELOAD_N_REG and TIMER0_RELOAD_M_REG which are 16-bit values so, if you use 0xFF and 0x00 then you should generate a PWM pulse with a duty cycle small enough and a frequency in order to see the LED dimming, but if you load to the TIMER0_RELOAD_M_REG the full value of the timer 0xFFFF, then you will get a duty cycle where which will be enough in order to fully light a LED and keep the other LED connected to the PWM1 turned off. But there will be a pulse, it will just be for a fraction of time.
Thanks MT_dialog