gopalakrishnan
Joined: 18 Jun 2010 Posts: 25
|
is it possible to use two software and one hardware uart |
Posted: Wed Jul 14, 2010 7:38 am |
|
|
hai to all
I need three uart. One is hardware and other two are software uart. How to utilize this? What I need is I have to connect GPS in hardware uart, where as Xbee in other (as one software uart works like a half duplex. thats why I am required two. One is for transmit while other is for receive). Is it possible to do like this? If so kindly provide some suggestion.
I had tried, the sample code by rotating a same data from software uart (making one as transmit while other as receive) and transfer the received data to the hardware uart. Finally I see the received data from hardware uart to the pc.
Code: |
#use rs232(baud=9600, xmit=pin_c6,rcv=pin_c7,stream=coma)
#use rs232(baud=9600, xmit=pin_B4,stream=comb)
#use rs232(baud=9600,rcv=pin_c0,stream=comc)
void main()
{
char c;
fprintf(comb,"A");
c=getc(comc);
fputc(c,coma);
}
|
I am using ccs compiler version 4.053.
kindly reply me |
|