|
|
View previous topic :: View next topic |
Author |
Message |
Pierre Guest
|
16F876 rs232 |
Posted: Fri Dec 27, 2002 11:42 pm |
|
|
This is a snippet of the code I'm using on the 'recieving' PIC. I have two 16f876 pic's with the tx of #1 connected to the rx of the other, and vice versa.
while(TRUE){
output_high(PIN_A0);
if ('a' == getc()) output_b(0xFF);
else output_b(0x00);
delay_ms(100);
output_low(PIN_A0);
delay_ms(100);
}
I have an led connected to A0. My problem is that when I power the recieving pic up, the LED blinks 3 times then stays on solid, even when nothing is being sent to it or no wires at all are hooked to the tx/rx pins. An ideas? This is 100\% consistent too, happens every time I power it up, so I think I may be implementing the software rs232 wrong.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10284 |
|
|
nilsener Guest
|
Re: 16F876 rs232 |
Posted: Mon Dec 30, 2002 4:42 am |
|
|
Please post your complete #use rs232 statement.
regards nilsener
:=This is a snippet of the code I'm using on the 'recieving' PIC. I have two 16f876 pic's with the tx of #1 connected to the rx of the other, and vice versa.
:=
:=while(TRUE){
:=
:=output_high(PIN_A0);
:=if ('a' == getc()) output_b(0xFF);
:=else output_b(0x00);
:=delay_ms(100);
:=output_low(PIN_A0);
:=delay_ms(100);
:=}
:=
:=I have an led connected to A0. My problem is that when I power the recieving pic up, the LED blinks 3 times then stays on solid, even when nothing is being sent to it or no wires at all are hooked to the tx/rx pins. An ideas? This is 100\% consistent too, happens every time I power it up, so I think I may be implementing the software rs232 wrong.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10323 |
|
|
Pierre Guest
|
Re: 16F876 rs232 |
Posted: Mon Dec 30, 2002 10:04 am |
|
|
#use rs232(baud=9600, xmit=PIN_C6, rec=PIN_C7, parity=N, bits=8)
I have worked on this some more and realized that when I had a common ground between the two PIC's, all seemed to work well. So that took care of that problem. Also when using an rf transmitter and receiver pair from rentron.com to link the two instead of a copper wire, it would work without a common ground. Something to do with sharing a signal ground..?...
:=Please post your complete #use rs232 statement.
:=
:=regards nilsener
:=
:=:=This is a snippet of the code I'm using on the 'recieving' PIC. I have two 16f876 pic's with the tx of #1 connected to the rx of the other, and vice versa.
:=:=
:=:=while(TRUE){
:=:=
:=:=output_high(PIN_A0);
:=:=if ('a' == getc()) output_b(0xFF);
:=:=else output_b(0x00);
:=:=delay_ms(100);
:=:=output_low(PIN_A0);
:=:=delay_ms(100);
:=:=}
:=:=
:=:=I have an led connected to A0. My problem is that when I power the recieving pic up, the LED blinks 3 times then stays on solid, even when nothing is being sent to it or no wires at all are hooked to the tx/rx pins. An ideas? This is 100\% consistent too, happens every time I power it up, so I think I may be implementing the software rs232 wrong.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10333 |
|
|
|
|
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
|