Discussion in "8051 Discussion Forum" started by    yadavmahesh    Aug 18, 2010.
Wed Aug 18 2010, 07:08 PM
#1
hi, please help me out with circuit to connect two 89c51, one transmitter nand other receiver. also 7 segment is connected to the receiver side.
i tried it once with the sample i found in this forum but it worked only in proteus not with real hardware.. reply fast plz
Thu Aug 19 2010, 09:43 AM
#2
Hi,

8051(1) RXD < ----------------------------- 8051(2) TXD

8051(1) TXD -----------------------------> 8051(2) RXD

Please make circuit as above with necessary components and Write Program using Serial Communications Interrupts in Both uC.





--
Gurpreet Singh
IMBUENT TECHNOLOGIES PVT.LTD.
(INDIA)

www.imbuent.com,www.embeddedcraft.org

" A person who never make mistakes,never try new things"
Thu Aug 19 2010, 06:38 PM
#3
can you post codes you tried. let me see if there is any problem with code.
Fri Aug 20 2010, 03:25 AM
#4
I am using BiPOM's Micro C:

http://www.bipom.com/products/us/202.html

to have 2 8051 boards ( MINI-MAX/51-C2 ) talk to each other through the serial port. There is a NULL modem cable in between so RXD goes to TXD and TXD goes to RXD.

On both sides, I initialize serial port to 9600 baud using the C function serinit(9600>>1);

I use C function putch() on one side to send bytes to the serial port. I use getch() on the other side to receive the bytes.

I have not tried but it should be fairly easy to add a 7-segment display board like this:
http://www.bipom.com/products/us/924.html

Cheers

Ken
Fri Aug 20 2010, 06:53 AM
#5
i hope you are taking care of pin no.5 i.e. gnd

8051(1) RXD < ----------------------------- 8051(2) TXD

8051(1) TXD -----------------------------> 8051(2) RXD

8051(1) GND <----------------------------> 8051(2) GND
Fri Aug 20 2010, 11:12 AM
#6
i have not grounded pin no. 5 of each, is it neccesary. my code for transmitter n receiver is below.
transmitter side

#include <REGX51.H>
void main()
{

int sig=0x55; // signal to be transmitted.


TMOD=0x20; // selecting Timer 1, with mode 8bit auto reload.
TH1=0xFA; // setting baud rate = 4800
SCON=0x50; // setting the 8bit Control reg which control the SBUF with RC5
TR1=1; // starting the timer
while(1) // thios point onwards the code is sending 0x55 all the time
{
SBUF=sig;
while(TI==0);
TI=0;
}
}
receiver side


#include <AT89X51.H>
#define d P2

void main()
{
char rxdata; // this variable recieves data
TMOD=0x20; // selecting Timer 1, with mode 8bit auto reload.
TH1=0xFA; // setting baud rate = 4800
SCON=0x50;
TR1=1;
while(1)
{
while(RI==0); // this line will wait for the data to come
rxdata=SBUF; // as soon as the data is recieved its tranferred to a variable so that the next variable doesnt overwrite the data just receieved
RI=0; // clearing the flag.

if(rxdata==0x55)
d=0x24; // 0x24 displays 2 on the 7-seg

}}










Fri Aug 20 2010, 11:18 AM
#7

about circuit

7 segment is LT542. pin no 21 to 27 are connected to 7 pins of 7seg.. vcc is aplied to 3and 8 pin. pin 5 is left unused


8051(1) RXD < ----------------------------- 8051(2) TXD

8051(1) TXD -----------------------------> 8051(2) RXD....>7seg display(common anode)

plz help me for this ..
n thanx for replies
Fri Aug 20 2010, 07:29 PM
#8
you have to make changes in your circuit to free pins required for communication. try moving 7-seg display pin to other unused pin. or better if you can post your schematic here.
Sat Aug 21 2010, 06:06 AM
#9
Is the code I posted above is correct. If not please modify it and would you please mind simulating it in Proteus. I simulated it in Proteus and it worked there.

Mon Aug 23 2010, 11:07 AM
#10
your hardware probably not matching your software then..

coz how is this possible?

8051(1) TXD -----------------------------> 8051(2) RXD....>7seg display(common anode)



i dont see anything in circuit above.

Get Social

Information

Powered by e107 Forum System

Conversation

No messages yet.

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 104, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123