??? 09/05/05 12:51 Read: times |
#100610 - why -ve sign is used in cal of baudrate |
Hi all,
Iam working on c8051f005,iam performing serial commmunication.Iam using timer1 autoreload mode 2,during calculation of baudrate here using -ve sign,what is the significance of -ve sign.please suggest me please go through the code. void UART0_Init (void) { SCON = 0x50; // SCON0: mode 1, 8-bit UART, enable RX TMOD = 0x20; // TMOD: timer 1, mode 2, 8-bit reload TH1 = -(SYSCLK/BAUDRATE/16);// set Timer1 reload value for baudrate TR1 = 1; // start Timer1 CKCON |= 0x10; // Timer1 uses SYSCLK as time base PCON |= 0x80; // SMOD00 = 1 (disable baud rate // divide-by-two) TI = 1; // Indicate TX0 ready } Thanks in advance raghav |