Skip to content

fpiot/arduino-ats

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

ATS programing on Arduino

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published