Not long ago, Rich Quinnell wrote about a new member of the Cortex family from NXP: the M0+, LPC800. The chip has peripheral drivers built into ROM and has remappable pins. The first thing I did was to put an LPCXpresso LPC812 board on order, and today, it showed up in the mail. Here are my initial impressions.
The board looks more or less like any other LPCXpresso board, except the chip is a 20-pin TSSOP package. The Code Red IDE that I have for my other LPC chips (version 5.0.12) already supports the LPC812, so I should be ready to go. Just like with the other LPCXpresso boards, step one consists of importing the libraries and sample code files, which, again, were provided with the IDE version I have, and firing up "blinky."
Actually, the real step one is to go to the LPC800 page on the NXP site and download the documentation, most recent sample files, and the pin matrix tool. You want version 5.0.12 or newer of the LPCXpresso IDE and the library and the example zip file version: "LPC800 LPCXpresso Examples V1.02.zip." With that, blinky works.
At this point, it's operating pretty much like any other mini-ARM chip. But there are some unfamiliar lines of code:
regVal = LPC_SWM->PINASSIGN8 & ~( 0xFF << 16 );
LPC_SWM->PINASSIGN8 = regVal | ( 12 << 16 ); /* P0.12 is CLKOUT, ASSIGN(23:16). */
The chip has Vss, Vdd and 18 I/O pins that don't move. Beyond that it has a fairly standard set of peripherals, which is cool. But even cooler is that you can put most peripherals on any of most of the pins.
In the above image, I'm assigning the I2C SDA pin to PIO0_17 (chip pin 1). Having this flexibility will make the PCB layout job much easier. It always seems like I/O that my board needs to have physically located next to each other are on opposite sides of the chip, and that's a pain. With this chip, if I need my UART pins right next to my I2C, I can do that.
Although, the downside to that flexibility is that the CAD library footprint might be a bit more confusing. Either you just label the pins as generic in the schematic symbol and keep good notes during design and layout, or you make a custom schematic symbol for each pin configuration you come up with.
The graphic tool can also be used to handle more mundane tasks, such as setting the ICON pin configuration register bits. In this next image, I've set PIO0_14 to have a pull-down resistor. The tool gives me the code to set the register to 0x88.
Once you've finished your configuration, export "swm.c," the SwitchMatrix_Init() function.
The utility will generate that above pin assignment function, an ICON register set up function, type.h and LPC8xx.h for you.
The raw chips won't be available until early next year, but that will give me time to get familiar with the chip and decide if it will work for my applications. The chips will come in 8-pin, 16-pin, and 20-pin packages.
What do you think? Will re-mappable pins help move you from 8 to 32?
But wait -- there's more! I have to look at the peripheral libraries in ROM too. That will be another day though.
Related posts: