biozen
Joined: 08 Sep 2010 Posts: 10
|
Flickering during colour cycling |
Posted: Sun Oct 03, 2010 1:17 am |
|
|
Hello,
I have a set up where a PIC16F690 cycles the PWM level to a three RGB leds connected to Port C pins 0, 1 and 2.
The hardware is such that, setting the pin switches the LED ON. Clearing the pin switches the LED OFF.
Duty cycle = 001 is when LED is full on and 255 is when LED is off.
The code seems to perform well, but every few cycles the LEDs seem to flicker. That is, in the middle of a cycle while the intensity is decreasing/increasing the LEDs switch OFF and ON. I've checked and it seems the flicker isn't random. I think I detect a 'periodicity' in the flicker, which suggests to me that all is not well in the interrupt routine. I think the flicker happens in the LEDs that are decreasing or increasing.
This is my first program in CCS, as I'm moving towards C from assembler. I'm fairly unclear about the innards of ISR handling in C, and will be looking more closely at the asm it generates to find a reason for this.
In the meantime, can somebody assist me about the reason on the flicker?
Regards,
MM.
Edit: Some details corrected.
Last edited by biozen on Sat Feb 05, 2011 12:40 am; edited 1 time in total |
|