CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

16F876 rs232

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Pierre
Guest







16F876 rs232
PostPosted: Fri Dec 27, 2002 11:42 pm     Reply with quote

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
PostPosted: Mon Dec 30, 2002 4:42 am     Reply with quote

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
PostPosted: Mon Dec 30, 2002 10:04 am     Reply with quote

#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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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