|
|
View previous topic :: View next topic |
Author |
Message |
cam_male2003
Joined: 21 Sep 2005 Posts: 12
|
RDA Interrupt not working |
Posted: Tue Apr 18, 2006 12:42 pm |
|
|
I am using 18lf8722 and are using both uarts. Here is the RS232 Line in my code
#use rs232(baud=2400,xmit=PIN_c7,bits=8,parity=n,rcv=PIN_c6,ERRORS,STREAM=USB) //,disable_ints) //USB CHECKED OK, could not get RDA to work
#use rs232(baud=2400,xmit=PIN_g1,rcv=PIN_g2,RESTART_WDT,parity=n,bits=8,ERRORS,STREAM=RS232) //,disable_ints) //works with RS232
I enabled the RDA Interrupt. But it does not work.. Any Ideas? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 18, 2006 1:14 pm |
|
|
You have to use the correct pins and you have to use the correct
statement to invoke the RDA interrupt for the 2nd serial port.
Example:
Code: |
#include <18F8722.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=2400,xmit=PIN_C6, rcv=PIN_C7, ERRORS, STREAM=USB)
#use rs232(baud=2400,xmit=PIN_G1,rcv=PIN_G2,RESTART_WDT, ERRORS,STREAM=RS232)
#int_rda
void rda_isr()
{
char c;
c = fgetc(USB);
}
//------------------
#int_rda2
void rda2_isr()
{
char c;
c = fgetc(RS232);
}
//=======================
void main()
{
while(1);
} |
|
|
|
cam_male2003
Joined: 21 Sep 2005 Posts: 12
|
|
Posted: Tue Apr 18, 2006 1:19 pm |
|
|
thank you.. I will get the second one fixed |
|
|
|
|
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
|