back to menue

Avise5 Forth Interpreter for ATmega processors

'Avise' is a short name for "AVR Virtual Stack Engine", which is a less standard Forth interpreter for selected ATmega CPUs. I have developed this project in the early 2000 years, last published version was 'Avise4.3' in 2006.
Inspired by another low-power project with STM32 processors now I got the idea to reduce power / supply current further more with a more simple chip design and reactivated/updated the 2006 version. Result is published here.

LowPower Hardware:

My main iterest is focused on ATmega328 and ATmega168, which are almost identical except memory size, because they provide enough memory for simple embedded projects and are available in 28p DIL case.
For interactive communication, an RS-232 interface is provided. While no data are transferred, it consumes effectly zero currrent. In most cases, an external USB/RS22 converter is needed, but not for standalone operation of a working project.
I have an old 'Arduino Uno' board. But the USB interface is not useful for low power design. A firmware version is published, too. Bound to 16 MHz CPU clock, the 115200 baud rate is not correct, but fits with the baud rate of the USB chip, which is incorrect the same way.
Next choice is the ATmega644/1284 family, because also available in DIL case for simple hardware DIY. The pin compatible good old ATmega32 is supported too, but cannot operate with 921kHz CPU speed.
Because I own some 'Arduino Micro' and 'Arduino Leonardo' boards, ATmega32U4 is supported too, but with less engagement.

The most efficient method to lower power consumption is to lower the CPU clock speed, which is reduced to 921.6kHz, still providing 57600Baud terminal speed.(optionally switchable to 1.8432MHz at runtime), derived from a 1.8432MHz crystal.
A similar version is available with 7.3728MHz crystal. At default it runs with 921.6kHz, optionally switchable to 7.3728MHz at runtime. Supply current at 921.6 kHz is about 0.1 mA higher than with 1.8432MHz crystal.
Optionally crystal frequency 18.432MHz (ATmega32: 14.7456MHz) is supported for fast applications without power reduction.

Another critical aspect of supply current is the quality of the 3.3V regulator. I have tested STM LE33A devices, use ca. 0.5mA ground pin current with CPU running at normal speed and without additional external components. A better pin compatible alternative is LP2950ACZ-3.3, uses ca. 0.2mA ground pin current, but increasing with higher load. A very low-current option is MCP1702, uses ca. 0.01mA grund pin current. But it is not pin compatible with the other types and max. acceptable input voltage is 13.2V.

The LED should be a very efficient blue or white type. To save current, a special Avise kernel operator "LED" is introduced to switch the LED off when not needed. With 10kOhm serial resistor, a blue LED uses about 0.1mA.

Below the line: the complete ATmega328P prototype with MCP1702 uses ca. 0.7mA with LED OFF, the ATmega168 prototype (very old chip) uses ca. 0.8mA, both operating at 921.6kHz (1.8432MHz crystal) and 3.3V supply . The brown-out detector is set to 1.8 V, so processors can operate down to 2.0V and use ca. 0.45mA then and RS-22 is still working at low baud rates. Comparison for HW complexity: ATmega644P uses ca.0.9 mA at 3.3V under same conditions. The other processors are not checked specifically.

Prototypes:

ATmega168/328 prototype PCBs
      left:ATmega328P DIL manually wired on Veroboardright:ATmega168 TQFP soldered on 15.24mm DIL breakout board

ATmega644/1284/32 prototype PCB
Prototype with ATmega644 DIL case. PCB design is Veroboard compatible

About 'Avise5' Firmware:

A compact operating and programming Manual (HTML file), and
a Kernel Operator Glossary (PDF file) and
a DIY Construction Manual (PDF file) is provided here.

A good tool for Forth source code upload is my DTerm Windows terminal software. It is surely not the best terminal emulator, but has been developed over the years for best fitness with my actual projects.

Downloads:
The subsequently downloadable material is copyrighted (c)2023 by Wolfgang Schemmert.
Assembly of the devices, programming and use of the software is permitted for free by everybody for any purpose ("freeware"). For commercial use, restrictions of third-party software contributors (Atmel, Microchip) must be respected.
All information is based on best knowledge, but "as is" and without any warranty. Any responsibility is excluded. Use for dangerous, life-threatening and medical applications is forbidden.

