Dick Cappels' project pages http://www.projects.cappels.org

Return to HOME (more projects)
AttoBASIC Home

AttoBasic Version 2.32
A byte-wide BASIC interpreter

Based on the original AttoBasic for ATmega163, version 2.32 includes all of the functions and features of prior versions of AttoBasic that make it an excellent hardware debug tool, as well as a platform for small programs.

Supports Atmel ATmega88/168/328, ATmega32U4, ATmega2560 and AT90USB1286 micro-controllers

Supports most Arduino, Adafruit and Teensy(2.0) products using the above micro-controllers

New Features and enhancements over prior AttoBasic versions

All project file downloads are free and located at the bottom of this page.

Data recorder using AttoBasic
AttoBasic-Based Data Recorder project on AVRfreaks,net
(AVR Freaks Login Required)
Breadboard used for easy hardware testing
A Teensy++2.0 wired on a solderless breadboard was used to develop and test the AttoBasic AT90USB1286 code with.  Also on the breadboard, to test the added support for Dallas/Maxim 1-Wire® devices using a DS1821 and a DS2431 EEPROM and the enhanced TWI support using a Microchip MCP3221 I2C-based 12-bit ADC.

Efficient commands to directly support hardware for:

Files included with AttoBASIC:

  • Full source code written in AVR-8 assembly language (AVR Studio 4.19) with Linux build scripts for all hex file variations
  • Application Note (with example programs)
  • Example programs to illustrate AttoBASIC
  • Example schematics for ATmega328 and ATmega32U4
  • Pre-assembled hex files for all supported micro-controllers
  • Device programming instructions for Arduino, Adafruit and Teensy(2.0) products
  • Complete command description
  • USB drivers for Windows®
  • Boot-loader source code for LUFA (DFU & CDC), STK500V2 and OptiBoot
  • Linux script to ease in programming using various boot-loaders
  • Linux script to select proper USB device and invoke picocom
New Features and Enhancements:
  • Bug Fixes! (Revision History in PDF)
  • Pre-assembled hex files for various existing platforms, "standard" clock speeds and USART or USB Serial I/O and with or without a bootloader.
  • Compatible with the following AVR microcontrollers:
  • In addition to SPI and TWI (I2C), new commands support the following hardware:
  • New commands to support the following:
    • DATA, READ and RESTORE to
      • Embed data into programs
      • Transfer multi-byte data packets to/from nRF24L01(+), TWI, SPI  or 1-Wire® devices and read them back.
    • Read/write the on-chip EEPROM.
    • EEPROM file system to save and load programs to and from on-chip EEPROM.
    • Bit, nibble and shifting of data
  • Improved functionality of existing commands to support bulk data transfers to and from:
    • SPI devices
    • TWI (I2C) slave devices
  • Nested FOR-NEXT and GOSUB-RETURN to 4 levels deep.
  • Dean Camera's LUFA DFU or CDC bootloaders as a choice to USB-based ATmega32U4 and AT90usb1286 builds.
AttoBASIC is a hardware-oriented “byte-wide” BASIC for the Atmel 8-bit AVR microcontroller series.  It is the creation of Dick Cappels. Because AttoBASIC is an interpreter rather than a compiler, testing devices and debugging program code is speedy as opposed to the "correct, compile, upload and test" cycles associated with compilers.  The disadvantage of using an interpreter on a micro-controller is that the program size is limited by the available (volatile) RAM and thus program size may be limited as opposed to a compiled program being able to use all of the micro-controller's (non-volatile) FLASH memory and RAM.

AttoBASIC commands are typically three (3) letter commands and are efficient in their implementation when accessing communication buses  and high-level devices.

Using a host computer's "terminal" application to interface with AttoBASIC, programs are typed, loaded from EEPROM or uploaded and then stored in internal RAM. SAVE and LOAD commands allow one to save and load the program from the on-chip EEPROM.

AttoBASIC's greeting and example of printing "Hello World" are shown at the right.

Commands directly support interfacing to SPI, TWI (I2C), 1-Wire®, nRF2401(+), DHTxx, DS, and external SPI EEPROM devices simplify programming by reducing program size and complexity. 

GOSUB-RETURN and FOR-NEXT loops can be nested four (4) levels deep.

The interpreter is not case-sensitive.  26 Variables (A..Z) are supported.  All arithmetic and variables are byte-wide (8 bits).  Single characters can be printed with the "EMIT" command.  Strings are supported via the PRINT statement but not as input.  All characters can be read individually with the "KEY" command.

