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

How to set serial port 0 on a DS89C450?

Hi, in my circuit I use a DS89C450 and I'd like to comunicate with it via serial port 0. I use a crystal of 11.0592 MHz and the baud rate should be 57600bps. How do I configure the serial port registers to work?
So far I've tryed this:
void serialInit (void)
{
TMOD = 0x21; // Timer 1: 8-bit autoreload from TH1
TH1 = 0xff;
CKMOD = 0x38; // Use system clock for timer inputs
T2CON = 0x00; // Serial 0 runs off timer 1 overflow
TCON = 0x50; // Enable timers 0 and 1
SCON0 = 0x50; // Enable serial port 0
SBUF0 = ' ';
}

It works in the emulated serial window of the debugger but once the program is running on the real micro i get messed-up data from it.

Please help!

0