Skip to main content
Visitor II
May 2, 2006
Question

asynchronous data transmission.

  • May 2, 2006
  • 2 replies
  • 708 views
Posted on May 02, 2006 at 13:04

asynchronous data transmission.

    This topic has been closed for replies.

    2 replies

    Visitor II
    May 2, 2006
    Posted on May 02, 2006 at 05:00

    dear

    i am using keil uvision 2 version 4 for st10f269 while programming in c.

    what settings are needed for asynchrous data transmission for

    1 start bit

    one even parity bit

    9600 buad rate

    one stop bit.

    Hello

    Visitor II
    May 2, 2006
    Posted on May 02, 2006 at 13:04

    Hello,

    The routine below defines the asked settings needed for asynchrous data transmission:

    void ASC_Initialize ( void)

    {

    /* Select 8-bit asynchronous communication; one even parity, one stop bit, no errors checking, receiver enable */

    S0CON = 0x0011;

    /* Baudrate 9600, FCPU = 40 MHZ, SOBRS = 0 -> S0BG = 0x0081 */

    S0BG = 0x0081;

    /*Tx0 : P3.10 -> output direction , Rx0: P3.11 -> Input direction */

    DP311 = 0;

    _nop_();

    DP310 = 1;

    _nop_();

    P310 = 1;

    /* Set the S0R to enbale the ASC0 interface */

    S0CON |= 0x8000;

    /* Set the S0TBIR to trigger the transmission */

    S0TBIR = 1;

    }

    Hope this helps you.

    Najoua.

    [ This message was edited by: Najoua on 02-05-2006 16:37 ]