duncangray
Joined: 27 Apr 2007 Posts: 14 Location: UK
|
[Solved]Serial Interrupt isn't working |
Posted: Thu Sep 05, 2013 3:42 pm |
|
|
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 |
|