View previous topic :: View next topic |
Author |
Message |
mombellardo
Joined: 16 Apr 2004 Posts: 3
|
multiple hw rs232 |
Posted: Tue Sep 27, 2005 3:45 am |
|
|
Thanks Mark.
What can I do If I have to transmit with RS232 #1 while I'm receiveing (interrupt enabled) with RS232 #2? How can I manage this situation? _________________ momb |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Sep 27, 2005 6:27 am |
|
|
There are separate transmit and receive interrupts for each hardware uart. So there is no problem. If using the printf() statement. Specify a stream in the #use rs232 statement and then use fprintf(). |
|
|
mombellardo
Joined: 16 Apr 2004 Posts: 3
|
|
Posted: Tue Sep 27, 2005 10:17 am |
|
|
OK, all is separate. But when I have to send a character (or more) in the program, if I use the instruction putc() (for example in a loop) how can I address the correct RS232 channel? _________________ momb |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Sep 27, 2005 11:52 am |
|
|
STREAMS
value = fputc(cdata, stream1)
value = fputc(cdata, stream2)
#use rs232(baud=19200,xmit=PIN_E0,INVERT,stream=stream1,DISABLE_INTS)
#use rs232(baud=1200,errors,xmit=PIN_C6,rcv=PIN_C7,parity=e,enable=PIN_C5,bits=8,stream=stream2) |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Sep 27, 2005 12:20 pm |
|
|
Yeah, what he said |
|
|
|