eLuaBrain is the little board with green and red LEDs on the right of the image. It connects to the black PS/2 keyboard and outputs VGA text to the monitor. The oscilloscope (gray box on the left side) is not part of eLuaBrain.
I built it with two main purposes:
- to fulfill an old dream of mine (some insist to call it an "obsession" for some reason): designing and implementing a fully functional, reasonably featured computer based on a MCU (rather than a "classical" CPU system). The recent explosion of 32-bit MCUs made this finally possible.
- to enter it in a EBV/ST Microelectonics design contest. I did that, but I didn't get any prize. On the bright side, the contest rules forced me to write quite a bit of documentation for the project, so whoever decides to take a closer look at eLuaBrain will probably have a good starting point. Some entries on this blog will be also based on the contest entry. You can download the full entry here (file size is about 10M).
Why did I choose to start a blog focusing mostly on this particular project? I happen to think it has a few strong points (then again, I'm obviously biased) that could make it interesting for some people. To quote from the entry's abstract.doc file: being a generic development platform, eLuaBrain can be used in lots of practical applications, but it was design around two main usage scenarions:
- educational computer: eLuaBrain can be an excellent tool for students trying to learn about computer science and/or hardware design. Modern computer hardware is simply too hard to understand even for people with some computer knowledge, while most modern programming languages exhibit a growing trend of hiding as much about the hardware as possible. By contrast, eLuaBrain offers the full experience. Its hardware is quite easy to understand and it can be easily interfaced with other hardware (which might be a problem on a PC); at the same time, eLua offers APIs that can access the hardware at very low level. Learning about the software and hardware in parallel gives a student a much better idea about the software-hardware interactions, which in turn tends to develop better professionals. At the same time, learning about programming on a platform with relatively low resources forces the future programmers to consider resource allocation and optimization techniques which again leads to better programmers. All these make eLuaBrain a good tool for education in all markets.
- automation controller: eLuaBrain can act as a controller for a large number of automation tasks, ranging from home automation to industrial automation. Its main strenghts are the power of the STM32 CPU, the ability of being programmed on-the-fly, the built-in help system, the radio interface and the large number of peripherals available via its extension connector. It can replace a PC as an automation controller in the many cases where the full power of a PC isn't actually needed, but a better alternative is either not available or very expensive. Compared to a PC, it brings simplicity, reliability (a simpler system is almost always more reliable than a complex system), lower cost and lower power consumption.
Following is a video of most of the demo programs I wrote for eLuaBrain as part of the contest entry (there are a few not included here, but still you should get a pretty good image about the capabilities of eLuaBrain after seeing this):
If this made you curious, you can find below a complete list of the eLuaBrain platform capabilities:
- built around the STM32F103ZET6 MCU from ST, an extremely powerful Cortex-M3 MCU with an impressive list of on-chip communication interfaces and peripherals.
- 1MB of external RAM memory allows large, complex programs to run on the eLuaBrain.
- PS/2 connector for any PS/2 compatible AT keyboard.
- high speed VGA video interface: 80x30 characters (original DOS CP437 charset), 16 colors, built around a Propeller microcontroller.
- TCP/IP connectivity using the ENC28J60 Ethernet to SPI bridge.
- high speed, low power wireless interface (based on the nRF24L01 chip) for easy wireless communication with remote equipment.
- microSD storage for storing eLuaBrain programs and data.
- an extension connector for external daughter boards that allows connections to GPIO pins, ADC, SPI, I2C, UART, CAN, timer compare outputs and others.
- UART connector with standard RS232 logic levels.
- simple sound generation on a small speaker using PWM signals.
- low cost: the eLuaBrain prototype comes as a "shield" over a STM3210E-EVAL board, but it can be produced on a dedicated PCB at low costs in large quantities, making it a compelling option for emerging economies and educational facilities in general.
- low power consumption: the STM32 along with its peripherals and the eLuaBrain additional hardware consumes much less power than a desktop PC or even a laptop.
- completely open source design: both the hardware and the software are open sourced, released under the very permissive MIT license which allows unrestricted use in both commercial and non-commercial projects.
- optimized for developing: based on the eLua project (http://www.eluaproject.net) that makes the popular Lua language (http://www.lua.org) suitable for running on MCUs, eLuaBrain is capable of running Lua source files directly on the STM32 CPU. Also, eLua is optimized for low memory devices, so it will make sure that the memory on the STM3210E-EVAL board is put to good use.
- built-in editor allows for very easy editing of source files.
- built-in interactive help browser makes programming a breeze. API help is available from the shell, from the editor or from the Lua interpreter. Whenever you forget the name, arguments or return result of a function that you need in your program, just ask the integrated help system.
- instant boot: forget about having to wait for an OS to load before being able to use your desktop. eLuaBrain boots in less than one second.
- access to a large number of peripherals directly from Lua: GPIOs, I2C, UART, SPI, timers, CAN and others.
- optimized TCP/IP stack lets network applications run on little memory.
- easy to interface with other hardware via the extension connector.
- multiple file systems for easy storage: FAT on SD/MMC card, ROM file system inside Flash, UDP-based network file system with automatic server detection.
- runs with cheap hardware: eLuaBrain needs a PS/2 keyboard and a standard VGA (640x480) monitor to run. These can be found at very low prices today. With a low cost VGA to PAL/NTSC adapter it can also use an old TV instead of a VGA monitor.
- comes with an extensive set of demos that covers a lot of topics (network connectivity, peripheral communication, algorithms, a Web server, radio controlled RGB lights and of course games) and can be a good starting point for future applications.
- good community support via the eLua communication channels (mailing list, IRC, wiki).
One more thing before I finish this first (long) post: the software and hardware are fully open source, no restrictions at all (not even commercial ones). The software is already licensed under MIT/BSD, I don't know what license to choose for the hardware (I'll take a closer look on that), but it will definitely be a very liberal one. If MIT is also appliable to hardware design, MIT it is.