Specification for AT89C51 Baud rate - 9600 Clock - 12MHz SMOD - 1 TH1 - 0xF9 so is my code correct? Code: void serial_send() { SCON=0x50; TMOD=0x20; TH1=0xF9; TR1=1; TI=1; } Confusedman
http://www.keil.com/c51/baudrate.asp http://www.8052.com/forum/read.phtml?id=103744
also, get rid of the 12MHz crystal and get an 11.0592MHz one. If you must use a 12MHz for other reasons, use timer 2 which has a finer resolution for the UART baud. Erik
No Timer 2 on a AT89C51, so you need an 11.0592 MHz Crystal
Thank you for letting me know as I have learnt a great deal from the link and your information. In fact I believed that 11.059MHz would be ideal to replace 12MHz due to better accuracy but I wanted to make sure. So thank you again Confusedman