View previous topic :: View next topic |
Author |
Message |
sjharris
Joined: 11 May 2006 Posts: 78
|
Two serial ports |
Posted: Tue May 13, 2008 4:06 am |
|
|
Hello all,
I have two serial ports set up, one is the hardware serial port the other is a software serial port, the INT(RA) works fine for the hardware port but, is there any way to get the software port to interrupt the program??
Kind Regards
Stephen
PS I Have a 16f688 |
|
![](templates/subSilver/images/spacer.gif) |
meereck
Joined: 09 Nov 2006 Posts: 173
|
|
Posted: Tue May 13, 2008 5:22 am |
|
|
Connect RS232 receive signal also to the INT_EXT pin and use ext_int_edge(H_TO_L);, the interrupt will be fired when the start bit occurs . Use #int_ext to get the char. call fgetc within the interrupt routine.
It should be noted, in contrast to the hw UART, the interrupt will be called once the transmission starts. Within the HW UART, the RDA interrupt is called when the byte is ready in the receive buffer. |
|
![](templates/subSilver/images/spacer.gif) |
|