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
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.
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.
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
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.
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.