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

led blinking issue

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



Joined: 16 Apr 2015
Posts: 21
Location: India

View user's profile Send private message

led blinking issue
PostPosted: Mon Feb 01, 2016 4:50 am     Reply with quote

hi,
In our project, we have 2 set point values (example, 5 and 10 ). When one set point crosses, one led starts blink continuously. When 2nd crosses, 2nd led will start blinking.
We used timer interrupt for leds blinking. Timer0 for led1 and timer1 for led2.
When we press one switch (sw1), led become stable. And when the reading comes below the set points and press another switch (sw2), led will be off.
Code:

#int_RTCC
void RTCC_isr(void)
{
 
  output_toggle(RL2);
 
  //output_low(RL1);
   
   delay_us(1);   
   output_high(CLK);
   delay_us(1);
   output_low(CLK);
   delay_us(1);
   
}

#int_TIMER1
void TIMER1_isr(void)
{

output_toggle(RL1);
//output_low(RL2);
delay_us(1);
output_high(CLK);
delay_us(1);
output_low(CLK);
delay_us(1);
}

According to the code written, when the reading is above 10, both leds should blink continuously. Sometimes both will ON and OFF same time. But when the reading goes below points and again goes above 10, both leds will blink at different times. Ie, when led1 is on, led 2will be off. When led1 is off, led2 on. Like that blink continuously.
According to the code written the above thing is fine. But we need both leds blink at same time when cross the reading 2. And when comes down also, until press sw2.
What changes I have to do for that ?
Please guide me.
temtronic



Joined: 01 Jul 2010
Posts: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Feb 01, 2016 6:12 am     Reply with quote

You need to show us your complete PIC program not jst parts of it
Also which PIC and what compiler version
Also most important is this real wharware or a simulator,very ,very important to know this!

Jay
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