Create Project Need help?
Show more (3)
  • Labs project

Embedded Firmware Library (EFL)

Status: In progress
October 16, 2012

Many Elektor-readers really like to modify projects, not to build them as they are. So about 99% of the Elektor projects are published with open source microcontroller firmware. However, developers always use their favorite controllers, and if you want to modify the code, you often have to dive deep in the datasheet of that controller. The "Embedded Firmware Library" is an upcoming project which offers a kind of API to control the controller-functions and the functions of the peripheral blocks on a certain board. As an application developer, you don't have to know anything about the registers of the controller. And you can write controller- and board-independent code. In principle, another developer can use your code without modifications on his board and with his favorite controller.

The hardware layer:

Controller/Register dependent definitions
Functions to control the internal features of the controller
For IO, ADC, UART, SPI, DAC, Timer

Functions to control board-blocks like a display (connected via SPI or 4-wire), RS485-driver (connected to UART), LEDs and Relays (connected to certain IO-Pins), Buttons and Switches (connected to certain IO-Pins) and more

The same as BoardEFL.h/.c for an extension-board.

On top of this hardware-layer you can find hardware-independent library-modules, e.g. for display, SD-card, stepper-motor and so on. With those libraries, you can control more than one "block" of stepper-motor, display and so on in your system. Protocol-libraries like the ElektorBus can be combined in a flexible way to interface-libraries like a UARTInterface- or a TCP/IP-Library, so you can send and receive messages over various physical channels.

We would like to recommend the library for automation, control, regulating, measuring applications which don't need an accurate timing, real-time-features or high frequencies, bandwiths or baudrates.

Current Status:

Sourcecode is hosted on
See Tab "code".

Supported Controllers and Controller-Functions (selection):

Function                                  Xmega256A3   ATmega328/644
Pin set                                         X                      X
Pin read                                       X                      X
ADC-value read                            X                      X
start conversion                           X                      X
UART Send Data
(interrupt-controlled)                    X                      X
Receive Chars in ringbuffer            X                      X
send/receive a Byte                      X                      *
Software SPI (Master/Slave)          X                      X
send/receive Bytes
(combined)                                  X                      *
Timer start/stop                           X                      X
- Count                                        X                      X
- call function                               X                      X
- toggle Pin                                  X                      X
- with variable speed                    X                       X
Set PWM                                     X                      *
Software-PWM                             *                      *

Other controllers will follow.

Libraries (hardware-independent, selection):

* Display
* Stepper Motor
* TCP/IP-Module
* SD-card (Raw data)
* LED/Button
* ElektorBus-Protocol
* BlockProtocol (ASCII-based protocol to control some controller-functions from a PC-terminal), see Elektor article

Others will follow.

Software-Download is now available with some demo-applications for Elektor-projects:
Xmega-Webserver-Board   (
ElektorBus StepperMotor Driver (
3-Wire-Interface, Arduino Uno  (

ElektorBus & Python (


Upcoming Projects:

Wireless Modules (Autumn 2013)
ATmega Board for Beginners (Winter 2013)
Webserver with the Xmega (Winter 2013)
Multitester (Spring 2014)
EFL on ARM (Spring 2014)
EFL on Linux (Spring 2014)

Software and Doxygen Doku is "under construction"!

Extra document as "Manual" is available (German and English language).


Extra-project in the codebase: ArduinoDemoWebinar. Control an ArduinoUno from a Terminal-Program (9600 Baud): 
L 0 0 + <CR>
L 0 0 - <CR> 
switch LED on and off.

C 0 x + <CR>
C 0 x - <CR>
Connectorpin x at the Arduino-Connector high or low.
More on the protocol in


Software-Download EFL Codebase:



Read the full post
Show less

Loading comments...