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.

2 MCUs communicate with each other

Status
Not open for further replies.

ericmar

Full Member level 5
Joined
Apr 14, 2004
Messages
278
Helped
3
Reputation
6
Reaction score
4
Trophy points
1,298
Location
Singapore
Activity points
2,928
Hi,

May I know how do ppl normally implement when a design has 2 MCUs. How does both MCU communicate with each other? Through UART? or SPI? Or...?

Wats the most effective way to implement this?

Thanks,
Eric Mar
 

Depends on the ammount of data you want to pass between. Iy ou need a lot, use SPP, if not, use SPI.
 

hai
it depends on a lot of parameters
if the distance between the mcu's are less than say 25 meters,you can use the rs 232 communication protocol
i feel this is the easiest way of communication because of less code comlexity in small distance.
if the distance is more you can use rs485

ml
 

In automotive industry, there is three main types of MCU networks in which MCUs are communicating.
The most widely used one is the CAN protocol, a lot of MCUs implements have CAN modules. CAN frame can carry up to 8 bytes.
 

Wat if both MCUs r on the same PCB? The main MCU is used to take in input signal from button, ADC, etc. whereby the 2nd MCU is used to interface with a graphic controller to drive a color LCD.
 

In this case (On board communication) then SPI is the best as it works as Master/Slave communication.
 

yasser_shoukry said:
In this case (On board communication) then SPI is the best as it works as Master/Slave communication.
U not using UART?
I never try the SPI. How does it differ from the UART?

Thanks,
Eric Mar
 

ericmar said:
yasser_shoukry said:
In this case (On board communication) then SPI is the best as it works as Master/Slave communication.
U not using UART?
I never try the SPI. How does it differ from the UART?

Thanks,
Eric Mar

SPI is synchronous communication while UART is Asynchronous. Being synchronous, SPI is much faster than UART.

SPI & I2C are both implemented for In-Board communication, both of them uses synchronous clock signal to synchronize the communicating devices, all communicating devices must be within the same board to reduce clock skew.

SPI is used basically to communicate between high speed devices and to extend MCU with additional peripherals.
 

    ericmar

    Points: 2
    Helpful Answer Positive Rating
hi

i don't no about Serial Periferal Interface ( SPI ),but the two Uc's can communicate with NULL modem connection.
 

microlab said:
hai
it depends on a lot of parameters
if the distance between the mcu's are less than say 25 meters,you can use the rs 232 communication protocol
i feel this is the easiest way of communication because of less code comlexity in small distance.
if the distance is more you can use rs485

ml

It is important to mention that for these distances you will need to use Voltage level converters like max232.
or MAX3483 for RS485
Otherwise reliable distances I guess will be few meters.
--------------------------
http://www.scienceprog.com - Embedded electronics
 

Using SPI module is similiar to UART, bu it has only one buffer SSPBUF. Comm is initialized when you write something to it. Read dats sheet for details.
 

it depends upon the condition .......

if u need high speed communication then SPI

if have asyn link the u can use serial comm

if there is noisy environment then CAN is the best choose but it can worl upto 1MHz
 

I have made communication between PIC18F258 and PIC16F877 over
SPI. One was master, second worked like SPI-Flash-mermory.
Common data located in the slave.

Let me know, if you need an examples code.

Best regards.
 

It depends on the application tat means how much data, distance,speed.like tat tell ur specification
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top