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, Arduino, Sparkfun, Seeed, and Pololu devices are used for testing.
Support for the Goldilocks which is a 1284p board with compatibility to Arduino Uno Pre-R3 and R3 pin-out format.
The development environment used was Eclipse IDE. With Eclipse the CDT, and the AVR plug-ins are needed.
It is assumed that the AVR avr-libc libraries are installed, and avr-gcc is used.
Current environment is avr-gcc 4.8.1-2, avr-libc 1,8.0-4, avrdude 6.0.1-1, binutils-avr 2.23.1-2.
The freeRTOS folder contains the most recent version 8.0.0 of freeRTOS, but it has been abridged down to only those files relevant for AVR GCC. There quite a few changes in this 8.0.0 release as it is a major freeRTOS release, but none of them affect the operation with AVR (Arduino).
There have been a few typedef changes and, as the compatibility mode is disabled, that may mean that some compiler errors will need to be cleared
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 running on Timer2 on the 1284p found in the Goldilocks ATmega1284p 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 for the retrograde_v2 project, then you'll need to enable Timer0 for the freeRTOS tick.
The freeRTOSBoardDefs.h file contains most of the variables that you'll need to change.
There are some relevant and often used libraries added.
freeRTOS Library Directory Structure
contains the latest ChaN FatFS which can be used with the Goldilocks SD card, or other SD card cages.
contains drivers for the Wiznet W5100 and W5200 chip, including latest v1.6.1 errata from Wiznet for W5100 and v1.3 for W5200.
contains an implementation of uIP derived from v1, but integrating latest Contiki 2.7 code improvements. Implemented for MACRAW mode on Wiznet W5100 and W5200.
contains protocols for IP networks including PING, DHCP, NTP, HTTP, and web server code.
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.
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.
contains often used digital and analogue IO routines borrowed from Pololu.
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.
contains the tools to use the SPI bus.
contains routines to enable accurate PWM using Timer1, used in the retrograde_v2 clock example.
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.
contains CRC routines
contains extended char to long hex / integer / octal / binary conversion
contains files for using external ram with ATmega2560 devices. When using either "MegaRAM" or "QuadRAM" it is important to adapt the linker and size configurations as noted in the MegaW5100Test user guide.
contains the HAL, command level and Co-processor drivers necessary to use the FTDI FT800 and EVE silicon, specifically as utilised in the Gameduino2. The Gameduino2 application contains the example API structure, as provided by FTDI.
PROJECT DIRECTORY STRUCTURE
|-> 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.
|-> 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 / W5200 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.
|-> Gameduino2: Testing for the Gameduino2 shield, using the FTDI provided FT800 and EVE drivers.
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.