Serial communication between two microcontrollers

Discussion in 'Programmer's Corner' started by jayec1a, Sep 12, 2012.

  1. jayec1a

    Thread Starter New Member

    Feb 28, 2012
    6
    0
    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 :)
     
  2. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Connect RX from one 8051 to TX of the other and vise versa.... configure the UARTS and write code to send and receive data....

    If you need sample code use google to do a search there are plenty of examples out there like this >> http://www.atmel.com/tools/CODEEXAMPLESFOR8051UART.aspx
     
  3. Arm_n_Legs

    Active Member

    Mar 7, 2007
    183
    10
    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
     
  4. olphart

    New Member

    Sep 22, 2012
    5
    0
    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... <<<)))
     
Loading...