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

18F252 Serial Interrupt

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



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

18F252 Serial Interrupt
PostPosted: Tue Mar 30, 2004 4:06 pm     Reply with quote

#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

#int_RDA
void RDA_isr(){

status = getc();

}


void main () {
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);



}

I had this working fine all day, now it will not interrupt. I know my data is transmitting out and I see the response on the scope, however, the interrupt is not doing it. Are there some bits I need to check to clear errors etc???
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 30, 2004 4:42 pm     Reply with quote

You can add the Errors directive to the #use rs232 statement. Example:
Code:
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8, ERRORS)

I hope that's not your entire program. If you let it fall off the end
of main(), it will hit a sleep instruction, inserted by the compiler,
and go to sleep. Then upon getting an RDA interrupt, it will wake up,
service the interrupt, and then begin execution of code after the
SLEEP instruction. Only, what code is after that point ? NOPs ?
or garbage ? It's best to prevent this by putting a while(1);
statement right before the end of main().
ljbeng



Joined: 10 Feb 2004
Posts: 205

View user's profile Send private message

PostPosted: Tue Mar 30, 2004 4:47 pm     Reply with quote

I just wanted to show all the major lines of code needed. I realize that is not a complete program.
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