All Projects → fpiot → arduino-ats

fpiot / arduino-ats

Licence: MIT license
ATS programing on Arduino

Programming Languages

c
50402 projects - #5 most used programming language
ATS
13 projects
objective c
16641 projects - #2 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects

ATS programing on Arduino Build Status

Paper

Kiwamu Okabe and Hongwei Xi. Arduino programing of ML-style in ATS. ML workshop, 2015.

Application Design

Demo code

Greating on LCD display

Functional programming on 8-bit Arduino! (with ATS language)

Show greeting message on LCD display that is available at LinkSprite. The source code is found at demo/lcd_greeting/DATS/main.dats.

Examples on Book "Getting Started with Arduino"

This project includes ATS code for Book "Getting Started with Arduino".

The ATS code is found at following.

Hardware: Arduino Uno

  • CPU: ATmega328 (Atmel AVR 8-bit)
  • Flash ROM: 32 kB
  • SRAM: 2 kB

Also you could get compatible boards

Setup environment

Debian GNU/Linux

Install some packages.

$ sudo vi /etc/apt/preferences.d/avr
Package: avrdude
Pin: version 6.1*
Pin-Priority: 1001
$ sudo apt-get install binutils-avr gcc-avr avr-libc avrdude libgmp-dev

Mac OS X

Install gmp package.

$ brew install gmp

Install AVR toolchain http://www.obdev.at/products/crosspack/index.html, and set PATH env.

$ export PATH=$PATH:/usr/local/CrossPack-AVR/bin
$ which avr-gcc
/usr/local/CrossPack-AVR/bin/avr-gcc

Windows

Install following package on cygwin.

  • git
  • gcc-core
  • libgc-devel
  • libgmp-devel
  • make

Install AVR toolchain http://winavr.sourceforge.net/.

T.B.D.

How to build

Install ATS2 http://www.ats-lang.org/.

$ tar xf ATS2-Postiats-X.Y.Z.tgz
$ export PATSHOME=`pwd`/ATS2-Postiats-X.Y.Z
$ export PATH=${PATSHOME}/bin:${PATH}
$ tar xf ATS2-Postiats-contrib-X.Y.Z.tgz
$ export PATSHOMERELOC=`pwd`/ATS2-Postiats-contrib-X.Y.Z
$ cd ${PATSHOME}
$ ./configure
$ make

Compile the ATS source code for Arduino.

$ cd arduino-ats/01_blink
$ make
$ file main.elf main.hex
main.elf: ELF 32-bit LSB executable, Atmel AVR 8-bit, version 1 (SYSV), statically linked, not stripped
main.hex: ASCII text, with CRLF line terminators

Write to the flash

Connect Arduino board to your PC using USB cable. And run following commands.

$ ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 May  8 15:59 /dev/ttyACM0
$ cd arduino-ats/blink_ats
$ make write
avrdude -c stk500v2 -p atmega2560 -b 115200 -P /dev/ttyACM0 -U flash:w:main.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
--snip--
avrdude: verifying ...
avrdude: 2850 bytes of flash verified
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done.  Thank you.

How to debug using gdb

T.B.D.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].