A few questions on the LPC2106

Hi everyone!

I’ve just started using the LPC2106, and I’m in the process of reading and understanding the datasheet before I hook anything up. In doing so, a few questions have arisen.

The first is about the crystal oscillator that is supposedly integrated into the LPC2106. It’s mentioned in the introduction of the user manual and in the LPC2106 Product Description (http://www.nxp.com/pip/LPC2106BBD48.html). But I can’t find anything else about it! I can’t find how to use it, or how precise it is. Does anybody know where I can find this?

The second question is about the GPIO pins. Quite a few people have written that the speed at which the GPIO pins can be toggled is very low. How long does it take for a GPIO pin to change state? And does this also count for when the pins are configured as inputs? How long is the delay between a changed state on an input and a change state in the IOPIN register?

My third (and last) question is also about the GPIO pins. Does the LPC2106 have integrated pull-up or down resistors (like the AVR) or do I have to add them externally?

If anybody knows any useful hints, I’d be eternally grateful :slight_smile:

my 2 cents on the GPIO.

you can toggle a GPIO two ways.

#1) IO0CLR |= data;

IO0SET |= data;

#2) IO0PIN ^= data;

the GPIO is VERY fast, i dont know why anyone would ever say its slow.

I can’t see why you would use either of these two ways of toggling a GPIO pin.

Writing a 1 to the SET register produces a high at the output, writing a 1 to the CLR register produces a low. Writing zeroes has no effect. Therefor you would normally only write

IO0CLR = BITS_TO_BE_CLEARED;

IO0SET = BITS_TO_BE_SET;

without a need for reading the register content first.

The GPIO of older LPC2000s (like the LPC2106) is slow because the GPIO interface is connected to the VPB (VLSI peripheral bus), and not to the AHB (AMBA Advanced high-performance bus) or the local bus. Accesses to locations on the VPB take several times longer than accesses to the local bus (like internal SRAM).

Newer LPCs (like the LPC2148) offer a fast-GPIO interface that is connected to the local bus, allowing GPIOs to be toggled at up to 15 MHz.

Regards,

Dominic

The oscillator requires an external crystal and capacitors. 12 MHz is popular, as it will give 60 MHz operation with the PLL set for 5x. See the User Manual for details.

Leon

Wow, thanks! That sure cleared up a lot of misunderstandings.

So if the GPIO is slow because of the bus it’s connected to, reading from the GPIO won’t be any faster right? But in any case, is there a way to accurately predict the number of cycles needed to access (or in my case, read from) the GPIO?

It’s definitely predictable, I just don’t happen to remember the numbers. I think this was brought up several times on the LPC2000 yahoo group - you might want to search the archives. That yahoo group would also allow you to reach a much wider audience full of people who know the LPC2000 by heart.

— edit —

I just found a link to that posting from a Philips representative:

http://tech.groups.yahoo.com/group/lpc2000/message/4000

Regards,

Dominic

Interesting page! Thanks a bunch!