SmartBox JobList: Difference between revisions

From Smart Box
Jump to navigation Jump to search
(Created page with " <nowiki>OS 4 - 14.02.00 0 Blank Does nothing Send Byte 0 = 0 Returns Nothing 1 Version Read the operating system version number Send Byte 0 = 1 Returns Byte 0 = version number - low byte Byte 1 = version number - high byte Comments Divide by 1000 to get the version number, eg. version 1.023 would be returned as 1023 2 Reset Reset Smart Box Send Byte 0 = 2 Byte 1 = 254 or 255 Returns Nothing Comments Reset SmartBox from the host micro. Sending a...")
 
(→‎OS_CALLOS: Converted plaintext documentation to markdown)
 
Line 1: Line 1:
<nowiki>OS 4 - 14.02.00
OS 4 - 14.02.00


== 0 Blank ==


0 Blank
Does nothing
Does nothing
Send Byte 0 = 0
Returns Nothing


1 Version
{|class="calltable"
Read the operating system version number
|Send||
Send Byte 0 = 1
* Byte 0 = 0
Returns Byte 0 = version number - low byte
|-
Byte 1 = version number - high byte
|Returns||
Comments Divide by 1000 to get the version number, eg. version 1.023
Nothing
would be returned as 1023
|}


2 Reset
== 1 Version ==
Reset Smart Box
Send Byte 0 = 2
Byte 1 = 254 or 255
Returns Nothing
Comments Reset SmartBox from the host micro. Sending a 254 performs
a soft reset (same as pressing reset), sending 255 does a
hard reset (clears battery back RAM). Before sending
anymore codes create a small delay while SmartBox resets
various parts of hardware


3 NameCode
Read the operating system version number
To obtain the operating system call number where the name
is known
Send Byte 0 = 3
Byte 1 - n = ASCII characters of OS call name
Byte n+1 = 13
Returns Byte 0 = Operating system call number


4 CodeName
{|class="calltable"
To obtain the name associated with an operating system
|Send||
call
* Byte 0 = 1
Send Byte 0 = 4
|-
Byte 1 = OS call number
|Returns||
Returns StringCR = OS call name
* Byte 0 = version number - low byte
* Byte 1 = version number - high byte
|-
|Commments||
Divide by 1000 to get the version number, eg. version 1.023 would be returned as 1023
|}


5 MultipleSetup
== 2 Reset ==
To set the values that will be returned by MultipleRead
Send Byte 0 = 5
Byte 1 = Analogue channel 1
Byte 2 = Analogue channel 2
Byte 3 = Analogue channel 3
Byte 4 = Analogue channel 4
Byte 5 = Digitial inputs
Byte 6 = Digital outputs
Byte 7 = Motor outputs
Returns Nothing
Comments This sets up the readings which will be returned when the
call MultipleRead is made. If a byte = 1 the corresponding
port will be returned, 0 = value not returned


6 MultipleRead
Reset Smart Box
Returns multiple readings as defined using MultipleSetup
 
Send Byte 0 = 6
{|class="calltable"
Returns Bytes as defined by MultipleSetup
|Send||
Comments This call returns readings from a number of ports as
* Byte 0 = 2
* Byte 1 = 254 or 255
|-
|Returns||
Nothing
|-
|Commments||
Reset SmartBox from the host micro. Sending a 254 performs a soft reset (same as pressing reset), sending 255 does a reset (clears battery back RAM). Before sending codes create a small delay while SmartBox resets various parts of hardware
|}
 
== 3 NameCode ==
 
To obtain the operating system call number where the name is known
 
{|class="calltable"
|Send||
* Byte 0 = 3
* Byte 1 - n = ASCII characters of OS call name
* Byte n+1 = 13
|-
|Returns||
* Byte 0 = Operating system call number
|}
 
== 4 CodeName ==
 
To obtain the name associated with an operating system call
 
{|class="calltable"
|Send||
* Byte 0 = 4
* Byte 1 = OS call number
|-
|Returns||
* StringCR = OS call name
|}
 
== 5 MultipleSetup ==
 
To set the values that will be returned by MultipleRead
 
{|class="calltable"
|Send||
* Byte 0 = 5
* Byte 1 = Analogue channel 1
* Byte 2 = Analogue channel 2
* Byte 3 = Analogue channel 3
* Byte 4 = Analogue channel 4
* Byte 5 = Digitial inputs
* Byte 6 = Digital outputs
* Byte 7 = Motor outputs
|-
|Returns||
Nothing
|-
|Commments||
This sets up the readings which will be returned when the call MultipleRead is made. If a byte = 1 the corresponding port will be returned, 0 = value not returned
|}
 
== 6 MultipleRead ==
 
Returns multiple readings as defined using MultipleSetup
 
{|class="calltable"
|Send||
* Byte 0 = 6
|-
|Returns||
* Bytes as defined by MultipleSetup
|-
|Commments||
This call returns readings from a number of ports as
defined by MultipleSetup
defined by MultipleSetup
|}


7 MultipleServer
== 7 MultipleServer ==
Constantly returns multiple readings as defined using
 
MultipleSetup
Constantly returns multiple readings as defined using MultipleSetup
Send Byte 0 = 7
 
