Discussion in "8051 Discussion Forum" started by    yadavmahesh    Aug 19, 2010.
Thu Aug 19 2010, 12:38 am
#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, 03:13 pm
#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"
Fri Aug 20 2010, 12:08 am
#3
can you post codes you tried. let me see if there is any problem with code.
Fri Aug 20 2010, 08:55 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, 12:23 pm
#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, 04:42 pm
#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, 04:48 pm
#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
Sat Aug 21 2010, 12:59 am
#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, 11:36 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, 04:37 pm
#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

Downloads

Comments

Sazrzhk
Sun Oct 06 2024, 01:34 am
Sazrjgz
Sun Oct 06 2024, 01:23 am
Dnrthvf
Sat Oct 05 2024, 08:39 pm
Dnrthwo
Sat Oct 05 2024, 08:27 pm
Mofredka
Sat Oct 05 2024, 03:43 pm
ErnestClagS
Sat Oct 05 2024, 06:44 am
Arisha4Et
Fri Oct 04 2024, 05:53 pm
LancenuT
Fri Oct 04 2024, 02:15 pm