CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Flickering during colour cycling

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
biozen



Joined: 08 Sep 2010
Posts: 10

View user's profile Send private message

Flickering during colour cycling
PostPosted: Sun Oct 03, 2010 1:17 am     Reply with quote

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
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Oct 03, 2010 3:27 pm     Reply with quote

This is the old problem of running the interrupt rate too fast,
compared to the time required for the PIC to execute the interrupt
handler code, and the user code inside the interrupt routine.
Read this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=43399
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group