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

printf or scanf using Second UART in DS89C450

Hi,
I am interfacing PC + DS89C450 + GPRS where I will send AT command from PC terminal (serial port 0) and DS89C450 will send the command to gprs modem (via serial port 1). Then the reply will go from gprs modem -> DS89C450-> PC terminal.

Now serial port0 works fine with the following configuration.

/**********Serial port initialization**************************/
SCON0 = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 252; /* TH1: reload value for 14400 baud @ 22.1184MHz */
TR1 = 1; /* TR1: timer 1 run */
TI_0 = 1; /* TI: set TI to send first char of UART */

/************End of serial port initialization****************/

But For same settings (SCON1 instead of SCON0) serial port 1 doesn't work. I send scanf and printf command to serial port 0 which works fine .But for Serial port 1 it doesn't work.

What am I missing? How printf and scanf can be used/configured for second UART?

Please suggest me.

Thank you.

0