This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Serial port RX Problem - baudrate 9600 setting

I have a strange problem in my code. I cannot receive correct characters via the serial port if I write TH1=0xFD in my code.
But if I write TH1=0xFE in my code, I can run the program correctly.

Why?

Appreciate any response!

athena tsai

-----------------------------------

#include "reg51.h"
#include "stdio.h"

void main (void) { SCON = 0x50;

TMOD |= 0x20;

TH1=0xFE; TR1=1; TI=1; while(1) { unsigned char aaa;

aaa=_getkey();

putchar(aaa); } }