PCB layout for ATmega168-PU, ATmega328-PU (28p DIL case)
(1:1 TIF format. BOTTOM layer as well as component placement view are "from component side", i.e. BOTTOM layer shown mirrored "through the PCB" (as needed for PCB production))

PCB layout for ATmega168-AU, ATmega328PB-AU (32p TQFP case on 32p DIL breakout PCB)
(1:1 TIF format. BOTTOM layer as well as component placement view are "from component side", i.e. BOTTOM layer shown mirrored "through the PCB" (as needed for PCB production))

PCB layout for ATmega644, ATmega1284, ATmega32 (40p DIL case)
(1:1 TIF format. BOTTOM layer as well as component placement view are "from component side", i.e. BOTTOM layer shown mirrored "through the PCB" (as needed for PCB production))

Firmware "Avise59-168-1m8.hex for ATmega168, CPU Clock = 921.6kHz/1.8432MHz switchable. 57600 Baud. Uses 1.8432MHz crystal. Recommended Fuse Bytes: ext.0xFF, high 0xDE, low 0xFB
(10 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-168-7m.hex" for ATmega168, CPU Clock = 921.6kHz/7.3728 switchable. 57600 Baud. Uses 7.3728MHz crystal. Recommended Fuse Bytes: ext.0xFF, high 0xDE, low 0xFB
(10 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-168-18m.hex" for ATmega328, CPU Clock = 18.432MHz, max speed option. 57600 Baud. Recommended Fuse Bytes: ext.0xFF, high 0xDE, low 0xFF
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-328-1m8.hex for ATmega328, CPU Clock = 921.6kHz/1.8432MHz switchable. 57600 Baud. Uses 1.8432MHz crystal. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xFB
(10 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-328-7m.hex" for ATmega328, CPU Clock = 921.6kHz/7.3728 switchable. 57600 Baud.Uses 7.3728MHz crystal. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xFB
(10 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-328-11m.hex" for ATmega328, CPU Clock = 11.059MHz, max speed option with 3.3V supply. 57600 Baud. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xFF
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-328-18m.hex" for ATmega328, CPU Clock = 18.432MHz, max speed option. 57600 Baud. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xFF
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-328-16m.hex for ATmega328, CPU Clock = 16.00MHz. Optimized for Arduino Uno. Faulty 115200 Baud (error2%). But cannot be programmed with Arduino IDE, needs external programmer ! Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xFF
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-644-1m8.hex for ATmega644, CPU Clock = 921.6kHz/1.8432MHz switchable. 57600 Baud. Uses 1.8432MHz crystal. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xFB or 0xFD
Crystal startup is critical in this case. Replace C3 and C4 with 33pF or 47pF.
(10 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-644-7m.hex" for ATmega644, CPU Clock = 921.6kHz/7.3728 switchable. 57600 Baud. Uses 7.3728MHz crystal. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xFB or 0xFD or 0xF7
(10 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-644-18m.hex" for ATmega644, CPU Clock = 18.432MHz, max speed option. 57600Baud. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xF7
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-1284-18m.hex" for ATmega1284, CPU Clock = 18.432MHz, max speed option. 57600 Baud. Recommended Fuse Bytes: ext.0xFE, high 0xDF, low 0xF7
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-32-14m.hex" for ATmega32, CPU Clock = 14.7456MHz, optimized speed option. 57600 Baud. Recommended Fuse Bytes: high 0xDD, low 0xFF
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Firmware "Avise59-32u4-16m.hex" for ATmega32U4, CPU Clock = 16.00MHz, optimized for Arduino Micro, useable with Arduino Leonardo,too. But cannot be programmed with Arduino IDE, needs external programmer ! Recommended Fuse Bytes: ext.0xF9, high 0xDF, low 0xFF
(08 November 2023 - improvements, new options, bugfixes. Code rearrangement)

Source code "Avise59.zip"
(state 10 November 2023). This assembler source code is provided as complete "AVR Studio 4.18,Build684" project (ZIP file, 475 kB). Has been tested with "AVR Studio 4.19,Build730", too.
Parts published by Atmel/Microchip are under license of Atmel/Microchip, parts programmed by me are provided under GNU GPL3 license.

This project is programmed directly on register level, no external libraries are used.


back to menue


* State of information November 2023.
* Right of technical modifications reserved. Provided 'as is' - without any warranty. Any responsibility is excluded.
* This description is for information only. No product specifications are assured in juridical sense.
* Trademarks and product names cited in this text are property of their respective owners.