EmbeddedRelated.com
Forums

LPC2138 MIPS

Started by rggmns October 25, 2005
Hello,

I use a LPC2138 microcontroller with a 25MHz xtal.
I set the pll multiplier at 2 and de devider =2 (in the startup code
of KEIL). This gives 50MHZ CPU clock. This works out fine, in
determining the speed for the UART (baud rate is ok).
But when I run a very small program, toggeling the LED's, I only get
16 MIPS out of the controller.
The MAM unit is fully enabled and the MAM timing is set to 3.

What do I do wrong (how stupid can I get?)?

And no, it is not due to the pipe line, because I toggle the LED's in
staright line code. #include <lpc213x.h>

void main()
{
unsigned long j=0x00ff0000;
IODIR0=0x00ff0000;
while (1)
{
IOPIN0=j;
j=~j;
IOPIN0=j;
j=~j;
IOPIN0=j;
j=~j;
IOPIN0=j;
j=~j;
}
}



An Engineer's Guide to the LPC2100 Series

Hi,

are you aware that the bit toggle rate for the LPC2138 running at 50
MHz is in the range of approx 3.5MHz max. If you get that rate that
is full speed.

How do you measure the MIPS?

Most time for toggeling is lost between the different bus structures /
bridges. The I/O pins on the LPC2138 are connected to the VPB (=APB) bus.

If you need faster I/O toggle rate the LPC2148 will provide that. Keep
in mind that there are new registers that enable fast bit toggeling
there.

Bob

--- In lpc2000@lpc2..., "rggmns" <rggmns@y...> wrote:
>
> Hello,
>
> I use a LPC2138 microcontroller with a 25MHz xtal.
> I set the pll multiplier at 2 and de devider =2 (in the startup code
> of KEIL). This gives 50MHZ CPU clock. This works out fine, in
> determining the speed for the UART (baud rate is ok).
> But when I run a very small program, toggeling the LED's, I only get
> 16 MIPS out of the controller.
> The MAM unit is fully enabled and the MAM timing is set to 3.
>
> What do I do wrong (how stupid can I get?)?
>
> And no, it is not due to the pipe line, because I toggle the LED's in
> staright line code. > #include <lpc213x.h>
>
> void main()
> {
> unsigned long j=0x00ff0000;
> IODIR0=0x00ff0000;
> while (1)
> {
> IOPIN0=j;
> j=~j;
> IOPIN0=j;
> j=~j;
> IOPIN0=j;
> j=~j;
> IOPIN0=j;
> j=~j;
> }
> }
>