Halo Frndz, Im using C8051F132 Silabs MCU .. I want to know that how to set UART1 baud rate.. I have came across few formula's.. but i didnt get the exact value.. My seniors done this configuration..Unfortunately they are here to clear my doubts.. i have seen our keil baud rate generator.,but i want to know that how it comes///
our program configuration contains:
void InitF132 (void) { SFRPAGE = TMR3_PAGE; TMR3CN = 0x04; RCAP3L = 0xCC; //F8CC=63692=1000 INT/SEC=1MS for 22.1184MHz RCAP3H = 0xF8; SFRPAGE = ADC0_PAGE; AMX0SL = 0x07; ADC0CN = 0x80; SFRPAGE = TIMER01_PAGE; TMOD = 0x20; TH1 = 0xA0; //UART1 Baud rate 0xA0 = 9600, 0xD0 = 19200,22.1184MHz //CKCON = 0x01; //CLOCK Source = SYSCLK / 4 TR1 = 1; SFRPAGE = SPI0_PAGE; SPI0CFG = 0x70; SPI0CN = 0x0D; //09 SPI0CKR = 0x0A; //SPI Clock Rate Register OSC/22=1000 khz
My ques is 1. What is the exact formula to find the baud rate & TH1 ?? (They have taken 8bit auto reload mode 2 timer 1 (TMOD)) 2. Why there is no SCON intialization in it??
1. What is the exact formula to find the baud rate & TH1 ?? the one in the datasheet 2. Why there is no SCON intialization in it?? because it is missing