Sign in

username:

password:



Not a member?

Search LPC900_users



Search tips

Subscribe to LPC900_users



Ads

Discussion Groups

Discussion Groups | LPC900 | UART Baud Rate and Power Down Interaction?

Find help, specifications and source code for the LPC900. The LPC900 challenges Microchip and AVR based on the worlds most popular 8-bit architecture the 80C51. With a 2-clock core the LPC900 series is a high performance, very flexible and low cost 8-bit microcontroller family. Designers using or interested in these devices are encouraged to share their know-how and ask questions.

UART Baud Rate and Power Down Interaction? - maciej_wiatr - Mar 19 18:19:13 2007

Hi there,

I'm having problems putting the LPC into the total power-down mode
when using a boud rate of 9600 for the UART interface. The courious
thing is that everything works fine, when I use the rate of 19200.

Does enybody have an idea, why these two generally idependent
functions should interact?

The uart_init look like this (rate is a local bit variable, I'm using
the internal RC oscillator, mode 1 for UART and the boude rate generator):

// configure UART
// clear SMOD0
PCON &= ~0x40;
SCON = 0x50;
// set or clear SMOD1
PCON &= 0x7f;
PCON |= (0 << 8);
SSTAT = 0x00;

// configure baud rate generator
SCON = 0x52; /* initialize UART */
BRGCON = 0x00;
if( rate )
{
// for 19200 baud, 8 bit, no parity, 1 stop bit
BRGR0 = 0x70;
BRGR1 = 0x01;
}
else
{
// for 9600 baud, 8 bit, no parity, 1 stop bit
BRGR0 = 0xF0;
BRGR1 = 0x02;
}
//
BRGCON = 0x03;

Power down is turned on by

PCON |= 0x03;

Any hints?

Thanks,
Maciej



(You need to be a member of LPC900_users -- send a blank email to LPC900_users-subscribe@yahoogroups.com )