Posts Tagged ‘Cortex-M3’

A lower-cost, ARM-based Arduino alternative?

December 15, 2009

I stumbled across this NXP press release for the LPC134x which is based on the ARM Cortex-M3. The press release says “The on-chip USB drivers support both the Mass Storage Class (MSC) and Human Interface Device (HID) class. Furthermore, these drivers are incorporated in ROM, saving customers approximately 5-6 K bytes of user code”

Looking at this presentation, (slide 25), the chip shows up under Windows (and they say Linux) as a Flash drive to provide “Drag and Drop Flashing”. It has this capability built in at manufacture! No need for a bootloader, JTAG, or a second chip, like the FTDI USB to serial interface on an Arduino. Put an LPC134x on a board, connect USB, and it should ‘just work’ (TM :-))!

An entire USB-based micro-controller board only needs an LPC1342 or LPC1343, a crystal, voltage regulator, a few passives and PCB. The LPC1342 is available from Farnell for £2.20 and LPC1343 for £2.70 or £3.30. So a board could be smaller than an Arduino-Nano, and lower-cost.

I haven’t read the datasheet in detail, but overall these micro-controllers are more powerful than Arduino’s comparable Atmel ATmega168 or ATmega328, with 16K or 32K of program memory, so this is the best I’ve found to achieve the goal of sub-$10 micro-controller (at one-off prices).

The NXP parts have plenty of advantages over the Atmel parts. The LPC134x runs at 72MHz vs the ATmega’s 16MHz, and both execute instructions in one or two cycles. The LPC134x is a genuine 32-bit processor, whereas the ATmega is an 8-bit processor, so this means some calculations will go much faster on the ARM. I don’t think this is a huge benefit, as my Arduino’s spend most of their time waiting around for something to happen, but it may mean some programs are smaller on the LPC134x.

The LPC134x looks like it has much faster (40x) Analogue to Digital Conversion (ADC), opening up a range of interesting sensors and experiments. The LPC134x has significantly more RAM; LPC1342 has 4KB vs the ATmega168’s 1KB, the LPC1343 had 8KB vs ATmega328’s 2KB.

Both families have a set of timers. Timers are used to implement analogWrite, millis, micros, delay and delayMicroseconds in the Arduino language, but they are also used to control servo motors, stepper motors, modulate Infrared LEDs, and time external events.

The LPC134x have 2 × 32 bit timers, and 2 × 16 bit timers vs the ATmega’s 1 × 16 bit timer, and 2 × 8 bit timers. The LPC134x timers look more flexible than the Atmega168/328. The LPC134x comes in a package with more pins, so there are more PWM pins, and more pins to time external events.

The on-board LPC134x USB is 12Mbit/second vs 0.115Mbit/second for the FTDI chip on an Arduino.

The rest of the comparison between LPC134x shows similar peripherals to the Arduino’s on chip. They both have I2C, SPI and USART. So overall the LPC134x looks as good or better than comparably priced ATmega’s (at one-off prices).

There is a free, Open Source, GNU toolchain for the ARM, which is based on the same compiler as the Arduino IDE uses. So it looks like there are no real obstacles to making a lower-cost, ARM-based Arduino alternative. Of course, there is a plenty of work in porting the Arduino language libraries, like analogRead and analogWrite, but the core functions, which we use the most, would probably be only a few weeks.

I’ve ordered a low-cost NXP development board, LPCXpresso, to do some investigation. This is a similar price to Arduino’s, at £18.34 from Future, or £17.86 from Farnell (plus VAT). This is an encouraging price because the LPCXpresso contains much more technology than an Arduino. The LPCXpresso has a JTAG debugger which supports much more sophisticated debugging than available on an Arduino, and it probably costs as much or more than the LPC1343 itself.

There is a free downloadable LPCXpresso development environment available, so it should be practical to get a better understanding, and discover the disadvantages that datasheets never show for very little further cost. I’ll try to make some time to investigate this in more detail after Christmas.

Please don’t misunderstand. I love my Arduino’s, but the ability to significantly reduce its price, and make better technology available to an even wider audience is compelling.