Main Menu

lpc932 and baudrate

Started by Massimo, April 28, 2004, 11:32:15 PM

Previous topic - Next topic

Massimo

Hi,
j had lot of problems using ISP programming of the LPC932. The problem arises after j changed the crystal configuration in the UCFG1 byte (j choose high frequency oscillator), default is internal RC oscillator 7.373 Mhz.
The crystal used in my circuit is 4 Mhz.

After that j was not able to start again the ISP mode until j choose 7200 bps for the baudrate of connection!

J believed the bootloader of the LPC932 can do some kind of baudrate autodetect..but it seems not to function!

Does someone know some formula for the relationship between oscillator settings and the right baudrate for the connection?

Thank you!


Andy Ayre

From your description it sounds to me like the autobauding is working fine. There is no formula for determinining if a specific baudrate will work - if there was then I would build it in to Flash Magic and stop selection of baud rates that wouldn't work!

However, in general, if you lower the clock speed of the device then you will need to lower the baudrate you are using.

The reason there is no forumula is because of measurement errors. Any formula would have to provide a probability of whether the baud rate will work or not, rather than a yes or no answer. Some baudrates work some of the time if the measurement errors are such that they interfere with measuring the bit periods.

Embedded Systems Academy, Inc.
support at esacademy dot com

Massimo

Hi Andrew,

j understand there is no formula. But if j need to use a particular crystal what j have to do? Testing various baudrates since j find the correct one?

Is it possible to have a range of probable baudrates for a particular crystal? For example j know when using a crystal of 11,0592 Mhz on a standard 8051 you can select many standard baudrates such as 14400,9600,4800 etc.

Is it possible to do the same with the LPC932?

Thank you.


Andy Ayre

When using an 11.0592MHz crystal, you can program the UART to a lot of standard baudrates. This is because you precisely calculate the reload value to use, i.e. no error.
When autobauding, it is totally different. The device is measuring the bit times the best it can and calculating the baud rate - which introduces measurement errors. So you cannot compare the two methods at all.

You should pick the crystal frequency you need for your application and then try 9600 baud to see if that works and go from there. I would have thought that your application's functionality is more important in most cases than flash programming speed. If it is not then you will need to find a trade-off.

If you pick a crystal frequency that only seems to autobaud at slow speeds, then you can use the high speed communications feature in Flash Magic to increase the baud rate (uses calculation rather than measurement). This won't work on the LPC932, but will work on the forthcoming LPC932A and other members of the LPC9xx family.

See the Flash Magic manual for more information on the high speed communications mode and how it works.

Embedded Systems Academy, Inc.
support at esacademy dot com