I want to connect PIC16F877 to PIC16F84 by using serial comm

Status
Not open for further replies.

mohamedattia35

Newbie level 1
Joined
Feb 7, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
connect two pic16f84


Hi, every one
I have a problem when I try to connect two PIC u controllers (PIC16F877) and (PIC16F84) by using serial communication.

I test each PIC separately and they work well with virtual PC terminal.

The serial communication settings are : Baud rate = 9600, 8 bit without parity.

Each u Controller separately send and receive data correctly to and from the virtual PC terminal.

I use these commands for send and receive data :

For send data : (PIC16F877)
---------------
declare Xtal = 20
SERout portB.2, 16468 , ["00" , 13]
SERout portB.2, 16468 , [DEC 11 , 13]
SERout portB.2, 16468 , [DEC 10 , 13]


For receive data : (PIC16F84
-----------------
declare Xtal = 4
dim serdata as byte
SERIN portB.2 , 16468 , [DEC serdata]

Can any one have an idea about this situation.


---------------------------------------------------
Thank you ...
Mohamed Attia
technical(at)tibatech.com
mohamedattia35(at)yahoo.com
 

Re: I want to connect PIC16F877 to PIC16F84 by using serial

Well I'm not that expert in picbasic, but I think the problem is timing. 16F84 doesn't really have a usart so there is no buffer to store incoming data. 16f877 in the other hand has.

About the timing, 16f84 waits only for a certain time for the incoming data (timeout) after which, if it doesn't receive any data it jumps to another program or the next program line is executed then the next..then the next. So problem is if the 16F877 is sending data, 16F84 might not be listening.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…