The Line editor supports destructive backspace (delete key), line replacement, line deletion, and line insertion. Valid line numbers range is 0..255. Lines entered with a numeral in the first column will be stored, others will be interpreted when the carriage return (ENTER key) is received.

The entire 64KB of data space (RAM and I/O) is accessible for examination and modification via PEEK and POKE commands, which can be useful for debugging or additionally, indexed data storage as well as direct register manipulation of all on-chip peripherals. Special I/O commands support bit and byte I/O.

The on-chip EEPROM can be accessed via read and write commands.

Debugging commands simplify viewing Variables, RAM, I/O and EEPROM contents.

A Self-Start feature of AttoBASIC invokes a program stored in EEPROM to be loaded into RAM and begin execution if the "Self-Start" pin is held low during power-up or reset.  Consult the Application note for details as to which pin is used as "Self-Start" for the various HEX file builds.  The "Self-Start" pin uses the AVR's internal pull-up.

Language Extension Modules enabled for default hex file builds

Module Function Atmega88
Atmega2560 AT90USB1286

USART Serial I/O
USB Serial I/O











AttoBASIC 2.32 Command List (PDF file) - commands supported by AttoBASIC Version 2.32.
AttoBASIC 2.32 Application Note (ZIP file) - Application Note (PDF) and programming examples By Scott Vitale
Pre-assembled 2.32 Hex Files (ZIP file) - for all controllers supported in this version. (includes all files)
Device Programming Instructions (PDF file) - everything you need to know about programming your AVR by Scott Vitale.  Includes Generic, Arduino and Teensy(2.0) platforms.
Bootloaders (ZIP fIle) - LUFA, Optiboot, Stk500v2.  Please see the licensing statements accompanying the respective files.
  1. The supplied LUFA bootloader was written by and owned by Dean Camera -  dean [at] fourwalledcubicle [dot] com,  http://www.lufa-lib.org
  2. The USB serial I/O code is from USB Serial Example for Teensy USB Development Board, copyrighted by PJRC.COM, LLC. http://www.pjrc.com
Full Source Code (ZIP file) - Here are all the files you need to build your own version of AttoBASIC 2.32.source. It includes all the  code, build scripts, bootloaders, documentation and pre-assembled hex files.

Contents ©2011, 2012, 2013 and 2014 by Scott Vitale and Richard Cappels.  All Rights Reserved.

Find updates at www.projects.cappels.org

AttoBASIC Home - Prior AttoBASIC version can be found here.

Return to HOME (More Projects)

First posted in July, 2013. Updated to 2.32 in November, 2013. Broken links corrected November 2013 (thanks, Jeff).  Page revised and external reference links added by Scott Vitale, April 2014

Please contact Scott Vitale directly for questions, comments or bug reports regarding AttoBASIC version 2.x at ksv_prj(at)gmx.com.  Replace "(at)" with "@" before mailing.

Please contact Dick Cappels for questions, comments or corrections regarding the web page(s) and site at projects(at)cappels.org. Replace "(at)" with "@" before mailing.

Use of information presented on this page is for personal, nonprofit educational and noncommercial use only. This material (including object files) is copyrighted by Richard Cappels and Scott Vitale and may not be republished or used directly for commercial purposes without written permission. For commercial license, click here.

Liability Disclaimer and intellectual property notice
(Summary: No warranties, use these pages at your own risk. You may use the information provided here for personal and educational purposes but you may not republish or use this information for any commercial purpose without explicit permission.)

I neither express nor imply any warranty for the quality, fitness for any particular purpose or  user, or freedom from patents or other restrictions on the rights of use of any software, firmware, hardware, design, service,information, or advice provided, mentioned,or made reference to in these pages. By utilizing or relying on software, firmware, hardware, design, service,information, or advice provided, mentioned, or made reference to in these pages, the user takes responsibility to assume all risk and associated with said activity and hold Richard Cappels harmless in the event of any loss or expense associated with said activity. The contents of this web site, unless otherwise noted, is copyrighted by Richard Cappels. Use of information presented on this site for personal, nonprofit educational and noncommercial use is encouraged, but unless explicitly stated with respect to particular material, the material itself may not be republished or used directly for commercial purposes. For the purposes of this notice, copying binary data resulting from program files, including assembly source code and object (hex) files into semiconductor memories for personal, nonprofit educational or other noncommercial use is not considered republishing. Entities desiring to use any material published in this pages for commercial purposes should contact the respective copyright holder(s).

Original Document Location http://cappels.org/dproj/AttoBASIC222/AttoBASIC_2.22_with_USB_and_Arduino_support.html

Free Counters
Free Counters