Returns Bytes as defined by MultipleSetup
{|class="calltable"
Comments This call is similar to MultipleRead but continues to
|Send||
* Byte 0 = 7
|-
|Returns||
* Bytes as defined by MultipleSetup
|-
|Commments||
This call is similar to MultipleRead but continues to
return readings until SmartBox receives the byte 123
return readings until SmartBox receives the byte 123
|}
== 8 IdentSystem ==
Read System Information
{|class="calltable"
|Send||
Nothing
|-
|Returns||
* Byte 0 = table length
* Word = VIA
* Word = ACIA
* Word = ADC
* Word = AUX.PORT
* Word = jobs.status
* Word = jobin.buf
* Word = jobout.buf
* Byte = Processor ident
* Word = OS version number
* Byte = Hardware version number
* String10 = Name, padded to 10 chars
* Byte = Number of inputs
* Byte = Number of outputs
* Byte = Number of motors
* Byte = Number of analogues
* Byte = BBR support
* Byte = Short support
* Byte = Printer support
* Byte = Keypad support
* Byte = LCD x dim/support
* Byte = LCD y dim
|-
|OS Release||
3,4
|}
== 9 Credits ==
Returns the copyright string
{|class="calltable"
|Send||
* Byte 0 = 9
|-
|Returns||
* StringNUL = Copyright string
|-
|Commments||
This call returns the copyright message and OS details
|}
== 10 WriteMotors ==
Writes a byte to the motor drivers
{|class="calltable"
|Send||
* Byte 0 = 10
* Byte 1 = value to write
|-
|Returns||
Nothing
|-
|Commments||
Each of the four motor outputs has two bits encoded into this value, bits 0 and 1 are for motor a, bytes 2 and 3 are for motor b, bits 4 and 5 are for motor c and bits 6 and 7 are for motor d, setting both bits to 0 will stop the motor, setting the low bit high and high bit low will make the motor go forward and setting the high bit high and the low bit low will make it go backwards. Using this call automatically stops all pulsing of motors
|}
== 11 ReadMotors ==
Read the state of the motor drivers
{|class="calltable"
|Send||
* Byte 0 = 11
|-
|Returns||
* Byte 0 = value read from the motor drivers
|-
|Commments||
The value returned is the same value as what would be sent to WriteMotors
|}
== 12 MotorForward ==
Switch a motor on
{|class="calltable"
|Send||
* Byte 0 = 12
* Byte 1 = motor number (1 to 4)
|-
|Returns||
Nothing
|-
|Commments||
This makes the appropriate motor go forward. Using this call automatically cancels the pulsing for the appropriate motor
|}
== 13 MotorReverse ==
Switch a motor on with reverse polarity
{|class="calltable"
|Send||
* Byte 0 = 13
* Byte 1 = motor number (1 to 4)
|-
|Returns||
Nothing
|-
|Commments||
This makes the appropriate motor go backward. Using this call automatically cancels the pulsing for the appropriate motor
|}
== 14 MotorHalt ==
Switch a motor off
{|class="calltable"
|Send||
* Byte 0 = 14
* Byte 1 = motor number (1 to 4)
|-
|Returns||
Nothing
|-
|Commments||
This makes the appropriate motor stop. Using this call automatically cancels the pulsing for the appropriate motor
|}
== 15 MotorPower ==
Pulse a motor outputs to vary speed
{|class="calltable"
|Send||
* Byte 0 = 15
* Byte 1 = motor number (1 to 4)
* Byte 2 = on time
* Byte 3 = off time
|-
|Returns||
Nothing
|-
|Commments||
This pulses the appropriate motor at a rate determined by the on/off time (in centiseconds) specified, alternating the motor between the state at which it was last defined (Forward or Reverse) and Halt
|}
== 16 PatchMF ==
Same as MotorForward
{|class="calltable"
|OS Release||
3,4
|}
== 17 MotorVoltage ==
Set voltage for motor outputs
{|class="calltable"
|Send||
* Byte 0 = voltage (0 to 3)
|-
|Returns||
Nothing
|-
|Notes||
Voltage values are 0 (0v), 1 (6v), 2 (9v), 3 (12v).<br />
''Setting a voltage of 0 will also switch '''outputs''' to 0v''
|-
|Commments||
This sets the actual voltage supplied to the motor outputs
|-
|OS Release||
4
|}
== 20 WriteOutputs ==
Write a 8 bit value to the digital output port
{|class="calltable"
|Send||
* Byte 0 = 20
* Byte 1 = byte to be written to the port
|-
|Returns||
Nothing
|-
|Commments||
Using this call automatically cancels all pulsing on the output port
|}
== 21 OutputPower ==
Vary the power by pulsing individual output lines
{|class="calltable"
|Send||
* Byte 0 = 21
* Byte 1 = bit number (0 to 7)
* Byte 2 = on time
* Byte 3 = off time
|-
|Commments||
This pulses the appropriate output line at a rate determined by the on/off time (in centiseconds) specified, alternating the output line between on and off
|}
== 22 GetSensors ==
To read the type of sensors connected to the analogue sensors
{|class="calltable"
|Send||
* Byte 0 = 22
|-
|Returns||
* Byte 1 = type of sensor connected to sensor A
* Byte 2 = type of sensor connected to sensor B
* Byte 3 = type of sensor connected to sensor C
* Byte 4 = type of sensor connected to sensor D
|-
|Commments||
This returns the sensor types connected to the analogue sensors that were returned from the last time they were checked. A sensor type of 0 means no sensor
|}
== 23 CheckSensors ==
To check the type of sensors connected to the analogue sensors
{|class="calltable"
|Send||
* Byte 0 = 23
|-
|Returns||
* Byte 1 = type of sensor connected to sensor A
* Byte 2 = type of sensor connected to sensor B
* Byte 3 = type of sensor connected to sensor C
* Byte 4 = type of sensor connected to sensor D
|-
|Commments||
This does an immediate check of the sensor types connected to the analogue sensors. A sensor type of 0 means no sensor
|}
== 24 WriteSensorTable ==
Write sensor table entry
{|class="calltable"
|Notes||
''Not Implemented''
|-
|OS Release||
3
|}
== 25 ReadSensorTable ==
Read sensor table entry
{|class="calltable"
|Send||
* Byte 0 = entry to read
|-
|Returns||
* Byte 0 = sensor number
* Byte 1 = number of decimal points to display
* Byte 2 = max adc reading
* Byte 3 = reading offset (LSB)
* Byte 4 = reading offset (MSB)
* Byte 5 = multiplication factor (LSB)
* Byte 6 = multiplication factor (MSB)
* Byte 7 = division factor (LSB)
* Byte 8 = division factor (LSB)
* String = full sensor title
* String = abbreviated sensor label
* String = sensor label
* String = sensor units
|-
|Notes||
If byte 0 is &FF then sensor is unknown
|-
|OS Release||
3,4
|}
== 28 SetBitHigh ==
Set individual output line(s) high
{|class="calltable"
|Send||
* Byte 0 = 28
* Byte 1 = byte determining which lines will be set
|-
|Returns||
Nothing
|-
|Commments||
A bit set in the byte sent will set the corresponding output line high
|}
== 29 SetBitLow ==
Set individual output line(s) low
{|class="calltable"
|Send||
* Byte 0 = 29
* Byte 1 = byte determining which lines will be unset
|-
|Returns||
Nothing
|-
|Commments||
A bit set in the byte sent will set the corresponding output line low
|}
== 30 ReadADCReg ==
To read a ADC register
{|class="calltable"
|Send||
* Byte 0 = 30
* Byte 1 = register number (0 to 15)
|-
|Returns||
* Byte 0 = value of register
|-
|OS Release||
2
|}
== 31 WriteADCReg ==
To write to a ADC register
{|class="calltable"
|Send||
* Byte 0 = 31
* Byte 1 = register number (0 to 15)
* Byte 2 = value to write
|-
|Returns||
Nothing
|-
|OS Release||
2
|}
== 32 ReadACIAReg ==
To read a ACIA register
{|class="calltable"
|Send||
* Byte 0 = 32
* Byte 1 = register number (0 to 15)
|-
|Returns||
* Byte 0 = value of register
|-
|OS Release||
2
|}
== 33 WriteACIAReg ==
To write to a ACIA register
{|class="calltable"
|Send||
* Byte 0 = 33
* Byte 1 = register number (0 to 15)
* Byte 2 = value to write
|-
|Returns||
Nothing
|-
|OS Release||
2
|}
== 34 ReadVIAReg ==
To read a VIA register
{|class="calltable"
|Send||
* Byte 0 = 34
* Byte 1 = register number (0 to 15)
|-
|Returns||
* Byte 0 = value of register
|-
|OS Release||
2
|}
== 35 WriteVIAReg ==
To write to a VIA register
{|class="calltable"
|Send||
* Byte 0 = 35
* Byte 1 = register number (0 to 15)
* Byte 2 = value to write
|-
|Returns||
Nothing
|-
|OS Release||
2
|}
== 36 SetVIAHigh ==
To set bits in a VIA register
{|class="calltable"
|Send||
* Byte 0 = 36
* Byte 1 = register number (0 to 15)
* Byte 2 = mask
|-
|Returns||
Nothing
|-
|OS Release||
2
|}
== 37 SetVIALow ==
To unset bits in a VIA register
{|class="calltable"
|Send||
* Byte 0 = 37
* Byte 1 = register number (0 to 15)
* Byte 2 = mask
|-
|Returns||
Nothing
|-
|OS Release||
2
|}
== 40 ReadADC ==
Take a reading from a specific ADC channel
{|class="calltable"
|Send||
* Byte 0 = 40
* Byte 1 = channel number (1 to 4)
|-
|Returns||
* For an 8 bit reading:
** Byte 0 = reading from ADC
* For a 16 bit reading:
** Byte 0 = low byte of reading
** Byte 1 = high byte of reading
|-
|Commments||
The value returned will be at the resolution specified by OS calls HighResADC and LowResADC
|}
== 41 ReadADCs ==
Read all the ADC channels
{|class="calltable"
|Send||
* Byte 0 = 41
|-
|Returns||
* For 8 bit readings:
** Byte 0 = reading from channel 1
** Byte 1 = reading from channel 2
** Byte 2 = reading from channel 3
** Byte 3 = reading from channel 4
* For 16 bit readings
** Byte 0 = reading from channel 1 (low byte)
** Byte 1 = reading from channel 1 (high byte)
** Byte 2 = reading from channel 2 (low byte)
** Byte 3 = reading from channel 2 (high byte)
** Byte 4 = reading from channel 3 (low byte)
** Byte 5 = reading from channel 3 (high byte)
** Byte 6 = reading from channel 4 (low byte)
** Byte 7 = reading from channel 4 (high byte)
|}
== 42 ForcedADCRead ==
Force the A to D convertor to make a conversion and return the result
{|class="calltable"
|Send||
* Byte 0 = 42
* Byte 1 = channel number (1 to 4)
|-
|Returns||
* For an 8 bit reading:
** Byte 0 = reading from ADC
* For a 16 bit reading
** Byte 0 = reading from ADC (low byte)
** Byte 1 = reading from ADC (high byte)
|}
== 44 HighResADC ==
Sets the resolution of ADC readings to 16 bit
Subsequent readings will return 2 byte values
{|class="calltable"
|Send||
* Byte 0 = 44
|-
|Returns||
Nothing
|-
|Commments||
For OS 2 readings returned will be only accurate to 10 bits. OS 3,4 provides support for 16 bit readings, but only to an accuracy of 8 bits.
|}
== 45 LowResADC ==
Sets the resolution of ADC readings to 8 bit
Subsequent readings will return single byte values
{|class="calltable"
|Send||
* Byte 0 = 45
|-
|Returns||
Nothing
|}
== 47 ReadResolution ==
Reads the current ADC resolution setting
{|class="calltable"
|Send||
* Byte 0 = 47
|-
|Returns||
* Byte 0 = resolution setting, where:
*: 0 = 8 bit
*: 1 = 16 bit
|}
== 50 DownloadData (OS 2), DownloadData740 (OS 3), DownloadData375 (OS 4) ==
Download data into the SmartBox's memory
{|class="calltable"
|Send||
* Byte 0 = 50
* Byte 1 = start address to write (low byte)
* Byte 2 = start address to write (high byte)
* Byte 3 = length of data (low byte)
* Byte 4 = length of data (high byte)
* Bytes 5 - n = data
|-
|Returns||
Nothing
|}
== 52 UploadData (OS 2), UploadData740 (OS 3), UploadData (OS 4) ==
Upload data from the SmartBox's memory
{|class="calltable"
|Send||
* Byte 0 = 52
* Byte 1 = start address to read (low byte)
* Byte 2 = start address to read (high byte)
* Byte 3 = length of data (low byte)
* Byte 4 = length of data (high byte)
|-
|Returns||
* Byte 0 - n = data
|}
== 54 ExecuteCode (OS 2), ExecuteCode740 (OS 3), ExecuteCode375 (OS 4) ==
Execute machine code held at a specified address
{|class="calltable"
|Send||
* Byte 0 = 54
* Byte 1 = execution address (low byte)
* Byte 2 = execution address (high byte)
* Byte 3 = contents of the A register on entry to the code
* Byte 4 = contents of the X register on entry to the code
* Byte 5 = contents of the Y register on entry to the code
|-
|Returns||
Nothing
|}
== 55 StoreByte (OS 2), StoreByte740 (OS 3), StoreByte375 (OS 4) ==
Store a byte in the SmartBox's RAM
{|class="calltable"
|Send||
* Byte 0 = 55
* Byte 1 = address to write (low byte)
* Byte 2 = address to write (high byte)
* Byte 3 = byte to be stored
|-
|Returns||
Nothing
|}
== 56 ReadByte (OS 2), ReadByte740 (OS 3), ReadByte (OS 4) ==
Read a byte from the SmartBox's RAM
{|class="calltable"
|Send||
* Byte 0 = 56
* Byte 1 = address to read (low byte)
* Byte 2 = address to read (high byte)
|-
|Returns||
* Byte 0 = byte read
|}
== 57 ReadRAMSize ==
Read the amount of RAM with which the SmartBox is fitted
{|class="calltable"
|Send||
* Byte 0 = 57
|-
|Returns||
* Byte 0 = RAM size (low byte)
* Byte 1 = RAM size (high byte)
|-
|OS Release||
2,3
|}
== 59 ExtendCall ==
Call the extended call vector
{|class="calltable"
|Send||
* Byte 0 = 59
|-
|Returns||
* Byte 0 = extension value
|-
|Commments||
This call provides the user with the possibility of adding extra calls to SmartBox easily
|-
|OS Release||
2,3
|}
== 60 SetClock ==
Set the internal clock in SmartBox. This clock only runs while the power in maintained
{|class="calltable"
|Send||
* Byte 0 = 60
* Byte 1 = 1/10 seconds (0 to 9)
* Byte 2 = seconds (0 to 59)
* Byte 3 = minutes (0 to 59)
* Byte 4 = hours (0 to 23)
|-
|Returns||
Nothing
|-
|Commments||
The day value is set to 0
|}
== 61 ReadClock ==
Read the internal clock. On reset the clock will be set to zero
{|class="calltable"
|Send||
* Byte 0 = 61
|-
|Returns||
* Byte 0 = 1/10 seconds
* Byte 1 = seconds
* Byte 2 = minutes
* Byte 3 = hours
* Byte 4 = days
|}
== 62 ReadTopmem ==
Read the current value of TOPMEM
{|class="calltable"
|Send||
* Byte 0 = 62
|-
|Returns||
* Byte 0 = value of TOPMEM (low byte)
* Byte 1 = value of TOPMEM (high byte)
|-
|OS Release||
2,3
|}
== 63 WriteTopmem ==
Write the value of TOPMEM
{|class="calltable"
|Send||
* Byte 0 = 63
* Byte 1 = value of TOPMEM (low byte)
* Byte 2 = value of TOPMEM (high byte)
|-
|Returns||
Nothing
|-
|OS Release||
2,3
|}
== 64 ReadLomem ==
Read the current value of LOMEM
{|class="calltable"
|Send||
* Byte 0 = 64
|-
|Returns||
* Byte 0 = value of LOMEM (low byte)
* Byte 1 = value of LOMEM (high byte)
|-
|OS Release||
2,3
|}
== 65 WriteLomem ==
Write the value of LOMEM
{|class="calltable"
|Send||
* Byte 0 = 65
* Byte 1 = value of LOMEM (low byte)
* Byte 2 = value of LOMEM (high byte)
|-
|Returns||
Nothing
|-
|OS Release||
2,3
|}
== 66 ReadHimem ==
Read the current value of HIMEM


