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 support@ccsinfo.com

[Solved]Serial Interrupt isn't working

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



Joined: 27 Apr 2007
Posts: 14
Location: UK

View user's profile Send private message

[Solved]Serial Interrupt isn't working
PostPosted: Thu Sep 05, 2013 3:42 pm     Reply with quote

I must be doing something very stupid as I can echo characters using a polled routine (tx & rx using realterm)

Code:
#include "18f87k22.h"
#fuses HSH ,PLLEN, NOWDT, NOPROTECT   // , NOLVP
#use delay(clock=58982400)
//#use rs232 (baud=19200, xmit=PIN_C6, rcv=PIN_C7, PARITY=N, BITS=8)
#use rs232 (baud=19200, xmit=PIN_G1, rcv=PIN_G2, PARITY=N, BITS=8)

void main()
{
   do {
        putc( getc() );
   } while (TRUE); // END OF MAIN LOOP
}


but when I try to use #int_rda

Code:
#include "18f87k22.h"
#fuses HSH ,PLLEN, NOWDT, NOPROTECT   // , NOLVP
#use delay(clock=58982400)
//#use rs232 (baud=19200, xmit=PIN_C6, rcv=PIN_C7, PARITY=N, BITS=8)
#use rs232 (baud=19200, xmit=PIN_G1, rcv=PIN_G2, PARITY=N, BITS=8)

#int_rda
void serial_isr() {
   putc( getc() );
}

void main()
{
   enable_interrupts(INT_RDA);
   enable_interrupts(GLOBAL);
   do {
      delay_ms(10000);
   } while (TRUE); // END OF MAIN LOOP
}


it doesn't work. What am I missing?

Thanks all.

Duncan


Last edited by duncangray on Thu Sep 05, 2013 4:51 pm; edited 2 times in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 05, 2013 3:56 pm     Reply with quote

See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=49148
duncangray



Joined: 27 Apr 2007
Posts: 14
Location: UK

View user's profile Send private message

PostPosted: Thu Sep 05, 2013 4:10 pm     Reply with quote

Thanks PCM programmer. You are quite correct.

I was having problems with the polled version on C6, C7 as well but that must be hardware.

Thanks again for your rapid help.


Duncan
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