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

 

Getting Started

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

The Edit Menu

Edit|Find

The Tools Menu

Tools|Serial Port
Tools|Compiler
Tools|Debugger
Tools|Task Memory
Tools|SBC Memory
Tools|Build ROM
Tools|Extensions

The Debug Menu

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

The View Menu

View|Toolbar
View|Task Toolbar
View|Modify Toolbar
View|View Task Status

The Tasks Menu
The Flash Menu

Flash|Erase Flash
Flash|Move Current to Flash
Flash|Move All to Flash
Flash|Upgrade Vesta Basic
Flash|Erase Runaway Task

The Window menu
The Help menu

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

Variables

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

Operators

Expression Operators
Logical Operators
Relational Operators
Combining Relational and Logical Operators
Operator Precedence
Special Operators

String Functions

Substring Pointers
Substring Insertion
Substring Replacement
Substring Removal
Substring Reversal
Pointer Rules
Substring Pointers and String Functions

Vesta Basic Extensions

Using Extensions

Glossary of Keywords

REM

Variable Declaration

KERNEL
GLOBAL
LOCAL
STATIC
CONSTANT
DIM
DECLARE

Variable Assignment

LET
DATA, READ, RESTORE

Procedures

INCLUDE
SUBROUTINE
FUNCTION
CALL
CRITICAL
VITAL
END

Control Loops

IF, [ELSE], ENDIF
SELECT, CASE, [ELSE], ENDSELECT
DO WHILE, [EXIT], LOOP
DO, [EXIT], LOOP UNTIL
FOR, STEP, EXIT, NEXT
EXIT

Interrupt Control

ON TIMERx, SET TIMERx TO
ON INTx
ON ERROR
ON COMx

Task Control

START
STOP
RUN
SUSPEND
SET TIMESLICES TO n
REBOOT

Memory Commands

PEEK
POKE
DPEEK
DPOKE

I/O Space

IOPEEK
IOPOKE

Off-Board Memory

MEM_PEEK
MEM_POKE
MEM_DPEEK
MEM_DPOKE

EEPROM EEPROM_SIZE
EEPROM_POKE
EEPROM_PEEK

Flash Memory

FLASH_DPEEK
FLASH_DPOKE
FLASH_ERASE
FLASH_AVL

RAM Memory

RAM_AVL

RTC

TIMEDATE_PEEK
TIMEDATE_POKE
RTC_PEEK
RTC_POKE

Power Management

NAP
SLEEP
HIBERNATE

Data Manipulation

SIZE_OF
ADDR
ROWS_OF
COLS_OF

String Manipulation

HEX
DEC
REM
ASC
CHR
VAL
FVAL
STR
FSTR
LEN

Math Operators

MIN
MAX
SIN
COS
ARCTAN
ABS
LOG

Onboard Peripherals

KEYPAD
BEEP
PWM
COUNT
Output
PRINT
PIPE
INPUT

LCD Functions

LCD_COMMAND

Serial Communications Port Control

COMM
Using The DEV Port as a Serial Port
MODE
PTT
KEY_PENDING
INKEY
GET_TIMEOUT

IIC and SPI Commands

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

Analog Input

AIN_CONFIG
AIN

Analog Output

AOUT_CONFIG AOUT

Off-board Serial Ports

COMM_BUFFER

LED Matrix Control

VLED_COMMAND
VLED_MATRIX
VLED _7SEGMENT

 

Engines

SBC2000-188
MC2000-332
SBC2000-332

Peripherals

V4RLYOPTO
V8RLYOPTO
V16OPTO
V8ZPRLY
V32TTL
VAIODIO8
VADC8 & VAIO8
VADC12 & VAIO12
VADC24
V8DIGIT
V8x8LED
B4SERIAL
BADC12
BPCMCIA
RS485
DACAMP
LCD