8 IdentSystem
{|class="calltable"
Read System Information
|Send||
Send Nothing
* Byte 0 = 66
Returns Byte 0 = table length
|-
Word = VIA
|Returns||
Word = ACIA
* Byte 0 = value of HIMEM (low byte)
Word = ADC
* Byte 1 = value of HIMEM (high byte)
Word = AUX.PORT
|-
Word = jobs.status
|OS Release||
Word = jobin.buf
2,3
Word = jobout.buf
|}
Byte = Processor ident
Word = OS version number
Byte = Hardware version number
String10 = Name, padded to 10 chars
Byte = Number of inputs
Byte = Number of outputs
Byte = Number of motors
Byte = Number of analogues
Byte = BBR support
Byte = Short support
Byte = Printer support
Byte = Keypad support
Byte = LCD x dim/support
Byte = LCD y dim
OS Release 3,4


9 Credits
== 67 WriteHimem ==
Returns the copyright string
Send Byte 0 = 9
Returns StringNUL = Copyright string
Comments This call returns the copyright message and OS details


Write the value of HIMEM


10 WriteMotors
{|class="calltable"
Writes a byte to the motor drivers
|Send||
Send Byte 0 = 10
* Byte 0 = 67
Byte 1 = value to write
* Byte 1 = value of HIMEM (low byte)
Returns Nothing
* Byte 2 = value of HIMEM (high byte)
Comments Each of the four motor outputs has two bits encoded into
|-
this value, bits 0 and 1 are for motor a, bytes 2 and 3 are
|Returns||
for motor b, bits 4 and 5 are for motor c and bits 6 and 7
Nothing
are for motor d, setting both bits to 0 will stop the
|-
motor, setting the low bit high and high bit low will make
|OS Release||
the motor go forward and setting the high bit high and the
2,3
low bit low will make it go backwards. Using this call
|}
automatically stops all pulsing of motors


11 ReadMotors
== 70 WritePrinter ==
Read the state of the motor drivers
Send Byte 0 = 11
Returns Byte 0 = value read from the motor drivers
Comments The value returned is the same value as what would be sent
to WriteMotors


12 MotorForward
Write printer port (no handshaking)
Switch a motor on
Send Byte 0 = 12
Byte 1 = motor number (1 to 4)
Returns Nothing
Comments This makes the appropiate motor go forward. Using this call
automatically cancels the pulsing for the appropiate motor


13 MotorReverse
{|class="calltable"
Switch a motor on with reverse polarity
|Send||
Send Byte 0 = 13
* Byte 0 = byte to write
Byte 1 = motor number (1 to 4)
|-
Returns Nothing
|Returns||
Comments This makes the appropiate motor go backward. Using this
Nothing
call automatically cancels the pulsing for the appropiate
|-
motor
|OS Release||
3
|}


14 MotorHalt
== 71 ReadPrinter ==
Switch a motor off
Send Byte 0 = 14
Byte 1 = motor number (1 to 4)
Returns Nothing
Comments This makes the appropiate motor stop. Using this call
automatically cancels the pulsing for the appropiate motor


15 MotorPower
Read printer port
Pulse a motor outputs to vary speed
Send Byte 0 = 15
Byte 1 = motor number (1 to 4)
Byte 2 = on time
Byte 3 = off time
Returns Nothing
Comments This pulses the appropiate motor at a rate determined by
the on/off time (in centiseconds) specified, alternating
the motor between the state at which it was last defined
(Forward or Reverse) and Halt


16 PatchMF
{|class="calltable"
Same as MotorForward
|Send||
OS Release 3,4
Nothing
|-
|Returns||
* Byte 0 = printer port value
|-
|OS Release||
3
|}


17 MotorVoltage
== 72 PrintChar ==
Set voltage for motor outputs
Send Byte 0 = voltage (0 to 3)
Returns Nothing
Notes Voltage values are 0 (0v), 1 (6v), 2 (9v), 3 (12v).
*Setting a voltage of 0 will also switch *outputs* to 0v*
Comments This sets the actual voltage supplied to the motor outputs
OS Release 4


Send a character to printer port


20 WriteOutputs
{|class="calltable"
Write a 8 bit value to the digital output port
|Send||
Send Byte 0 = 20
* Byte 0 = char
Byte 1 = byte to be written to the port
|-
Returns Nothing
|Returns||
Comments Using this call automatically cancels all pulsing on the
Nothing
output port
|-
|OS Release||
3
|}


