Author Topic: LPC2106 / LPC2103  (Read 11590 times)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
LPC2106 / LPC2103
« on: January 26, 2008, 04:46:55 PM »
Hi All

I have spend some time verifying the compatibility of the LPC23XX project for use on smaller LPC devices, specifically the LPC2104/5/6 (128k FLASH and 16k/32 or 64k RAM) and the smaller LPC2101/2/3 (8k/16k/32k FLASH and 2/4/8k RAM).

I found that there is a difference in the PLL set up and the vectored interrupt controller which needed to be adjusted. The vectored interrupt controller difference required a small change in the vectors and I made linker script files for each device due to the large memory differences.

After the work I could successfully verify the adapted project set-up on two boards - the IAR LPC210X KickStart Card (with LPC2106) and the Olimex LPC-P2103 prototyping board. By changing a single define in config.h it is thus possible to compile the uTasker demo project to run on these and also the LPC2378 based Keil MCB2000 and Olimex LPC2378-STK boards.

Of course only the LPC2378 boards use Ethernet and the TCP/IP stack and the other boards just allow control over a UART. This does however show that it is possible to run a single project with one define change on a wide range of LPC devices.

While memory use is not of great importance on the larger devices it becomes a big issue on the smaller ones - in which case the use of resources (code and data space) has to be carefully planned and monitored. The LPC2101/2/3 devices are pre-destined for projects where the larger device is probably already being used but a simple peripheral extension (like standalone keyboard or display) is required. They are cheap, small and powerful and can make use of already developed code and development environments. With this in mind, I look a closer look at the project's memory requirement when it was configured to use the serial interface demo. Here are some benchmark figures (IAR compiler, Thumb mode)

Code:
- uTasker OS - 910 bytes
- uMalloc (for heap management) - 204 bytes
- serial TTY driver - 770 bytes with only character mode and no flow control - up to 1'870 bytes with all modes and flow control enabled
- LPC2XXX initialisation, interrupt and hardware driver code - 2'200 bytes
- queue drivers - 1'650 bytes - up to 1'930 bytes depending on options

RAM:
- around 140 bytes global/static variables
- around 1'000 bytes HEAP (with 600 bytes of these allocated to the UART buffers)
- in addition, a few hundred bytes for interrupt and CPU stack are reserved

The above doesn't include the application - the actual demo application has a large menu driven interface and so is code and constant data hungry (around 7k, which will not let it run in that form on the smallest chip).

A project based on communication via UART is thus set up ready to add the specific application for a resource-price of around 5'800 bytes FLASH and 1'400 bytes RAM. In the smallest device - the LPC2101 - this leaves around 2.2k FLASH space for the application code and about 800 bytes RAM for its own use. Considering that the application has full support of the uTasker OS and the UART interface it can be written in a modular and efficient manor to achieve useful functions. If this is not enough for the particular simple application, the next device up in the chain (eg. LPC2102), with doubled memory size, will allow expansions with no additional effort.

Just contact me if you are interested in using any of the LPC210X range. Beta testers are very welcome. Don't forget that the uTasker simulator also works with all of these devices, so develoment becomes even easier!!

Regards

Mark

« Last Edit: January 27, 2008, 02:49:22 PM by mark »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: LPC2106 / LPC2103
« Reply #1 on: January 29, 2008, 11:11:21 PM »
Hi All

Please note that a Beta SP2 has been added to the Service Pack side which includes the LPC210X board described in this thread. (http://www.utasker.com/software/softwareV1.3.html)

It has also been noticed that P0.31 on the LPC2101/2/3 can only be configured as an output so this has been adjusted in the simulator.

Regards

Mark