LP55231 Breakout Board Hookup Guide

Engine Example

To demonstrate the power of the execution engines, we’re going to use a classic LED-switching application: the LED scanner.

9 LED Scanner.

While chasing among the colors of the RGB LEDs is colorful, it doesn’t lend the sense of motion that we’d expect from an LED scanner. For a more traditional look, we cut the jumpers to disable the onboard LEDs, and added a group of 9 red 5mm LEDs.

It’s not doing anything that specifically makes the LED scanner run! It checks the program counter, but doesn’t do anything that makes LEDs illuminate. After initialization, all of the LED scanning work is being done independently by the LP55231. This means that the microcontroller is completely available for other tasks.

The tradeoff of avoiding computational load in loop is that the initialization is much more detailed. setup contains the following lines.

The program breaks down into 4 sections, marked with line numbers in the comment column. Let’s review the sections, starting from the bottom

Lines 10 through 1f are the output mapping table. Each line in the table specifies a single LED. The table is 16 lines long – 9 lines to scan form 1 to 9, then 7 more lines from 9 back down to 1.

Lines 0 and 1 specify the start and end of the mapping table. As the program runs, it increments through the table. When it reaches the end, it starts over from the beginning.

Lines 7 to f are unused. Developing the program, there’s less to keep track of if there’s a little room for the program to grow or shrink, without having to move the mapping table and remember to adjust the table mapping instructions.

Lines 2 to 6 are the actual program. It fades in, pauses a moment, then fades out, selects the next output, and loops back to the beginning.

More Engine Information

If you’re working with the execution engines, you’ll probably find that the LP55231 datasheet seems a little short. The LP55231 has a cousin in the LP8501 which is very similar. It’s a tiny BGA part, but the datasheet is more detailed, particularly pages 19 through 25, that explain the instruction set more clearly, and give an example of setting the engine to run a program.

We’ve also got a number of examples showing off various features – check the github repo. As we explored the features of the LP55231, we kept sketches to demonstrate them. Each sketch starts with a comment that describes what it’s doing.

Texas Instruments also have a Windows assembler application to assist in writing LP55231 programs. You can find it in the tools & software section of the LP55231 webpage. We started out using it, but quickly learned to write LP55231 programs from scratch, in hexadecimal.

A Few Notes On using The Execution Engines

Things we’ve learned through trial and error.

Each engine calculates a single output value. To drive multiple LEDs from a single
engine, you need to use mapping tables.

The Lp55231Engines library has routines to read the program counter and output mapping bits of each engine. These can be very useful when troubleshooting engine behavior. An engine that’s not running will never change it’s PC, and an engine without a mapped output, won’t do anything visible.

If multiple engines map the same output, the lower-numbered engine controls the LED.

All three engines have to be idle before program memory is accessible. The Lp55231Engines class will force the engines into this state as part of the LoadProgram call. In other words: loading and running are mutually exclusive.

There’s an error in the datasheet: It transposes the INT and END names in table 6. The instruction 0xd000 executes as an interrupt.

In 2003, CU student Nate Seidle blew a power supply in his dorm room and, in lieu of a way to order easy replacements, decided to start his own company. Since then, SparkFun has been committed to sustainably helping our world achieve electronics literacy from our headquarters in Boulder, Colorado.

No matter your vision, SparkFun's products and resources are designed to make the world of electronics more accessible. In addition to over 2,000 open source components and widgets, SparkFun offers curriculum, training and online tutorials designed to help demystify the wonderful world of embedded electronics. We're here to help you start something.