21 OutputPower
== 73 PrintStreamZ ==
Vary the power by pulsing individual output lines
Send Byte 0 = 21
Byte 1 = bit number (0 to 7)
Byte 2 = on time
Byte 3 = off time
Comments This pulses the appropiate output line at a rate determined
by the on/off time (in centiseconds) specified, alternating
the output line between on and off


22 GetSensors
Send a stream of characters to the printer port
To read the type of sensors connected to the analogue
sensors
Send Byte 0 = 22
Returns Byte 1 = type of sensor connected to sensor A
Byte 2 = type of sensor connected to sensor B
Byte 3 = type of sensor connected to sensor C
Byte 4 = type of sensor connected to sensor D
Comments This returns the sensor types connected to the analogue
sensors that were returned from the last time they were
checked. A sensor type of 0 means no sensor


23 CheckSensors
{|class="calltable"
To check the type of sensors connected to the analogue
|Send||
sensors
* StringNUL = string to print
Send Byte 0 = 23
|-
Returns Byte 1 = type of sensor connected to sensor A
|Returns||
Byte 2 = type of sensor connected to sensor B
Nothing
Byte 3 = type of sensor connected to sensor C
|-
Byte 4 = type of sensor connected to sensor D
|OS Release||
Comments This does an immediate check of the sensor types connected
3
to the analogue sensors. A sensor type of 0 means no
|}
sensor


24 WriteSensorTable
== 74 PrintStream ==
Write sensor table entry
Notes * Not Implemented *
OS Release 3


25 ReadSensorTable
Send a stream of characters to the printer port
Read sensor table entry
Send Byte 0 = entry to read
Returns Byte 0 = sensor number
Byte 1 = number of decimal points to display
Byte 2 = max adc reading
Byte 3 = reading offset (LSB)
Byte 4 = reading offset (MSB)
Byte 5 = multiplication factor (LSB)
Byte 6 = multiplication factor (MSB)
Byte 7 = division factor (LSB)
Byte 8 = division factor (LSB)
String = full sensor title
String = abbreviated sensor label
String = sensor label
String = sensor units
Notes If byte 0 is &FF then sensor is unknown
OS Release 3,4


28 SetBitHigh
{|class="calltable"
Set individual output line(s) high
|Send||
Send Byte 0 = 28
* Byte 0 = number of bytes to send (LSB)
Byte 1 = byte determining which lines will be set
* Byte 1 = number of bytes to send (MSB)
Returns Nothing
* Bytes = stream of characters to print
Comments A bit set in the byte sent will set the corresponding
|-
output line high
|Returns||
Nothing
|-
|OS Release||
3
|}


29 SetBitLow
== 75 PrintServer ==
Set individual output line(s) low
Send Byte 0 = 29
Byte 1 = byte determining which lines will be unset
Returns Nothing
Comments A bit set in the byte sent will set the corresponding
output line low


Echo all characters to printer port


30 ReadADCReg
{|class="calltable"
To read a ADC register
|Notes||
Send Byte 0 = 30
No exit
Byte 1 = register number (0 to 15)
|-
Returns Byte 0 = value of register
|OS Release||
OS Release 2
3


31 WriteADCReg
|}
To write to a ADC register
Send Byte 0 = 31
Byte 1 = register number (0 to 15)
Byte 2 = value to write
Returns Nothing
OS Release 2


32 ReadACIAReg
== 80 WriteRTCReg ==
To read a ACIA register
Send Byte 0 = 32
Byte 1 = register number (0 to 15)
Returns Byte 0 = value of register
OS Release 2


33 WriteACIAReg
Write a RTC register
To write to a ACIA register
Send Byte 0 = 33
Byte 1 = register number (0 to 15)
Byte 2 = value to write
Returns Nothing
OS Release 2


34 ReadVIAReg
{|class="calltable"
To read a VIA register
|Send||
Send Byte 0 = 34
* Byte 0 = register
Byte 1 = register number (0 to 15)
* Byte 1 = value
Returns Byte 0 = value of register
|-
OS Release 2
|Returns||
Nothing
|-
|OS Release||
3
|}


35 WriteVIAReg
== 81 ReadRTCReg ==
To write to a VIA register
Send Byte 0 = 35
Byte 1 = register number (0 to 15)
Byte 2 = value to write
Returns Nothing
OS Release 2


36 SetVIAHigh
Read a RTC register
To set bits in a VIA register
Send Byte 0 = 36
Byte 1 = register number (0 to 15)
Byte 2 = mask
Returns Nothing
OS Release 2


37 SetVIALow
{|class="calltable"
To unset bits in a VIA register
|Send||
Send Byte 0 = 37
* Byte 0 = register
Byte 1 = register number (0 to 15)
|-
Byte 2 = mask
|Returns||
Returns Nothing
* Byte 0 = value
OS Release 2
|-
|OS Release||
3
|}


== 82 WriteRTC ==


40 ReadADC
Writes RTC as a string
Take a reading from a specific ADC channel
Send Byte 0 = 40
Byte 1 = channel number (1 to 4)
Returns For an 8 bit reading:
Byte 0 = reading from ADC
For a 16 bit reading:
Byte 0 = low byte of reading
Byte 1 = high byte of reading
Comments The value returned will be at the resolution specified by
OS calls HighResADC and LowResADC


