The AVR-Ada project provides the gcc based Ada compiler GNAT for the AVR 8-bit microcontrollers. This includes:
- the Ada compiler (GNAT) based on the existing AVR and Ada support in gcc
- a small Ada run time system and a useful AVR specific support library
- documentation and some sample programs
The project is now superseded by the Alire crates
Start with the examples and Alire will install everything else.
The documentation about AVR-Ada is grouped in different sections
-
Installation
- Some notes about building the cross compiler. This is the only supported way from AVR-Ada 2.0 on.
-
Old installation support instructions (for AVR-Ada 1.2.2)
- a detailed step by step instruction at http://stronglytyped.org/pelican/building-avr-gnat-for-avr-ada.html
- Manual build from Ubuntu 12.04 Precise Pangolin host
- Among other things you need a native GNAT compiler for your host platform. Here is a description for building GNAT on Mac OSX (Lion+).
- Build instructions for AVR-Ada-1.2.2 for Max OSX (Lion+).
- [InstallRunTimeSystem]
- [Setup]
-
introductory notes for using AVR-Ada
-
some more advanced issues of using AVR-Ada
-
example projects and programs using AVR-Ada
- [Echo] an incoming character at the UART (RS232) interface
- LCD send output to a 16x2 character LCD
- Running a Motor with Motorshield and Pulse Width Modulation (PWM)
- Video about AVR-Ada running on Arduino to control a stepper motor
- Alarm Clock using Arduino, DS1307, buzzer, and LCD
-
AVR Library. The typical built-in peripherals of the AVR microcontrollers are supported by the avrlib. We apply a typical coding style for these support packages. Application programs should have with and use clauses for the parent package AVR and have only with clauses and no use clauses for the support packages. That results in calls like UART.Init or Timer2.Stop.
- [Strings] - Package AVR.Strings
- [EEprom] - Package AVR.EEProm
- [ADC] - Package AVR.ADC
- [Timer] - Packages AVR.Timer0, AVR.Timer1, AVR.Timer2
- [Programspace] - store constants in flash (program) memory
- [Delays] - different ways to control time
- [UART] - Package AVR.UART (now deprecated, use AVR.Serial instead)
- [Watchdog] - Package AVR.Watchdog
- [Text_and_Numerical_IO] - Text handling and numerical IO in the packages AVR.Serial and AVR.Strings.Edit
-
Libraries for External Peripherals and Utilities Provided by AVR-Ada
- [OwireLib] library for searching and accessing Dallas' 1-Wire sensors and components
- [Sensirion] library for accessing the Sensirion temperature and humidity sensors
- [HD44780Lib] library for displaying information on text LCDs based on HD44780 controlers
- [Debug] library for writing debug messages to the serial interface
- [Fatfs] library that implements FAT16/32 for SD/MMC cards
- [CRC] libraries for generating CRC8 and CRC16 values
- [slip] protocol library for packetized I/O over streams like asynchronous serial links
- [MCP4922] SPI support for the MCP4922 DAC chip
- [MIDI] MIDI support for any byte stream
-
status of the development of AVR-Ada itself
-
related projects
- Adacore provided their own version of AVR cross compiler hosted on Windows in 2011 and 2012. See the [comparison] between the two projects. For the time being don't mix Adacore's AVR compiler with AVR-Ada (unless you really know what you are doing).
- An interesting paper explains the various difficulties and solutions for Ada on AVR.
- An alternative way of using AVR-Ada.
- RTEMS always supported Ada and has AVR support also since several years. Now they have a page how to use AVRTest with AVR-Ada.
- Brian created a similar project for supporting the MSP430 chips. His project has a similar approach. We both enjoy mutually the other's experience.