Olimex SAM7-EX256 test firmware
The board is manufactured by Olimex and has lots of features to play with:
- 32bit ARM7 from Atmel AT91SAM7X256, speed up to 55MHz
- 256K Flash / 64K RAM
- CAN, USB, Ethernet, ADC, UART, I2C, Timers, PWM, DMA
- SD card slot connected over SPI lines
- 12bit color LCD
- 2 buttons and a joystick
- audio interface: speaker + microphone + potentiometers
I purchased it some years ago and made a nice firmware to test some of its resources: a SD card reader over USB, a virtual COM port, a sound composer, a temperature measurement, a frequency counter tool, a frequency generator tool and an image+text based menu. All the modules are linked together by a real time operating system(RTOS) provided by Micrium: uC/OS II. The firmware doesn’t cover all hardware modules, so there is room for improvement (e.g a TCP/IP stack), but this is where I stopped.
The SD card reader contains the following parts:
- USB 2.0 device driver
- USB mini stack for mass storage & communication device control (CDC ACM)
- SD card protocol emulator over SPI lines
- SPI driver
Short description of software components:
SD card reader: SD driver over SPI interface + USB micro stack (bulk only – SCSI – mass storage). As it runs on SPI, the read & write on the SD card have low speed, somewhere around 60-70KB/sec, but enough to test the hardware. Windows will automatically install the mass storage driver. I had to do a hardware modification to get it properly working as the original design was not allowing the correct handling of both LCD and SD card over the same SPI lines. For some reason the SD card was hanging after LCD update. The hardware modification consist in adding a resistor (5K6) between LCD MOSI line and SD card MOSI line. The CPU MOSI output is directly connected to the LCD. The virtual com port adds to the mini USB stack a CDC ACM interface handler on top of the driver. There is a .inf file needed to do a proper installing. The data is not further processed, the goal was just to see the CDC is correctly detected.
Sound composer: uses the PWM to generate signals which are converted in sound by the on-board interface. Depending on PWM frequency and duty cycle the board can generate lot of tones + adjust volume level from the settings. The sound menu provides an interface to create sound samples. There is also a potentiometer to adjust general volume.
Temperature measurement: uses a NTC to read voltage level. Depending on temperature, NTC value changes resulting in voltage level change. These values are easily converted in temperature based on a predefined temperature/R values curve.
Frequency generator: has 2 output options: one directly to the audio-in path, the other one to PORTB pin #27, for external usage. From the menu, push joystick will activate audio path whereas left button routes the signal to the external connector.
Frequency counter: has the input on PORTB pin #28. Pin27 & pin28 on port B are placed on the same external connector. With a jumper these 2 lines can be linked together so that the user can generate a frequency with the previous described menu and read it back here.
Image viewer: there is a piece of code which reads image files in RGB format. Unfortunately I didn’t include a file system so that user can load, for example, new images from SD card. There are several images included as headers at compilation time.
Menu: it’s image based for the main menu and text based for all sub-menus. Not all menus added are used, I wanted to add a video camera but quit the idea later on. There are several settings that can be made for this firmware, like display properties, USB functionality, time adjusting etc.
Here below some snapshots with different menus/settings:
The binary can be downloaded in several formats, all included in a zip file, here: FW_binary.
For any question please use “Contact form”.