41 ReadADCs
{|class="calltable"
Read all the ADC channels
|Send||
Send Byte 0 = 41
* StringCR = RTC time
Returns For 8 bit readings:
|-
Byte 0 = reading from channel 1
|Returns||
Byte 1 = reading from channel 2
Nothing
Byte 2 = reading from channel 3
|-
Byte 3 = reading from channel 4
|Notes||
For 16 bit readings
''Not currently implemented''<br />
Byte 0 = reading from channel 1 (low byte)
Time is represented as DDD,dd mmm yyyy.hh:mm:ss
Byte 1 = reading from channel 1 (high byte)
* DDD is 3 character day (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
Byte 2 = reading from channel 2 (low byte)
* dd is day of month
Byte 3 = reading from channel 2 (high byte)
* mmm is month
Byte 4 = reading from channel 3 (low byte)
* yyyy is year
Byte 5 = reading from channel 3 (high byte)
* hh is hours
Byte 6 = reading from channel 4 (low byte)
* mm is minutes
Byte 7 = reading from channel 4 (high byte)
* ss is seconds
|-
|OS Release||
3
|}


42 ForcedADCRead
== 83 ReadRTC ==
Force the A to D convertor to make a conversion and return
the result
Send Byte 0 = 42
Byte 1 = channel number (1 to 4)
Returns For an 8 bit reading:
Byte 0 = reading from ADC
For a 16 bit reading
Byte 0 = reading from ADC (low byte)
Byte 1 = reading from ADC (high byte)


44 HighResADC
Reads RTC as a string
Sets the resolution of ADC readings to 16 bit
Subsequent readings will return 2 byte values
Send Byte 0 = 44
Returns Nothing
Comments For OS 2 readings returned will be only accurate to
10 bits. OS 3,4 provides support for 16 bit readings,
but only to an accuracy of 8 bits.


45 LowResADC
{|class="calltable"
Sets the resolution of ADC readings to 8 bit
|Send||
Subsequent readings will return single byte values
Nothing
Send Byte 0 = 45
|-
Returns Nothing
|Returns||
* StringCR = RTC time
|-
|Notes||
Time is represented as DDD,dd mmm yyyy.hh:mm:ss
* DDD is 3 character day (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
* dd is day of month
* mmm is month
* yyyy is year
* hh is hours
* mm is minutes
* ss is seconds
|-
|OS Release||
3
|}


47 ReadResolution
== 84 WriteRTCbcd ==
Reads the current ADC resolution setting
Send Byte 0 = 47
Returns Byte 0 = resolution setting, where:
0 = 8 bit
1 = 16 bit


Writes all 7 RTC time registers


50 DownloadData (OS 2), DownloadData740 (OS 3),
{|class="calltable"
DownloadData375 (OS 4)
|Send||
Download data into the SmartBox's memory
* Byte 0 = seconds
Send Byte 0 = 50
* Byte 1 = minutes
Byte 1 = start address to write (low byte)
* Byte 2 = hours
Byte 2 = start address to write (high byte)
* Byte 3 = date
Byte 3 = length of data (low byte)
* Byte 4 = month
Byte 4 = length of data (high byte)
* Byte 5 = day
Bytes 5 - n = data
* Byte 6 = year
Returns Nothing
|-
|Returns||
Nothing
|-
|Notes||
All values are represented in BCD
* Years below 80 (&80 in BCD) signify 20xx
* Day starts (0) from Monday
|-
|OS Release||
3
|}


52 UploadData (OS 2), UploadData740 (OS 3),
== 85 ReadRTCbcd ==
UploadData (OS 4)
Upload data from the SmartBox's memory
Send Byte 0 = 52
Byte 1 = start address to read (low byte)
Byte 2 = start address to read (high byte)
Byte 3 = length of data (low byte)
Byte 4 = length of data (high byte)
Returns Byte 0 - n = data


54 ExecuteCode (OS 2), ExecuteCode740 (OS 3),
Reads all 7 RTC time registers
ExecuteCode375 (OS 4)
Execute machine code held at a specified address
Send Byte 0 = 54
Byte 1 = execution address (low byte)
Byte 2 = execution address (high byte)
Byte 3 = contents of the A register on entry to the code
Byte 4 = contents of the X register on entry to the code
Byte 5 = contents of the Y register on entry to the code
Returns Nothing


55 StoreByte (OS 2), StoreByte740 (OS 3),
{|class="calltable"
StoreByte375 (OS 4)
|Send||
Store a byte in the SmartBox's RAM
Nothing
Send Byte 0 = 55
|-
Byte 1 = address to write (low byte)
|Returns||
Byte 2 = address to write (high byte)
* Byte 0 = seconds
Byte 3 = byte to be stored
* Byte 1 = minutes
Returns Nothing
* Byte 2 = hours
* Byte 3 = date
* Byte 4 = month
* Byte 5 = day
* Byte 6 = year
|-
|Notes||
All values are represented in BCD
* Years below 80 (&80 in BCD) signify 20xx
* Day starts (0) from Monday
|-
|OS Release||
3
|}


56 ReadByte (OS 2), ReadByte740 (OS 3),
== 90 ReadInputs ==
ReadByte (OS 4)
Read a byte from the SmartBox's RAM
Send Byte 0 = 56
Byte 1 = address to read (low byte)
Byte 2 = address to read (high byte)
Returns Byte 0 = byte read


57 ReadRAMSize
Reads a byte from the digital inputs port
Read the amount of RAM with which the SmartBox is fitted
Send Byte 0 = 57
Returns Byte 0 = RAM size (low byte)
Byte 1 = RAM size (high byte)
OS Release 2,3


59 ExtendCall
{|class="calltable"
Call the extended call vector
|Send||
Send Byte 0 = 59
* Byte 0 = 90
Returns Byte 0 = extension value
|-
Comments This call provides the user with the possibility of adding
|Returns||
extra calls to SmartBox easily
* Byte 0 = byte read from the digital inputs port
OS Release 2,3
|}


== 91 ReadBit ==


60 SetClock
Reads a bit from the digital inputs port
Set the internal clock in SmartBox. This clock only runs
while the power in maintained
Send Byte 0 = 60
Byte 1 = 1/10 seconds (0 to 9)
Byte 2 = seconds (0 to 59)
Byte 3 = minutes (0 to 59)
Byte 4 = hours (0 to 23)
Returns Nothing
Comments The day value is set to 0


61 ReadClock
{|class="calltable"
Read the internal clock. On reset the clock will be set to
|Send||
zero
* Byte 0 = 91
Send Byte 0 = 61
* Byte 1 = byte to read (0 to 7)
Returns Byte 0 = 1/10 seconds
|-
Byte 1 = seconds
|Returns||
Byte 2 = minutes
* Byte 0 = bit read from the digital inputs port
Byte 3 = hours
|-
Byte 4 = days
|Commments||
Reads an individual sensor from the digital inputs port
|}


62 ReadTopmem
== 92 ReadOutputs ==
Read the current value of TOPMEM
Send Byte 0 = 62
Returns Byte 0 = value of TOPMEM (low byte)
Byte 1 = value of TOPMEM (high byte)
OS Release 2,3


63 WriteTopmem
Reads a byte from the digital outputs port
Write the value of TOPMEM
Send Byte 0 = 63
Byte 1 = value of TOPMEM (low byte)
Byte 2 = value of TOPMEM (high byte)
Returns Nothing
OS Release 2,3


64 ReadLomem
{|class="calltable"
Read the current value of LOMEM
|Send||
Send Byte 0 = 64
* Byte 0 = 92
Returns Byte 0 = value of LOMEM (low byte)
|-
Byte 1 = value of LOMEM (high byte)
|Returns||
OS Release 2,3
* Byte 0 = byte read from the digital outputs port
|-
|Notes||
This reads the soft copy of the last written byte
|-
|OS Release||
3,4
|}


65 WriteLomem
== 93 CountReset ==
Write the value of LOMEM
Send Byte 0 = 65
Byte 1 = value of LOMEM (low byte)
Byte 2 = value of LOMEM (high byte)
Returns Nothing
OS Release 2,3


66 ReadHimem
Resets input port counter(s)
Read the current value of HIMEM
Send Byte 0 = 66
Returns Byte 0 = value of HIMEM (low byte)
Byte 1 = value of HIMEM (high byte)
OS Release 2,3


67 WriteHimem
{|class="calltable"
Write the value of HIMEM
|Send||
Send Byte 0 = 67
* Byte 0 = 93
Byte 1 = value of HIMEM (low byte)
* Byte 1 = bit masks for counters to reset
Byte 2 = value of HIMEM (high byte)
|-
Returns Nothing
|OS Release||
OS Release 2,3
4
|}


== 94 CountRead ==


70 WritePrinter
Reads input port counter(s)
Write printer port (no handshaking)
Send Byte 0 = byte to write
Returns Nothing
OS Release 3


71 ReadPrinter
{|class="calltable"
Read printer port
|Send||
Send Nothing
* Byte 0 = 94
Returns Byte 0 = printer port value
* Byte 1 = counter to read (0 to 7) or 255 for all
OS Release 3
|-
|Returns||
* Byte 0 = value of counter (LSB)
* Byte 1 = value of counter (MSB)
* Byte n = value of counter (LSB)
* Byte n+1 = value of counter (MSB)
|-
|Notes||
Counter values return 65535 (-1) from box reset, or max count
|-
|OS Release||
4
|}


72 PrintChar
== 98 InsightDriver ==
Send a character to printer port
Send Byte 0 = char
Returns Nothing
OS Release 3


73 PrintStreamZ
Starts the internal Insight software
Send a stream of characters to the printer port
Send StringNUL = string to print
Returns Nothing
OS Release 3


74 PrintStream
{|class="calltable"
Send a stream of characters to the printer port
|OS Release||
Send Byte 0 = number of bytes to send (LSB)
3
Byte 1 = number of bytes to send (MSB)
|}
Bytes = stream of characters to print
Returns Nothing
OS Release 3


75 PrintServer
== 99 DataApp ==
Echo all characters to printer port
Notes No exit
OS Release 3


Starts the internal DataApp software


80 WriteRTCReg
{|class="calltable"
Write a RTC register
|OS Release||
Send Byte 0 = register
3
Byte 1 = value
|}
Returns Nothing
OS Release 3


81 ReadRTCReg
== 100 WriteLCDReg ==
Read a RTC register
Send Byte 0 = register
Returns Byte 0 = value
OS Release 3


82 WriteRTC
Write LCD Register
Writes RTC as a string
Send StringCR = RTC time
Returns Nothing
Notes * Not currently implemented *
Time is represented as DDD,dd mmm yyyy.hh:mm:ss
DDD is 3 character day (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
dd is day of month
mmm is month
yyyy is year
hh is hours
mm is minutes
ss is seconds
OS Release 3


83 ReadRTC
{|class="calltable"
Reads RTC as a string
|Send||
Send Nothing
* Byte 0 = register number
Returns StringCR = RTC time
* Byte 1 = register value
Notes Time is represented as DDD,dd mmm yyyy.hh:mm:ss
|-
DDD is 3 character day (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
|Returns||
dd is day of month
Nothing
mmm is month
|-
yyyy is year
|OS Release||
hh is hours
3
mm is minutes
|}
ss is seconds
OS Release 3


84 WriteRTCbcd
== 101 ReadLCDReg ==
Writes all 7 RTC time registers
Send Byte 0 = seconds
Byte 1 = minutes
Byte 2 = hours
Byte 3 = date
Byte 4 = month
Byte 5 = day
Byte 6 = year
Returns Nothing
Notes All values are represented in BCD
Years below 80 (&80 in BCD) signify 20xx
Day starts (0) from Monday
OS Release 3


85 ReadRTCbcd
Read LCD Register
Reads all 7 RTC time registers
Send Nothing
Returns Byte 0 = seconds
Byte 1 = minutes
Byte 2 = hours
Byte 3 = date
Byte 4 = month
Byte 5 = day
Byte 6 = year
Notes All values are represented in BCD
Years below 80 (&80 in BCD) signify 20xx
Day starts (0) from Monday
OS Release 3


{|class="calltable"
|Send||
* Byte 0 = register number
|-
|Returns||
* Byte 0 = register value
|-
|OS Release||
3
|}


90 ReadInputs
== 102 LCDChar ==
Reads a byte from the digital inputs port
Send Byte 0 = 90
Returns Byte 0 = byte read from the digital inputs port


91 ReadBit
Send a character to the LCD display driver
Reads a bit from the digital inputs port
Send Byte 0 = 91
Byte 1 = byte to read (0 to 7)
Returns Byte 0 = bit read from the digital inputs port
Comments Reads an individual sensor from the digital inputs port


92 ReadOutputs
{|class="calltable"
Reads a byte from the digital outputs port
|Send||
Send Byte 0 = 92
* Byte 0 = char
Returns Byte 0 = byte read from the digital outputs port
|-
Notes This reads the soft copy of the last written byte
|Returns||
OS Release 3,4
Nothing
|-
|OS Release||
3
|}


93 CountReset
== 103 LCDStreamZ ==
Resets input port counter(s)
Send Byte 0 = 93
Byte 1 = bit masks for counters to reset
OS Release 4


94 CountRead
Send a stream of characters to the LCD display driver
Reads input port counter(s)
Send Byte 0 = 94
Byte 1 = counter to read (0 to 7) or 255 for all
Returns Byte 0 = value of counter (LSB)
Byte 1 = value of counter (MSB)
Byte n = value of counter (LSB)
Byte n+1 = value of counter (MSB)
Notes Counter values return 65535 (-1) from box reset, or max count
OS Release 4


98 InsightDriver
{|class="calltable"
Starts the internal Insight software
|Send||
OS Release 3
* StringNUL = string to display
|-
|Returns||
Nothing
|-
|OS Release||
3
|}


99 DataApp
== 104 LCDStream ==
Starts the internal DataApp software
OS Release 3


Send a stream of characters to the LCD display driver


100 WriteLCDReg
{|class="calltable"
Write LCD Register
|Send||
Send Byte 0 = register number
* Byte 0 = number of bytes to send (LSB)
Byte 1 = register value
* Byte 1 = number of bytes to send (MSB)
Returns Nothing
* Bytes = stream of characters to display
OS Release 3
|-
|Returns||
Nothing
|-
|OS Release||
3


101 ReadLCDReg
|}
Read LCD Register
Send Byte 0 = register number
Returns Byte 0 = register value
OS Release 3


102 LCDChar
== 110 ReadKeypad ==
Send a character to the LCD display driver
Send Byte 0 = char
Returns Nothing
OS Release 3


103 LCDStreamZ
Reads the raw state of the keypad
Send a stream of characters to the LCD display driver
Send StringNUL = string to display
Returns Nothing
OS Release 3


104 LCDStream
{|class="calltable"
Send a stream of characters to the LCD display driver
|Send||
Send Byte 0 = number of bytes to send (LSB)
Nothing
Byte 1 = number of bytes to send (MSB)
|-
Bytes = stream of characters to display
|Returns||
Returns Nothing
* Byte 0 = current keypad reading bitstate
OS Release 3
|-
|OS Release||
3
|}


== 111 ReadKeypadPress ==


110 ReadKeypad
Reads the processed state of the keypad
Reads the raw state of the keypad
Send Nothing
Returns Byte 0 = current keypad reading bitstate
OS Release 3


111 ReadKeypadPress
{|class="calltable"
Reads the processed state of the keypad
|Send||
Send Nothing
Nothing
Returns Byte 0 = current keypad press bitstate
|-
OS Release 3</nowiki>
|Returns||
* Byte 0 = current keypad press bitstate
|-
|OS Release||
3
|}

Latest revision as of 23:52, 11 November 2023

OS 4 - 14.02.00

0 Blank[edit]

Does nothing

Send
  • Byte 0 = 0
Returns

Nothing

1 Version[edit]

Read the operating system version number

Send
  • Byte 0 = 1
Returns
  • Byte 0 = version number - low byte
  • Byte 1 = version number - high byte
Commments

Divide by 1000 to get the version number, eg. version 1.023 would be returned as 1023

2 Reset[edit]

Reset Smart Box

Send
  • Byte 0 = 2
  • Byte 1 = 254 or 255
Returns

Nothing

Commments

Reset SmartBox from the host micro. Sending a 254 performs a soft reset (same as pressing reset), sending 255 does a reset (clears battery back RAM). Before sending codes create a small delay while SmartBox resets various parts of hardware

3 NameCode[edit]

To obtain the operating system call number where the name is known

Send
  • Byte 0 = 3
  • Byte 1 - n = ASCII characters of OS call name
  • Byte n+1 = 13
Returns
  • Byte 0 = Operating system call number

4 CodeName[edit]

To obtain the name associated with an operating system call

Send
  • Byte 0 = 4
  • Byte 1 = OS call number
Returns
  • StringCR = OS call name

5 MultipleSetup[edit]

To set the values that will be returned by MultipleRead

Send
  • Byte 0 = 5
  • Byte 1 = Analogue channel 1
  • Byte 2 = Analogue channel 2
  • Byte 3 = Analogue channel 3
  • Byte 4 = Analogue channel 4
  • Byte 5 = Digitial inputs
  • Byte 6 = Digital outputs
  • Byte 7 = Motor outputs
Returns

Nothing

Commments

This sets up the readings which will be returned when the call MultipleRead is made. If a byte = 1 the corresponding port will be returned, 0 = value not returned

6 MultipleRead[edit]

Returns multiple readings as defined using MultipleSetup

Send
  • Byte 0 = 6
Returns
  • Bytes as defined by MultipleSetup
Commments

This call returns readings from a number of ports as defined by MultipleSetup

7 MultipleServer[edit]

Constantly returns multiple readings as defined using MultipleSetup

Send
  • Byte 0 = 7
Returns
  • Bytes as defined by MultipleSetup
Commments

This call is similar to MultipleRead but continues to return readings until SmartBox receives the byte 123

8 IdentSystem[edit]

Read System Information

Send

Nothing

Returns
  • Byte 0 = table length
  • Word = VIA
  • Word = ACIA
  • Word = ADC
  • Word = AUX.PORT
  • Word = jobs.status
  • Word = jobin.buf
  • Word = jobout.buf
  • Byte = Processor ident
  • Word = OS version number
  • Byte = Hardware version number
  • String10 = Name, padded to 10 chars
  • Byte = Number of inputs
  • Byte = Number of outputs
  • Byte = Number of motors
  • Byte = Number of analogues
  • Byte = BBR support
  • Byte = Short support
  • Byte = Printer support
  • Byte = Keypad support
  • Byte = LCD x dim/support
  • Byte = LCD y dim
OS Release

3,4

9 Credits[edit]

Returns the copyright string

Send
  • Byte 0 = 9
Returns
  • StringNUL = Copyright string
Commments

This call returns the copyright message and OS details

10 WriteMotors[edit]

Writes a byte to the motor drivers

Send
  • Byte 0 = 10
  • Byte 1 = value to write
Returns

Nothing

Commments

Each of the four motor outputs has two bits encoded into this value, bits 0 and 1 are for motor a, bytes 2 and 3 are for motor b, bits 4 and 5 are for motor c and bits 6 and 7 are for motor d, setting both bits to 0 will stop the motor, setting the low bit high and high bit low will make the motor go forward and setting the high bit high and the low bit low will make it go backwards. Using this call automatically stops all pulsing of motors

11 ReadMotors[edit]

Read the state of the motor drivers

Send
  • Byte 0 = 11
Returns
  • Byte 0 = value read from the motor drivers
Commments

The value returned is the same value as what would be sent to WriteMotors

12 MotorForward[edit]

Switch a motor on

Send
  • Byte 0 = 12
  • Byte 1 = motor number (1 to 4)
Returns

Nothing

Commments

This makes the appropriate motor go forward. Using this call automatically cancels the pulsing for the appropriate motor

13 MotorReverse[edit]

Switch a motor on with reverse polarity

Send
  • Byte 0 = 13
  • Byte 1 = motor number (1 to 4)
Returns

Nothing

Commments

This makes the appropriate motor go backward. Using this call automatically cancels the pulsing for the appropriate motor

14 MotorHalt[edit]

Switch a motor off

Send
  • Byte 0 = 14
  • Byte 1 = motor number (1 to 4)
Returns

Nothing

Commments

This makes the appropriate motor stop. Using this call automatically cancels the pulsing for the appropriate motor

15 MotorPower[edit]

Pulse a motor outputs to vary speed

Send
  • Byte 0 = 15
  • Byte 1 = motor number (1 to 4)
  • Byte 2 = on time
  • Byte 3 = off time
Returns

Nothing

Commments

This pulses the appropriate motor at a rate determined by the on/off time (in centiseconds) specified, alternating the motor between the state at which it was last defined (Forward or Reverse) and Halt

16 PatchMF[edit]

Same as MotorForward

OS Release

3,4

17 MotorVoltage[edit]

Set voltage for motor outputs

Send
  • Byte 0 = voltage (0 to 3)
Returns

Nothing

Notes

Voltage values are 0 (0v), 1 (6v), 2 (9v), 3 (12v).
Setting a voltage of 0 will also switch outputs to 0v

Commments

This sets the actual voltage supplied to the motor outputs

OS Release

4

20 WriteOutputs[edit]

Write a 8 bit value to the digital output port

Send
  • Byte 0 = 20
  • Byte 1 = byte to be written to the port
Returns

Nothing

Commments

Using this call automatically cancels all pulsing on the output port

21 OutputPower[edit]

Vary the power by pulsing individual output lines

Send
  • Byte 0 = 21
  • Byte 1 = bit number (0 to 7)
  • Byte 2 = on time
  • Byte 3 = off time
Commments

This pulses the appropriate output line at a rate determined by the on/off time (in centiseconds) specified, alternating the output line between on and off

22 GetSensors[edit]

To read the type of sensors connected to the analogue sensors

Send
  • Byte 0 = 22
Returns
  • Byte 1 = type of sensor connected to sensor A
  • Byte 2 = type of sensor connected to sensor B
  • Byte 3 = type of sensor connected to sensor C
  • Byte 4 = type of sensor connected to sensor D
Commments

This returns the sensor types connected to the analogue sensors that were returned from the last time they were checked. A sensor type of 0 means no sensor

23 CheckSensors[edit]

To check the type of sensors connected to the analogue sensors

Send
  • Byte 0 = 23
Returns
  • Byte 1 = type of sensor connected to sensor A
  • Byte 2 = type of sensor connected to sensor B
  • Byte 3 = type of sensor connected to sensor C
  • Byte 4 = type of sensor connected to sensor D
Commments

This does an immediate check of the sensor types connected to the analogue sensors. A sensor type of 0 means no sensor

24 WriteSensorTable[edit]

Write sensor table entry

Notes

Not Implemented

OS Release

3

25 ReadSensorTable[edit]

Read sensor table entry

Send
  • Byte 0 = entry to read
Returns
  • Byte 0 = sensor number
  • Byte 1 = number of decimal points to display
  • Byte 2 = max adc reading
  • Byte 3 = reading offset (LSB)
  • Byte 4 = reading offset (MSB)
  • Byte 5 = multiplication factor (LSB)
  • Byte 6 = multiplication factor (MSB)
  • Byte 7 = division factor (LSB)
  • Byte 8 = division factor (LSB)
  • String = full sensor title
  • String = abbreviated sensor label
  • String = sensor label
  • String = sensor units
Notes

If byte 0 is &FF then sensor is unknown

OS Release

3,4

28 SetBitHigh[edit]

Set individual output line(s) high

Send
  • Byte 0 = 28
  • Byte 1 = byte determining which lines will be set
Returns

Nothing

Commments

A bit set in the byte sent will set the corresponding output line high

29 SetBitLow[edit]

Set individual output line(s) low

Send
  • Byte 0 = 29
  • Byte 1 = byte determining which lines will be unset
Returns

Nothing

Commments

A bit set in the byte sent will set the corresponding output line low

30 ReadADCReg[edit]

To read a ADC register

Send
  • Byte 0 = 30
  • Byte 1 = register number (0 to 15)
Returns
  • Byte 0 = value of register
OS Release

2

31 WriteADCReg[edit]

To write to a ADC register

Send
  • Byte 0 = 31
  • Byte 1 = register number (0 to 15)
  • Byte 2 = value to write
Returns

Nothing

OS Release

2

32 ReadACIAReg[edit]

To read a ACIA register

Send
  • Byte 0 = 32
  • Byte 1 = register number (0 to 15)
Returns
  • Byte 0 = value of register
OS Release

2

33 WriteACIAReg[edit]

To write to a ACIA register

Send
  • Byte 0 = 33
  • Byte 1 = register number (0 to 15)
  • Byte 2 = value to write
Returns

Nothing

OS Release

2

34 ReadVIAReg[edit]

To read a VIA register

Send
  • Byte 0 = 34
  • Byte 1 = register number (0 to 15)
Returns
  • Byte 0 = value of register
OS Release

2

35 WriteVIAReg[edit]

To write to a VIA register

Send
  • Byte 0 = 35
  • Byte 1 = register number (0 to 15)
  • Byte 2 = value to write
Returns

Nothing

OS Release

2

36 SetVIAHigh[edit]

To set bits in a VIA register

Send
  • Byte 0 = 36
  • Byte 1 = register number (0 to 15)
  • Byte 2 = mask
Returns

Nothing

OS Release

2

37 SetVIALow[edit]

To unset bits in a VIA register

Send
  • Byte 0 = 37
  • Byte 1 = register number (0 to 15)
  • Byte 2 = mask
Returns

Nothing

OS Release

2

40 ReadADC[edit]

Take a reading from a specific ADC channel

Send
  • Byte 0 = 40
  • Byte 1 = channel number (1 to 4)
Returns
  • For an 8 bit reading:
    • Byte 0 = reading from ADC
  • For a 16 bit reading:
    • Byte 0 = low byte of reading
    • Byte 1 = high byte of reading
Commments

The value returned will be at the resolution specified by OS calls HighResADC and LowResADC

41 ReadADCs[edit]

Read all the ADC channels

Send
  • Byte 0 = 41
Returns
  • For 8 bit readings:
    • Byte 0 = reading from channel 1
    • Byte 1 = reading from channel 2
    • Byte 2 = reading from channel 3
    • Byte 3 = reading from channel 4
  • For 16 bit readings
    • Byte 0 = reading from channel 1 (low byte)
    • Byte 1 = reading from channel 1 (high byte)
    • Byte 2 = reading from channel 2 (low byte)
    • Byte 3 = reading from channel 2 (high byte)
    • Byte 4 = reading from channel 3 (low byte)
    • Byte 5 = reading from channel 3 (high byte)
    • Byte 6 = reading from channel 4 (low byte)
    • Byte 7 = reading from channel 4 (high byte)

42 ForcedADCRead[edit]

Force the A to D convertor to make a conversion and return the result

Send
  • Byte 0 = 42
  • Byte 1 = channel number (1 to 4)
Returns
  • For an 8 bit reading:
    • Byte 0 = reading from ADC
  • For a 16 bit reading
    • Byte 0 = reading from ADC (low byte)
    • Byte 1 = reading from ADC (high byte)

44 HighResADC[edit]

Sets the resolution of ADC readings to 16 bit Subsequent readings will return 2 byte values

Send
  • Byte 0 = 44
Returns

Nothing

Commments

For OS 2 readings returned will be only accurate to 10 bits. OS 3,4 provides support for 16 bit readings, but only to an accuracy of 8 bits.

45 LowResADC[edit]

Sets the resolution of ADC readings to 8 bit Subsequent readings will return single byte values

Send
  • Byte 0 = 45
Returns

Nothing

47 ReadResolution[edit]

Reads the current ADC resolution setting

Send
  • Byte 0 = 47
Returns
  • Byte 0 = resolution setting, where:
    0 = 8 bit
    1 = 16 bit

50 DownloadData (OS 2), DownloadData740 (OS 3), DownloadData375 (OS 4)[edit]

Download data into the SmartBox's memory

Send
  • Byte 0 = 50
  • Byte 1 = start address to write (low byte)
  • Byte 2 = start address to write (high byte)
  • Byte 3 = length of data (low byte)
  • Byte 4 = length of data (high byte)
  • Bytes 5 - n = data
Returns

Nothing

52 UploadData (OS 2), UploadData740 (OS 3), UploadData (OS 4)[edit]

Upload data from the SmartBox's memory

Send
  • Byte 0 = 52
  • Byte 1 = start address to read (low byte)
  • Byte 2 = start address to read (high byte)
  • Byte 3 = length of data (low byte)
  • Byte 4 = length of data (high byte)
Returns
  • Byte 0 - n = data

54 ExecuteCode (OS 2), ExecuteCode740 (OS 3), ExecuteCode375 (OS 4)[edit]

Execute machine code held at a specified address

Send
  • Byte 0 = 54
  • Byte 1 = execution address (low byte)
  • Byte 2 = execution address (high byte)
  • Byte 3 = contents of the A register on entry to the code
  • Byte 4 = contents of the X register on entry to the code
  • Byte 5 = contents of the Y register on entry to the code
Returns

Nothing

55 StoreByte (OS 2), StoreByte740 (OS 3), StoreByte375 (OS 4)[edit]

Store a byte in the SmartBox's RAM

Send
  • Byte 0 = 55
  • Byte 1 = address to write (low byte)
  • Byte 2 = address to write (high byte)
  • Byte 3 = byte to be stored
Returns

Nothing

56 ReadByte (OS 2), ReadByte740 (OS 3), ReadByte (OS 4)[edit]

Read a byte from the SmartBox's RAM

Send
  • Byte 0 = 56
  • Byte 1 = address to read (low byte)
  • Byte 2 = address to read (high byte)
Returns
  • Byte 0 = byte read

57 ReadRAMSize[edit]

Read the amount of RAM with which the SmartBox is fitted

Send
  • Byte 0 = 57
Returns
  • Byte 0 = RAM size (low byte)
  • Byte 1 = RAM size (high byte)
OS Release

2,3

59 ExtendCall[edit]

Call the extended call vector

Send
  • Byte 0 = 59
Returns
  • Byte 0 = extension value
Commments

This call provides the user with the possibility of adding extra calls to SmartBox easily

OS Release

2,3

60 SetClock[edit]

Set the internal clock in SmartBox. This clock only runs while the power in maintained

Send
  • Byte 0 = 60
  • Byte 1 = 1/10 seconds (0 to 9)
  • Byte 2 = seconds (0 to 59)
  • Byte 3 = minutes (0 to 59)
  • Byte 4 = hours (0 to 23)
Returns

Nothing

Commments

The day value is set to 0

61 ReadClock[edit]

Read the internal clock. On reset the clock will be set to zero

Send
  • Byte 0 = 61
Returns
  • Byte 0 = 1/10 seconds
  • Byte 1 = seconds
  • Byte 2 = minutes
  • Byte 3 = hours
  • Byte 4 = days

62 ReadTopmem[edit]

Read the current value of TOPMEM

Send
  • Byte 0 = 62
Returns
  • Byte 0 = value of TOPMEM (low byte)
  • Byte 1 = value of TOPMEM (high byte)
OS Release

2,3

63 WriteTopmem[edit]

Write the value of TOPMEM

Send
  • Byte 0 = 63
  • Byte 1 = value of TOPMEM (low byte)
  • Byte 2 = value of TOPMEM (high byte)
Returns

Nothing

OS Release

2,3

64 ReadLomem[edit]

Read the current value of LOMEM

Send
  • Byte 0 = 64
Returns
  • Byte 0 = value of LOMEM (low byte)
  • Byte 1 = value of LOMEM (high byte)
OS Release

2,3

65 WriteLomem[edit]

Write the value of LOMEM

Send
  • Byte 0 = 65
  • Byte 1 = value of LOMEM (low byte)
  • Byte 2 = value of LOMEM (high byte)
Returns

Nothing

OS Release

2,3

66 ReadHimem[edit]

Read the current value of HIMEM

Send
  • Byte 0 = 66
Returns
  • Byte 0 = value of HIMEM (low byte)
  • Byte 1 = value of HIMEM (high byte)
OS Release

2,3

67 WriteHimem[edit]

Write the value of HIMEM

Send
  • Byte 0 = 67
  • Byte 1 = value of HIMEM (low byte)
  • Byte 2 = value of HIMEM (high byte)
Returns

Nothing

OS Release

2,3

70 WritePrinter[edit]

Write printer port (no handshaking)

Send
  • Byte 0 = byte to write
Returns

Nothing

OS Release

3

71 ReadPrinter[edit]

Read printer port

Send

Nothing

Returns
  • Byte 0 = printer port value
OS Release

3

72 PrintChar[edit]

Send a character to printer port

Send
  • Byte 0 = char
Returns

Nothing

OS Release

3

73 PrintStreamZ[edit]

Send a stream of characters to the printer port

Send
  • StringNUL = string to print
Returns

Nothing

OS Release

3

74 PrintStream[edit]

Send a stream of characters to the printer port

Send
  • Byte 0 = number of bytes to send (LSB)
  • Byte 1 = number of bytes to send (MSB)
  • Bytes = stream of characters to print
Returns

Nothing

OS Release

3

75 PrintServer[edit]

Echo all characters to printer port

Notes

No exit

OS Release

3

80 WriteRTCReg[edit]

Write a RTC register

Send
  • Byte 0 = register
  • Byte 1 = value
Returns

Nothing

OS Release

3

81 ReadRTCReg[edit]

Read a RTC register

Send
  • Byte 0 = register
Returns
  • Byte 0 = value
OS Release

3

82 WriteRTC[edit]

Writes RTC as a string

Send
  • StringCR = RTC time
Returns

Nothing

Notes

Not currently implemented
Time is represented as DDD,dd mmm yyyy.hh:mm:ss

  • DDD is 3 character day (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
  • dd is day of month
  • mmm is month
  • yyyy is year
  • hh is hours
  • mm is minutes
  • ss is seconds
OS Release

3

83 ReadRTC[edit]

Reads RTC as a string

Send

Nothing

Returns
  • StringCR = RTC time
Notes

Time is represented as DDD,dd mmm yyyy.hh:mm:ss

  • DDD is 3 character day (Mon, Tue, Wed, Thu, Fri, Sat, Sun)
  • dd is day of month
  • mmm is month
  • yyyy is year
  • hh is hours
  • mm is minutes
  • ss is seconds
OS Release

3

84 WriteRTCbcd[edit]

Writes all 7 RTC time registers

Send
  • Byte 0 = seconds
  • Byte 1 = minutes
  • Byte 2 = hours
  • Byte 3 = date
  • Byte 4 = month
  • Byte 5 = day
  • Byte 6 = year
Returns

Nothing

Notes

All values are represented in BCD

  • Years below 80 (&80 in BCD) signify 20xx
  • Day starts (0) from Monday
OS Release

3

85 ReadRTCbcd[edit]

Reads all 7 RTC time registers

Send

Nothing

Returns
  • Byte 0 = seconds
  • Byte 1 = minutes
  • Byte 2 = hours
  • Byte 3 = date
  • Byte 4 = month
  • Byte 5 = day
  • Byte 6 = year
Notes

All values are represented in BCD

  • Years below 80 (&80 in BCD) signify 20xx
  • Day starts (0) from Monday
OS Release

3

90 ReadInputs[edit]

Reads a byte from the digital inputs port

Send
  • Byte 0 = 90
Returns
  • Byte 0 = byte read from the digital inputs port

91 ReadBit[edit]

Reads a bit from the digital inputs port

Send
  • Byte 0 = 91
  • Byte 1 = byte to read (0 to 7)
Returns
  • Byte 0 = bit read from the digital inputs port
Commments

Reads an individual sensor from the digital inputs port

92 ReadOutputs[edit]

Reads a byte from the digital outputs port

Send
  • Byte 0 = 92
Returns
  • Byte 0 = byte read from the digital outputs port
Notes

This reads the soft copy of the last written byte

OS Release

3,4

93 CountReset[edit]

Resets input port counter(s)

Send
  • Byte 0 = 93
  • Byte 1 = bit masks for counters to reset
OS Release

4

94 CountRead[edit]

Reads input port counter(s)

Send
  • Byte 0 = 94
  • Byte 1 = counter to read (0 to 7) or 255 for all
Returns
  • Byte 0 = value of counter (LSB)
  • Byte 1 = value of counter (MSB)
  • Byte n = value of counter (LSB)
  • Byte n+1 = value of counter (MSB)
Notes

Counter values return 65535 (-1) from box reset, or max count

OS Release

4

98 InsightDriver[edit]

Starts the internal Insight software

OS Release

3

99 DataApp[edit]

Starts the internal DataApp software

OS Release

3

100 WriteLCDReg[edit]

Write LCD Register

Send
  • Byte 0 = register number
  • Byte 1 = register value
Returns

Nothing

OS Release

3

101 ReadLCDReg[edit]

Read LCD Register

Send
  • Byte 0 = register number
Returns
  • Byte 0 = register value
OS Release

3

102 LCDChar[edit]

Send a character to the LCD display driver

Send
  • Byte 0 = char
Returns

Nothing

OS Release

3

103 LCDStreamZ[edit]

Send a stream of characters to the LCD display driver

Send
  • StringNUL = string to display
Returns

Nothing

OS Release

3

104 LCDStream[edit]

Send a stream of characters to the LCD display driver

Send
  • Byte 0 = number of bytes to send (LSB)
  • Byte 1 = number of bytes to send (MSB)
  • Bytes = stream of characters to display
Returns

Nothing

OS Release

3

110 ReadKeypad[edit]

Reads the raw state of the keypad

Send

Nothing

Returns
  • Byte 0 = current keypad reading bitstate
OS Release

3

111 ReadKeypadPress[edit]

Reads the processed state of the keypad

Send

Nothing

Returns
  • Byte 0 = current keypad press bitstate
OS Release

3