EmbeddedRelated.com
Forums

Flash Utility V2.2.3 @115200bps with XTAL=10MHz ?

Started by Marcio Zaquela July 31, 2006
Hi guys,

Does anyone know if it is possible to achieve 115200 bps using the 'LPC2000 Flash Utility' with LPC2138 and XTALMHz ?

The maximum baudrate I'm able to use is 38400. Even 57600 bps is not working.

I made a routine to test UART0 @ 115200bps and I can only use this baudrate properly when I adjust the fractional divider register (U0FDR - LPC213x/01 devices only) to get the minimum error.

If I don't use U0FDR I can't transmit @ 115200 bps, so I think the LPC2138 bootloader code doesn't adjust U0FDR. Then I conclude that it is not possible to work with the Flash Utility at 115200 using a XTALMHz.

Thanks,
Marcio

An Engineer's Guide to the LPC2100 Series

--- In l..., "Marcio Zaquela" wrote:
>
> Hi guys,
>
> Does anyone know if it is possible to achieve 115200 bps using the
'LPC2000 Flash Utility' with LPC2138 and XTALMHz ?
>
> The maximum baudrate I'm able to use is 38400. Even 57600 bps is not
working.

No. But you could work at 156250 or 78125 baud.

First calculate divisor by dividing crystal frequency by 64 x baud
rate. The factional part gives the error. The error must be less 5
percent for it to work.

For example, at 57600, your divisor is 10000000/(64*57600) which comes
to 2.71. Divisor count of 2 gives error of 0.71 over 2 is 35 percent.
Even if the auto-baud uses 3, the error is still alomost 10 percent.

For 38400, divisor is 4.07 -- hence error is only 1.75 percent, so it
works.

Hope this helps.

Jaya
Thanks Jaya.

Unfortunately it is not possible to configure the Flash Utility to use 156250 or 78125 bps.

But for 2138 it is necessary to divide by 16 and not by 64, is it true ?

So my divisor at 57600, for example, is 10M / (16*57600) which comes to 10.85. Rounding to 11 I get 10M / (11*16) = 56818 bps. In this case the error is -1.35% and it should work.

If the auto-baud uses 10 instead 11, then the error would be 8.5% ( 10M / (10*16) = 62500 bps ). So in this case it wouldnt work, right ?

Regards,
Marcio

----- Original Message -----
From: jayasooriah
To: l...
Sent: Monday, July 31, 2006 8:29 PM
Subject: [lpc2000] Re: Flash Utility V2.2.3 @115200bps with XTAL=10MHz ?
--- In l..., "Marcio Zaquela" wrote:
>
> Hi guys,
>
> Does anyone know if it is possible to achieve 115200 bps using the
'LPC2000 Flash Utility' with LPC2138 and XTAL=10MHz ?
>
> The maximum baudrate I'm able to use is 38400. Even 57600 bps is not
working.

No. But you could work at 156250 or 78125 baud.

First calculate divisor by dividing crystal frequency by 64 x baud
rate. The factional part gives the error. The error must be less 5
percent for it to work.

For example, at 57600, your divisor is 10000000/(64*57600) which comes
to 2.71. Divisor count of 2 gives error of 0.71 over 2 is 35 percent.
Even if the auto-baud uses 3, the error is still alomost 10 percent.

For 38400, divisor is 4.07 -- hence error is only 1.75 percent, so it
works.

Hope this helps.

Jaya







Sorry...forgot to uncomment the SecurityCode line. Had it commented to
temporarily override security.

;
; Set current location to 0x1FC and lay down 0x87654321 so the bootloader
will
; protect the FLASH from intrusion...but more importantly, will prohibit
external
; memory booting (will not try to access exception vector in external memory
using
; CS0) and will therefore allow a watchdog timeout to work for us properly.
;
; NOTE: This will cause a warning to appear during compile (A1479W).
;
AREA Init, CODE, READONLY, ALIGN=9
ALIGN 0x200,-4
SecurityCode DCD 0x87654321 ;Actual/Production
Mark Crow
Software Engineer
Pro Tech Monitoring, Inc.
Odessa, FL USA
727-484-3100 ext. 226
-----Original Message-----
From: l... [mailto:l...]On Behalf Of
Marcio Zaquela
Sent: Tuesday, August 01, 2006 8:33 AM
To: l...
Subject: Re: [lpc2000] Re: Flash Utility V2.2.3 @115200bps with XTAL=10MHz
?
Thanks Jaya.

Unfortunately it is not possible to configure the Flash Utility to use
156250 or 78125 bps.

But for 2138 it is necessary to divide by 16 and not by 64, is it true ?

So my divisor at 57600, for example, is 10M / (16*57600) which comes to
10.85. Rounding to 11 I get 10M / (11*16) = 56818 bps. In this case the
error is -1.35% and it should work.

If the auto-baud uses 10 instead 11, then the error would be 8.5% ( 10M /
(10*16) = 62500 bps ). So in this case it wouldnt work, right ?

Regards,
Marcio

----- Original Message -----
From: jayasooriah
To: l...
Sent: Monday, July 31, 2006 8:29 PM
Subject: [lpc2000] Re: Flash Utility V2.2.3 @115200bps with XTAL=10MHz ?

--- In l..., "Marcio Zaquela" wrote:
>
> Hi guys,
>
> Does anyone know if it is possible to achieve 115200 bps using the
'LPC2000 Flash Utility' with LPC2138 and XTAL=10MHz ?
>
> The maximum baudrate I'm able to use is 38400. Even 57600 bps is not
working.

No. But you could work at 156250 or 78125 baud.

First calculate divisor by dividing crystal frequency by 64 x baud
rate. The factional part gives the error. The error must be less 5
percent for it to work.

For example, at 57600, your divisor is 10000000/(64*57600) which comes
to 2.71. Divisor count of 2 gives error of 0.71 over 2 is 35 percent.
Even if the auto-baud uses 3, the error is still alomost 10 percent.

For 38400, divisor is 4.07 -- hence error is only 1.75 percent, so it
works.

Hope this helps.

Jaya








--- In l..., "Marcio Zaquela" wrote:
>
> Thanks Jaya.
>
> Unfortunately it is not possible to configure the Flash Utility to
use 156250 or 78125 bps.
>
> But for 2138 it is necessary to divide by 16 and not by 64, is it
true ?
>
> So my divisor at 57600, for example, is 10M / (16*57600) which
comes to 10.85. Rounding to 11 I get 10M / (11*16) = 56818 bps. In
this case the error is -1.35% and it should work.
>
> If the auto-baud uses 10 instead 11, then the error would be 8.5%
( 10M / (10*16) = 62500 bps ). So in this case it wouldnt work,
right ?
>
> Regards,
> Marcio
>

If you look in the LPC213x User Manual, in section 20.8.3 (set baud
rate ISP command description), you'll see a table of supported baud
rates vs. crystal rates.

Brendan.



--- In l..., "Marcio Zaquela" wrote:
> Unfortunately it is not possible to configure the Flash Utility
> to use 156250 or 78125 bps.

Have you tried the new one from ESA (search archives as I cannot
remember the URL off-hand) to see if it can be set to non-standard
baud rates?

> But for 2138 it is necessary to divide by 16 and not by 64, is it true ?

The Philips Boot Loader sets VPBDIV to default which is why it the
value to divide by is 64, not 16. If you use my boot loader, then you
could run it four times faster, but then if you were using my boot
loader, you would not need any Flash Utility anyway.

Jaya