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

Return to HOME (more projects)
AttoBASIC Home



AttoBasic Version 2.34
A byte-wide BASIC interpreter


Based on the original AttoBASIC for ATmega163, Version 2.34 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 ATtiny84/85*, ATmega16/32*, ATmega88/168/328, ATmega32U4, ATmega644P/1284P*, ATmega2560 and AT90USB1286 micro-controllers [* New for Version 2.34]

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

Prior versions of AttoBASIC for the AT90S2313, ATtiny2313[A], AT90S8515 and ATmega163
are now included in the HEX file builds as is the full source code.

New Features and enhancements over prior AttoBasic versions

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



Z80
                  Single Board Computer with TEENSY 2.0++ as Host
                  Controller
Data recorder using AttoBasic
AttoBasic-Based Data Recorder project on AVRfreaks,net
(AVR Freaks Login Required)
AttoBASIC used for initial hardware testing of Z80 Single Board Computer, which uses TEENSY as Host Controller
A Teensy++2.0 is used as the host interface controller for a Z80 Single Board Computer.  AttoBasic running on the TEENSY's AT90USB1286 was used for the initial hardware testing, including correct memory address decode, RAM read/write interface, full RAM test, SPI interface to the 74HC299-to-Z80 data bus "bridge" and TWI interface with DS3231 Reat-time Clock module.

Efficient commands to directly support hardware for:

Files included with AttoBASIC:

  • Full source code written in AVR8 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, OptiBoot and OptiBoot-85
  • Linux script to ease in programming using various boot-loaders and programmers
  • 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.
  • Prior versions of AttoBASIC for the following AVR's are now included in the HEX file builds as is the full source code.
    • AT90S2313 and ATtiny2313[A]
    • AT90S8515
    • ATmega163
Overview
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.

Operation
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 non-volatile configuration bit or in some builds, the "Self-Start" pin is held low during power-up or reset.  Consult the Application note for details as to which MCU's use the "Self-Start" pin and the MCU's pin number being 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 AT90S2313/
ATtiny2313
Attiny84
Attiny84 Attiny85 Attiny85 AT90S8515
ATmega163
ATmega88
Atmega168 
ATmega16/32 ATmega644/
ATmega1284

Atmega328P
Atmega32U4
Atmega2560 AT90USB1286
DEBUG









USART Serial I/O




SWUART SIO
1/2 duplex











USB Serial I/O













PORT I/O
DDS






DS









PWM
SPI







DATA FILE (Ext. EEPROM)








TWI (I2C)







1-WIRE




ADC


Analog Comp
INTERNAL REGISTERS








SELF-START ■(pin) ■(pin) ■(pin)
ICP








EFS








SYS Clock




LOW-POWER




NRF24L01







DHT









RTC








NV Config



Xtra Ops




CRC













HELP









RAM/EEPROM
(bytes)
128/128
512/512
512/512 512/512 512/512 512/512 1024/512 1024/512
1024/512 1K/512 or 2K/1K
16K/4K or 8K/2K 2K/1K
2.5K/1K
8K/4K
8K/4K
Variable Available
A-D
A-M
A-M A-M A-M A-Z A-Z A-Z
A-Z A-Z A-Z A-Z A-Z A-Z A-Z
Data Stack Depth
4
9
9
9
9
12
12
17
34
17 or 34
17 or 34 17 or 34 17 or 34 17 or 34 17 or 34
FOR-NEXT & GOSUB Depth
1
2
2
2
2
1
1
4
4
4
4
4
4
4
4
DATA Statement Size (bytes)
N/A
8
8
8
8
N/A
N/A
8
16
32
32
32
32
32
32
System Clock (MHz)
4/8/16/20
4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20 4/8/16/20
Boot-Loader
[none]
OptiBoot85
[none] OptiBoot85 [none] [none] [none] [none] OptiBoot OptiBoot OptiBoot OptiBoot LUFA DFU or CDC STK500V2 LUFA DFU or CDC

Downloads

AttoBASIC v2.34 Command List (PDF file) - commands supported by AttoBASIC Version 2.34.
AttoBASIC v1.20 Command List for AT2313/ATtiny2313 (PDF file) - commands supported by AttoBASIC Version 2.34.

AttoBASIC v2.34 Application Note (PDF file) - Application Note and programming examples By Scott Vitale.

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.

AttoBASIC v2.34 Pre-assembled Hex Files (3.6MB ZIP file) - This file contains 134 HEX files for all controllers and clock speeds supported.

AttoBASIC v2.34 Applications, Docs and Utilities (989KB ZIP file) - This file contains the sample application files, documentation and utilities for AttoBASIC version 2.34.

AttoBASIC v2.34 Source Code (9.0MB ZIP file) - This is the full project directory source tree.  It contains all the files needed to build your own version of AttoBASIC from the v2.34 source code.  It includes the source code, Linux build scripts, sample applications, documentation, bootloaders, USB drivers, etc.
AttoBASIC v2.34 Bootloaders, SIO and USB Drivers (3.3MB ZIP file) - LUFA, OptiBoot, OptiBoot85, Stk500v2 bootloaders, Serial I/O modules and USB drivers for WINDOWS®.  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
AttoBASIC Revision History (PDF file) - Full revision history since the 2011 release of version 2.0.

Contents ©2011, 2012, 2013, 2014 and 2016 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 version 2.34 in November, 2016. Broken links corrected November 2013 (thanks, Jeff).  Page revised and external reference links added by Scott Vitale, November 2016

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_Versions_2.34.html


Free Counters
Free Counters