EEBasic Summary

Modified Basic Language

EEBasic uses an enhanced Basic language for control programming. The normal floating point variables are replaced with 16 bit integer variables which are better suited for high performance control type programming where peripherals are accessed. To handle display issues like an LCD character display, the language has a complete set of string variables and functions. Built-in special purpose modules are included to handle LCD displays, Infrared Remote Control decoding, 4x4 crosspoint keyboards (telephone keypads) and generalized access to two wire interface (I2C) devices.

Integer and String Variables

Variables are stored in the on chip ram and about 2kB is available for user variables. Since variable names are not fixed length and the name is stored with the variable, the exact number of variables depends upon the variable name length.

The language is also extended to allow user written assembler routines to be interfaced to the Basic code and this mechanism allows future expansion even on existing chips.

Flash Program Storage

EEBasic uses part of the program flash memory on the chip to store the users Basic program. Like most flash memories, there is an endurance issue with how many writes are allowed in each block of memory so EEBasic stores it's user code in a manner that limits the number of rewrites on a given block and distributes the 'wear' across the entire available memory. Of the 64 kB on the chip, about 28kB is available for user program storage. Depending upon statement complexity, more than 1000 statements can be stored.

Statement Level Editing

Basic statements can be added or deleted one at a time and the program is immediately available for execution. Since incremental compile occurs when the statement is entered, many syntax errors are detected immediately. Since the console being used is directly connected to the EEBasic chip, stop statements can be entered, variables can be displayed and modified at any time.

30 IO Pins

The host chip (Atmel Mega644) has 32 IO pins but 2 are used for the console RS-232 connection leaving 30 pins available for interfacing. Some hardware functions are assigned to specific pins so refer to the Atmel Mega644 data sheet for specifics. All pins can be configured for output or input and if input, pullup resistors enabled if desired.

Access to On Chip Peripherals

The host chip has an A/D convertor with 8 inputs, 3 timers (2 free, EEBasic uses 1), pulse width modulator hardware, analog comparator, and a two wire interface. EEBasic statements are available to access all of these devices as desired. With the ability to write and embed an assembler module of your own, even very high speed devices can be handled.

Access to EEProm for User Data

The on chip 2kB of EEProm is accessible from EEbasic. The Basic Data statement was assigned to handle this memory with Read but instead of the data being in the Basic program, it is stored in the EProm. A Write statement was added to complete the data transfer and a position command allows for random access of the EEProm if needed.

2kB of On Chip RAM for User Variables

Of the 4kB available on the chip 2 kB are allocated for user variables. This is hundreds of integer variables and many string variables depending upon the maximum string length.\

Two Wire Interface

The on chip two wire interface hardware is available for use using a interface module which allows for the full 400,000 bits / second transfer speed.

Serial Console uses a Terminal or Terminal Emulator

The entire EEBasic system is contained on the one chip. All that is required is a terminal or computer with terminal emulator program to program an EEBasic system. Source code is stored in the chip (in tokenized form) and can be listed out at any time.

Pulse Width Modulator Output

All of the PMW features of the Mega644 can be used but one timer0 is used by EEBasic and all of Timer0's features are reserved so only 4 of the 6 possible PMW channels are available.

10Bit A/D Converter and Analog Comparator

The Atmel chip has a single A/D converter with an 8 channel input multiplexer. Voltage scale ranges include +5V reference, 2.5V internal calibrated reference and a 1.2V bandgap reference. The analog comparator can be used to compare the voltage of two inputs. Refer to the Atmel Mega644 datasheet for details (http://atmel.com/dyn/resources/prod_documents/doc2593.pdf).

Breakpoints

The entire program development system (minus the terminal) is contained in the chip. Stop statements can be entered at any place in the program and all variables examined (Show) or modified as needed.

16 mHz Clock Speed

The EEBasic chip runs with a 16 mHz crystal or ceramic resonator. All baud rates and timings such as Delay depend on this. You can run at other speeds because you can set the timer limits to bring the timing back into calibration and autobaud can be used to adjust the baudrate. Speeds as high as 20 mHz (chip max) and as low as 1 mHz if power consumption is an issue.