The Vesta
Multi-tasking Basic Language
and Hardware Manual
For the SBC2000-332,
the MC2000-332 & Dev-332,
and the SBC2000-188
Revised May, 2001
Contents
Repair
Copyright Information
Technical Support
Welcome to Vesta Basic
Features
Minimum System Requirements
Preparing the SBC
Beware of ESD
Kit Contents
Installing
the Vesta Basic IDE
What Gets Installed
Upgrades
Manuals
Application Examples
Conventions used in this manual
The Integrated Development Environment
Invoking
the Vesta Basic IDE
Your
First Program
Toolbar
Buttons
IDE
Menus
The File Menu
File|Open Task
File|Save Task
File|Save Task As
File|Print
File|Exit
Edit|Find
Tools|Serial Port
Tools|Compiler
Tools|Debugger
Tools|Task Memory
Tools|SBC Memory
Tools|Build ROM
Tools|Extensions
Debug|Reboot SBC2000
Debug|Stop Autostart
Debug|Go
Debug|Stop
Debug|Compile Only
Debug|Download
Debug|Step
Debug|Animate
Debug|Continue
Debug|Reset
Debug|Add Watch
Debug|Delete Watch
Debug|Modify Watch
View|Toolbar
View|Task Toolbar
View|Modify Toolbar
View|View Task Status
Flash|Erase Flash
Flash|Move Current to Flash
Flash|Move All to Flash
Flash|Upgrade Vesta Basic
Flash|Erase Runaway Task
Help|About Vesta Basic
The Basics of Vesta Basic
The Anatomy of Vesta Basic
SBC2000 Memory
Battery Backable RAM
Real Time Clock RAM
EPROM
Flash Memory
EEPROM Memory
External Memory Devices
The Vesta Basic Task
Working with Tasks
Task Size Limitations
Where to Store Tasks
Task Switch Timing
Starting and Stopping Tasks
Task Structure
Line Format
Procedures
Subroutines
Functions
CRITICAL and VITAL Procedures
Data Types
Naming Conventions
Classes of Variables
Global Variables
Kernel Variables and Inter-task Communication
Variable Initialization
Arrays
Creating an Array
Two Dimensional Array in RAM
String Arrays
Arrays in EEPROM
Arrays in Flash
Sharing Array Data Between Tasks
Constant Data
Numeric Constants
String Constants and Literals
Arrays of Constant Data
Assignments Using Mixed Data Types
Expression Operators
Logical Operators
Relational Operators
Combining Relational and Logical Operators
Operator Precedence
Special Operators
Substring Pointers
Substring Insertion
Substring Replacement
Substring Removal
Substring Reversal
Pointer Rules
Substring Pointers and String Functions
Using Extensions
KERNEL
GLOBAL
LOCAL
STATIC
CONSTANT
DIM
DECLARE
LET
DATA, READ, RESTORE
INCLUDE
SUBROUTINE
FUNCTION
CALL
CRITICAL
VITAL
END
IF, [ELSE], ENDIF
SELECT, CASE, [ELSE], ENDSELECT
DO WHILE, [EXIT], LOOP
DO, [EXIT], LOOP UNTIL
FOR, STEP, EXIT, NEXT
EXIT
ON TIMERx, SET TIMERx TO
ON INTx
ON ERROR
ON COMx
START
STOP
RUN
SUSPEND
SET TIMESLICES TO n
REBOOT
PEEK
POKE
DPEEK
DPOKE
IOPEEK
IOPOKE
MEM_PEEK
MEM_POKE
MEM_DPEEK
MEM_DPOKE
FLASH_DPEEK
FLASH_DPOKE
FLASH_ERASE
FLASH_AVL
RAM_AVL
TIMEDATE_PEEK
TIMEDATE_POKE
RTC_PEEK
RTC_POKE
NAP
SLEEP
HIBERNATE
SIZE_OF
ADDR
ROWS_OF
COLS_OF
HEX
DEC
REM
ASC
CHR
VAL
FVAL
STR
FSTR
LEN
MIN
MAX
SIN
COS
ARCTAN
ABS
LOG
KEYPAD
BEEP
PWM
COUNT
Output
PIPE
INPUT
LCD_COMMAND
Serial
Communications Port Control
COMM
Using The DEV Port as a Serial Port
MODE
PTT
KEY_PENDING
INKEY
GET_TIMEOUT
VAST_OPEN
VAST_CLOCK
VAST_CLOSE
VAST_SPI_XFER SPI transfer Example
VAST_IIC_START VAST_IIC_STOP VAST_IIC_SEND VAST_IIC_READ IIC Transfer Example:
Digital and Analog I/O
Digital I/O
VDIO_CONFIG
VSET
VRESET
VOUT
VTEST
AIN_CONFIG
AIN
AOUT_CONFIG AOUT
COMM_BUFFER
VLED_COMMAND
VLED_MATRIX
VLED _7SEGMENT