Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

a serial communication between two AT89C51 chips

Status
Not open for further replies.

Maverickmax

Advanced Member level 1
Advanced Member level 1
Joined
Dec 6, 2004
Messages
404
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,298
Activity points
3,689
serial communication between two microcontrollers

Greeting everyone

Do you know any good tutorial for me to learn how to set up a serial communication between two AT89C51 chips in C language and a schematic layout?

Thank in advance

Maverickmax
 

at89c51 uart

To connect 2 51 microcontrollers you even dont need drivers (unless they are some distance apart). Just connect Rx os the first on with Tx of the second one and Tx of the first one with Rx of the second one + Common GND and your hardware is ready.

You will have to set-up boyh UART for the same baud-rate and configuration.

Other thing to consider is the use of serial port interrupts.

Another issue is the use of command-response protocol but this may put one controller in MASTER position and the other in SLAVE.
 

serial communication between two at89c51 chips

Oic.....

I will do that but can you please tell me more about serial interrupt port?

Is there any C programs for transmitting data between two devices?

Maverickmax
 

at89c51 serial communication

I am kind of struck at the moment because I am not sure how to transmit data from 8051 chip to another.

Please advise or give me some links

Maverickmax
 

at89c51 uart interrupt

Hi Maverickmax,

Your question has an complete answer in the book

"Patterns for time triggered Embedded systems" by M. J. Pont

(for 8051 micros)

in chapter 27 is presented a complete solution

One uC is declared master, and others are declared slaves.

Master emit 9 bit messages: 8bits=data (or adress for the selected slave)
Distinction between 8 bit data or 8bit adress of the slave is made by the 9'th bit emited by the master

UART is in mode 3 for both masters and slaves


Unfortunately an eletronic version of the "bible" doesn't exist , anyway here is some sample code in C (K*il) to get a fillng:

SCU_Am.c master
SCU_As.c slave software
 

at89c51 serial communication code in c

Hi

I would find the master and slave in the scheduler approach very useful for my future project but I only want to send data across to another AT89C51 (Receiver) in one way mode via wire.

For example, the first AT89C51 is designed to send a temperature reading across the wire to another AT89C51. That's it

Maverickmax
 

communication between two at89c51

Maverickmax said:
... I only want to send data across to another AT89C51 (Receiver) in one way mode via wire.

For example, the first AT89C51 is designed to send a temperature reading across the wire to another AT89C51.

Check attached file. You should use function UART_CommInit to initialize once every of two uC UARTs. Then one uC can use function UART_Putchar to send single char to another uC. And second uC will use UART_Getchar to receive this char. Also, to send more than one char you can use function UART_Printf.

This small UART lib is interrupt-driven with send/receive buffers, so you don't have to worry to check state of UART before sending/receiving new char. Buffer size is defined by TBUF_SIZE constant.

Good luck!
 

at89c4051 hardware serial communication

hi ;

i have made a serial communication between 89c2051 and 89c51 ,
but i didn't get a good results ,
i guessed it is because of their ossilators are seprate , i mean sender may change data when receiver is sampling input , so an invalid data whould be received ,
i at last wrote a program using 2 input/output pin for serial communication , but this way it was too slower than a ready UART .
i have talked about this problem in :
 

example of serial communication at89c51

hm_fa_da said:
i have made a serial communication between 89c2051 and 89c51 ,
but i didn't get a good results ,
i guessed it is because of their ossilators are seprate , i mean sender may change data when receiver is sampling input , so an invalid data whould be received ,

UART uses an asynchronous protocol, so separate oscillators have nothing related to your problem and you should search for bug in your program, especially in initialization procedure.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top