|
BASIC språket. |
|
|
|
|
Microcontrollern programmeras med en enkel och kraft full BASIC
dialekt utan radnummer.
Det finns givetvis de vanliga GOTO, FOR...NEXT och IF...THEN instruktionerna
men
utöver det så finns det andra instruktioner som är
speciellt anpassade för kontroll och styr
ändamål, tex finns instruktionerna SERIN, BUTTON, PWM,
TOGGLE och POT. Varje
enskild instruktion upptar 2-3 bytes i EEPROM'et vilket innebär
att ett program maximalt
kan innehålla ca 100 instruktioner och exekverings hastigheten
är ca 2000 instruktioner/sekund. |
|
|
|
|
Handboken
till BASIC-STAMP i Acrobat format
Acrobat Reader
BASIC Stamp I instruktions set
BRANCHING
IF...THEN Compare and conditional branch
BRANCH Branch to address specified by offset
GOTO Branch to address
GOSUB Branch to subrutine at address
RETURN Return from subrutine
LOOPING
FOR...NEXT Establish a FOR...NEXT loop
NUMERIC
LET Perform variable manipulation
LOOKUP Lookup data specified by offset and store in variable
LOOKDOWN Find target's match number and store in variable
RANDOM Generate a random number
DIGITAL I/O
OUTPUT Make a pin an output
LOW Make pin output low
HIGH Make pin output high
TOGGLE Make pin output and toggle state
PULSOUT Output a timed pulse
INPUT Make pin an input
PULSIN Measure an input pulse
REVERSE If pin is an input, make it an output and vice versa
RETURN Return from subrutine
SERIAL I/O
SERIN Serial input, baudrates 300 - 2400, 8N1
SEROUT Send data serially, baudrates 300 - 2400, 8N1
ANALOG I/O
PWM Output PWM (can be used as a simple D/A with a RC-net)
POT Read a 5-50 K potentiometer and scale result
SOUND
SOUND Play notes
TIME
PAUSE Pause execution 0-65536 milliseconds
EEPROM ACCESS
EEPROM Store data in EEPROM before downloading BASIC program
READ Read EEPROM byte into variable
WRITE Write byte into variable
POWER CONTROL
NAP Nap for a short period, power consumption is reduced
SLEEP Sleep for 1-65535 sec, power consumption approx 20 uA
END Sleep until power cycles or PC connects
PROGRAM DEBUGGING
DEBUG Send variables to PC for viewing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
E-Mail till MUX-Elektronik
MUX-Elektronik
Butik: Kjellbergsgatan 5, 411 32 Göteborg.
Tel / Fax 031 16 33 90
Copyright (C) 1998 (All Rights Reserved)
|
|