-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
35 lines (22 loc) · 1.28 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
ATS AVR
This is a library that allows you to write firmware for AVR microcontrollers in ATS.
For programmer convenience, you can use functions found in DATS to accomplish basic
tasks with AVR modules such as Serial/I2C communication, ADC sampling, etc. The
library assumes your chip is atmega328p, but it shouldn't be difficult to write
firmware for other devices.
Before installing the library, make sure you have avr-binutils, avr-gcc, and the
avr-libc library installed on your machine.
To use the library, clone the repository into $ATSHOME/contrib. Next, add the scripts
directory to your path, or copy avr-atscc to some location in your path.
To compile an ATS file to a hex file, run:
avr-atscc -mmcu=atmega328p -o file.out file.dats
If you need to pass your CPU's clock frequency to gcc, you can either define
it inside your dats file, or pass the it as a command line option.
avr-atscc -mmcu=atmega328p -o program.out program.dats -DF_CPU=16000000L
Next, create your .hex file in the standard way.
avr-objcopy -O ihex program.out program.hex
Which you can then flash to your board.
You can read more about ATS at http://www.ats-lang.org, and try it out online at
http://xrats.illtyped.com/code/ats
Bootloader
A Bootloader from Atmel's website is available in the bootloader folder.