Serial communication between two microcontrollers

Thread Starter

jayec1a

Joined Feb 28, 2012
6
hi!! i want some help in my project about serial communication between two 8051 mcs. I want an assembly program, and yes i want two serially transfer data between two 8051 mc only!! No pc comes in between!!!! please help me!!!
thanks in advance :)
 

Arm_n_Legs

Joined Mar 7, 2007
186
Initialising your serial comm:
MOV SCON,#50H
MOV TMOD,#20H
MOV TH1,#0FDH
SETB TR1

Transmit:
MOV SUF,'A'
WAIT: JNB TI,WAIT

Receive:
JNB RI,ELSEWHERE
MOV A,SBUF
 

olphart

Joined Sep 22, 2012
114
Howdy, roll your own (as I did) or use the uC modules' version. I prefer mine, if only that if (when) it fails, I can trace it since I wrote it. That, and I inevitably need to port it to a uC that doesn't have the module. This also allows for variables to define timings (delays) as required for any of the devices in the bus/link.

While an async link is easy, it's also (comparatively) slow. An I2C link is as fast as each state machine can keep up; with both ends in assembler, it Flies. Good Hunting... <<<)))
 
Top