This repository of files is a working collection for a freeRTOS based platform using the AVR-GCC and AVRDUDE platform.
Supports ATmega328p, ATmega1284p, ATmega2560 MCU. Arduino UNO, Arduino Mega 2560, Freetronics and Pololu devices are used for testing.
Newly added support for Goldilocks which is a 1284p board with compatibility to Arduino Uno format.
The development environment used was Eclipse IDE. With Eclipse the AVR plug-in is needed.
It is assumed that the AVR libraries are installed, and avr-gcc is used.
For the retrograde project, it is assumed that Pololu libraries are installed.
The freeRTOS folder contains the most recent version 7.5.0 of freeRTOS, but it has been abridged down to only those files relevant for AVR GCC. FreeRTOS Version 7.5.1 and 7.5.2 introduce no changes relevant for AVR. There quite a few changes in this 7.5.0 release as it is a major freeRTOS release.
The port.c file has been extensively modified to allow the use of any of the 328p Timer0 or Timer1 timers. And, the use of Timer3 on the Goldilocks or Pololu SVP which has uses a ATmega1284p. The Arduino Mega 2560 is also supported, using Timer3.
New is integrated time.h functionality, specifically for use of the RTC 32.768kHz Crystal on Timer2 on the 1284p found in the Goldilocks board. Any board with a RTC crystal on Timer 2 can benefit with no change to the code.
Also, boards without RTC Crystal capability still get an approximate real time clock using the time.h functions, that may be sufficient if system_time is updated regularly with (say) NTP.
If you want to use 16bit PWM on the ATmega328p, then you'll need to enable Timer0 for the freeRTOS tick.
The freeRTOSConfig.h file contains most of the variables that you'll need to change.
There are some relevant and often used libraries added.
lib_fatf: contains the latest ChaN FatFS which can be used with the Goldilocks SD card, or other SD card cages.
lib_iinchip: contains drivers for the Wiznet W5100 and W5200 chip, including latest v1.6.1 errata from Wiznet for W5100 and v1.3 for W5200.
lib_inet: contains protocols for IP networks including PING, DHCP, NTP, HTTP, and web server code.
lib_time: contains upstream (30th may) clone of the avr-libc time.h functions. These are working with the Goldilocks RTC capability. TODO: Integrate the DS1307 chip driver in retrograde_v2 into this library.
lib_hd44780: contains drivers for the standard LCD format. Both Freetronics (Arduino) and Pololu interface pin-outs supported. Also options to avoid the clash with Wiznet W5100 SPI SS usually assigned to Arduino Pin 10.
lib_digitalAnalog: contains often used routines borrowed from Pololu.
lib_i2c: contains the tools to use the TWI or I2C bus. contains interrupt driven multi-master and slave routines, both Master and Slave code tested. Multi-master code (arbitration / back off) is untested.
lib_spi: contains the tools to use the SPI bus.
lib_servo: contains routines to enable accurate PWM using Timer1, used in the retrograde_v2 clock example.
lib_serial: contains routines to drive the serial interface. there are two versions; avrSerial for use before the freeRTOS scheduler has been enabled, and xSerial for normal operations when the scheduler is running. xSerial is interrupt driven.
|-> retrograde: digital & retrograde analogue clock (obsolete), depends on Pololu libraries.
|-> retrograde_v2: a revised and simplified version, with serial monitor time set & reset temp. ADC decimation code for 14 bit precision.
|-> LCD6100_driver: a driver for the Sparkfun LCD using Nokia 6100
|-> LCD6100_demo: a simple demo program, developed from the Arduino version.
|-> microbridge: a driver set for the Sparkfun USB Host interface. UNFINISHED
|-> Danger_ADB: using the Danger Shield together with Host USB interface. UNFINISHED
| There is a SRAM limitation that prevents all tasks (threads) from running
|-> ConwayLifePeggy: a simple Life game for the Peggy2
|-> PeggyVideo16: an I2C interrupt driven 4bit Video device. Plays video based on inputs.
|-> PeggyVideoPong: a pong game, with interrupt tones, interrupt I2C to video, and CRC video transmission.
|-> MegaBlink: a simple two task program that will flash a LED on either EtherMega or Arduino.
|-> MegaSDTest: getting the ChaN FatF file system on SDCards to work, including serial monitor.
|-> MegaW5100Test: Wiznet W5100 based http server / dhcp client / ping server client.
|-> audio_shield: the open music labs code, converted to run within freeRTOS. Added ADC decimation code, and generalised the code base.
|-> AVRstk500v2_bootloader: not freeRTOS, but a bootloader for Goldilocks 1284p, and Mega 2560 (working boot monitor: type !!! in terminal at boot time).
|-> RFIDBlackWidowTest: integrated SM130 RFID, and WiFi Shield device with uIP stack. RAM limits, prevented full testing. TODO: Redo with Goldilocks.
|-> ramfs_supervisor: Prototyping for ArduSat the 2560 program providing 16kB RAM and SDCard support for 16x Arduino Clients
|-> ramfs_client: Prototyping for ArduSat the 328p program to access centralised RAM and SDCard facilities on the supervisor node.
|-> ramfs_load_gen: Prototyping for ArduSat the 328p program to generate client load on the SPI bus.
PeggyVideoPong depends on Peggy2 using I2C communications with an Arduino compatible (Freetronics) and Danger Shield (for sliders and buttons for control).
The music generation (Buzzer.h & Buzzer.c) in PeggyVideoPong uses Timer 2, and PD3 based on the Danger Shield layout.
PeggyVideoPong, depends on the absence of temperature sensor, and knock sensor from Danger Shield to allow I2C to function properly.
Implemented the HD44780 (LCD) protocol independently (using ChaN again) of Pololu libraries.
Standard printf style formatting.