2006-05-02 04:04 AM
2006-05-01 08:00 PM
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. Hello2006-05-02 04:04 AM
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 ]