Hello,
Im using a PIC24F and I need to do the following: time multiplexing of two LEDs. I mean, at a given time the "LEDx" is ON and "LEDy" is OFF and another time the opposite. This is done at a fixed frequency (~ 200Hz).
I thought of using PWM with small duty cycle (~ 1%) for more efficient use of battery. An LED is always ON on the positive edge of the PWM. For example, if a frequency of 1 kHz is used, each LED will light 500 times.
However, I do not know whether I have enough control over the PWM to do this. Is there a way of knowing that Im on the positive edge of the PWM? In terms of code, I need to know what LED is being excited. I dont know if I can do that using PWM.
I dont have much experience in programming MCUs but I did read something about Capture module... Can I detect the positive edges of the PWM with one of these modules?
When an LED lights I need to do some processing, for example from an ADC. This processing is different for each LEDs, thats why I need to know what the LED PWM is exciting.
Thanks
Im using a PIC24F and I need to do the following: time multiplexing of two LEDs. I mean, at a given time the "LEDx" is ON and "LEDy" is OFF and another time the opposite. This is done at a fixed frequency (~ 200Hz).
I thought of using PWM with small duty cycle (~ 1%) for more efficient use of battery. An LED is always ON on the positive edge of the PWM. For example, if a frequency of 1 kHz is used, each LED will light 500 times.
However, I do not know whether I have enough control over the PWM to do this. Is there a way of knowing that Im on the positive edge of the PWM? In terms of code, I need to know what LED is being excited. I dont know if I can do that using PWM.
I dont have much experience in programming MCUs but I did read something about Capture module... Can I detect the positive edges of the PWM with one of these modules?
When an LED lights I need to do some processing, for example from an ADC. This processing is different for each LEDs, thats why I need to know what the LED PWM is exciting.
Thanks