SB-Bus Commands

The Tiny EPROM Simulator is controlled by a group of SB-Bus commands. Two main groups of commands exist: system commands and control commands. System commands can be recognized by the preceding asterisk * symbol. All other commands are the control commands and they control the specific functions of the Tiny EPROM Simulator. Only the system commands can be executed when the device is selected by the general call address (255, or $FF).
Upper and lower case characters are treated as equals by the Tiny EPROM Simulator for commands, their parameters and data.
Parameters are separated from the command by at least one space. A command is parsed and executed after the reception of a CR character.

You can repeat the last command including its parameters by simply sending a single CR character to the device. You'll get a NOTHING TO REPEAT ERROR message if no command was previously executed though.

The following description uses a special notation to simplify the explanation. If you can choose between multiple parameters the pipe symbol | is used to separate the possible parameters you can choose from (eg: XOFF | ACK means either use XOFF or ACK as parameter).
Sometimes a parameter is a value or a variable piece of text. Such parameters are written in Italic and lower-case notation in this description (eg: address).
I often include spaces in the parameter descriptions for readability only. You shouldn't include these spaces in or between the parameters yourself for the Tiny EPROM Simulator will not understand you if you do.

Here are a few examples of commands and parameters:

*ERROR?
No parameter given, no parameter required.

*FLOW ACK | XOFF
Use the word ACK or the word XOFF as parameter.

OFFSET $address
Use a hexadecimal value (eg $8000) as parameter. The description of the command will show you what the legal range of the value is.

To be complete I have included the description of all the available commands in the Tiny EPROM Simulator. Though in daily use the system commands are of little use to you. So I don't think it'll hurt if you skip the description of the system commands and go directly to the 4 most important control commands.

Some Limitations

Due to the limited internal ROM and RAM capacity of the AT89C2051 I had to ease on the operator error checking of the software a little. This will make the program less fool-proof, but let's face it: There are highly educated fools around these days, so what program is completely fool-proof anyway?

  • If a parameter is expected only one is accepted. The system will reply with an Illegal Parameter Error when more than one parameter is given instead of the usual Too Many Parameters Error.
  • A legal parameter may be ended by a CR or a space. Everything following such a space is ignored until the CR.
  • During acknowledge flow control only the 1st received characters will be tested. So giving =ANYTHING will be accepted and treated as = .
  • The input buffer of the system is only 15 bytes in size. Overruns are not corrected nor signaled. This size is adequate for normal use. It will only go wrong if you include too many spaces between a command and its parameter.
  • An input string must be received and processed completely before any new commands can be received. Processing of commands is usually very fast, so this limitation should not cause any problems unless you flood the system with a lot of rubbish.

System Commands

*CATALOG?

Use: *CATALOG?

This system command displays all available SB-Bus commands of the Tiny EPROM Simulator. All command names are sent to the master computer separated by a CR character.

This command can be used together with Acknowledge flow control. If Acknowledge flow control is activated the master must send an acknowledge every time it receives one of the commands from the total list.
Transmission will be terminated if the master responds with an error acknowledge (! or ?) 10 times in a row, in which case the Tiny EPROM Simulator will send a final execution error prompt !> . Transmission is also terminated if an illegal acknowledge character is received from the master or when an ESC character is received.

The *CATALOG? command produces the following alphabetically ordered list:

*CATALOG?
*ERROR?
*FAST
*FLOW
*FLOW?
*HOLD
*ID?
*LOCS
*REMS
*RST
*SLOW
*TRIG
*TST?
OFFSET
OFFSET?
RESET
WRITE
=>

The *CATALOG? command doesn't allow any parameters.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

ABORTED ERROR
The user aborted the catalog list by sending the ESC character.

TOO MANY ERRORS
More than 10 successive error acknowledges were received during the transfer under Acknowledge flow control.

*ERROR?

Use: *ERROR?

The *ERROR? command gives you a description of the last command's error cause. Remember that you have to give the *ERROR? command directly after receiving an error prompt, otherwise the cause is overwritten by the error state of the latest commands.

In fact you only need to give the *ERROR? command if an execution error prompt is received (!>). The => prompt will always result in the NO ERROR message, while the ?> prompt will always generate a SYNTAX ERROR message.

Please refer to SB-Bus Errors for a complete list of all possible error messages.

Errors:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*FAST

Use: *FAST

After this command the Tiny EPROM Simulator is switched to the fast respond mode. In this mode it won't delay after sending a CR character as it would do if it were switched to slow mode.
The fast mode is the default mode of operation after power up.

You can switch to slow mode by sending the *SLOW command.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*FLOW

Use: *FLOW XOFF | ACK

This command sets the flow control mode of the SB-Bus to either XON/XOFF or Acknowledge.. The default flow control mode is XON/XOFF.
Remember that the Acknowledge flow control (ACK parameter) is an additional flow control and that the XON/XOFF flow control always remains active.

Examples:

*FLOW XOFF
The Acknowledge flow control mode is now switched off.

*FLOW ACK
The Acknowledge flow control mode is switched on, together with the XON/XOFF flow control.

In order to save some program memory the parsing routine is satisfied if it finds the first character of the parameter to be an X or an A. All following characters are ignored.

Error messages:

ILLEGAL PARAMETER ERROR
The parameter was not recognized. The command is not executed

MISSING PARAMETER ERROR
No parameter was given. A parameter is required by this command.

*FLOW?

Use: *FLOW?

With this command you can find out whether the Acknowledge flow control is active or not.

This command will give one of two possible answers:

XON/XOFF         Only the XON/XOFF flow control mode is active.
ACKNOWLEDGE      Acknowledge flow control and XON/XOFF flow control are both active.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*HOLD

Use: *HOLD

This optional command would place a command in hold. The hold mode is not implemented in the software for the Tiny EPROM simulator because of its limited use for this device. You will always get the HOLD NOT IMPLEMENTED ERROR when you give this command.
This automatically means that the *TRIG command is also not available.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

HOLD NOT IMPLEMENTED ERROR
The hold command is not implemented in the software of the Tiny EPROM simulator.

*ID?

Use: *ID?

An SB-Bus device must answer with its name and software version number when it receives this command.

The Tiny EPROM Simulator will respond with the following string:

Tiny EPROM Simulator V1.0

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*LOCS

Use: *LOCS

This command would allow local control of the device. But since the Tiny EPROM Simulator does not have any local controls this command has no effect. It is only included for protocol compatibility reasons.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*REMS

Use: *REMS

This command would not allow local control of the device. But since the Tiny EPROM Simulator does not have any local controls this command has no effect. It is only included for protocol compatibility reasons.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*RST

Use: *RST

This command resets the Tiny EPROM Simulator. Resetting has the same effect as though the system was switched off and back on again. After reset the device is not selected anymore, so it won't respond with an OK prompt.

Remember that the RESET signal to the target system will be activated because the Tiny EPROM Simulator doesn't know whether a valid program is available in simulation RAM or not.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*SLOW

Use: *SLOW

After this command the Tiny EPROM Simulator is switched to the slow respond mode. In this mode it will delay about 5ms after sending each CR character.
You can switch back to fast mode by sending the *FAST command.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

*TRIG

Use: *TRIG

This optional command would execute a command that was placed in hold. The hold mode is not implemented in the software for the Tiny EPROM simulator because of its limited use for this device. You will always get the HOLD NOT IMPLEMENTED ERROR when you give this command.
A command would have been placed in hold by the not implemented *HOLD command.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

HOLD NOT IMPLEMENTED ERROR
The hold command is not implemented in the software of the Tiny EPROM simulator.

*TST?

Use: *TST?

This optional command may perform some functionality tests on the hardware of a device. But since there is not much to be tested in the Tiny EPROM Simulator I decided not to have any tests at all.

The Tiny EPROM Simulator will always respond with the simple message OK when this command is given.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

Normal Commands

OFFSET

Use: OFFSET $offset

With this command you can set the offset address. The offset address is subtracted from the addresses found in the Intel HEX files that are uploaded to the system. The resulting address is then used as destination address.

Please remember that destination addresses may range from $0000 to $7FFF. Data stored to addresses beyond this range will be lost.

The offset is given in hexadecimal notation and may range from $0000 to $FFFF. Other values will result in a Range Error. Per default, after power up, the offset is set to $0000.

Examples:

OFFSET $8000        The offset is set to $8000.
OFFSET $C000        The offset is set to $C000.

Please note that the offset address will be reset to $0000 if the power to the target system has been removed.

Error messages:

MISSING PARAMETER ERROR
No parameter was given. A parameter is required by this command.

RANGE ERROR
The parameter value was out of range. Legal range is $0000 to $FFFF.

ILLEGAL PARAMETER ERROR
The parameter was not recognized. The command is not executed

OFFSET?

Use: OFFSET?

This command simply returns the current offset address. Per default the offset address is set to $0000 and can be changed by the OFFSET command.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

RESET

Use: RESET

This command pulses the RESET outputs for a duration of 100ms. So with this command it is possible to restart the target system remotely.
Normal RESET operation is completely automatic. RESET will be activated when no valid program is available in the simulation RAM. This is the case when power has just been restored, when the most recent upload was aborted for any reason and during uploading of a new program.
The RESET command has no effect when no valid program is available in simulation RAM.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

WRITE

Use: WRITE

The WRITE command initiates the Intel HEX file upload procedure. After this command the Tiny EPROM Simulator is switched to upload mode and will not respond to normal commands until the file is completely uploaded or aborted.
The RESET signal is immediately activated when this command is given.

After the file has been uploaded completely an OK prompt is returned and the RESET signal to the target system is deactivated again to start the new program.

An upload can be aborted by sending the ESC character to the device. The RESET signal will remain activated when the uploading was aborted because we cannot be certain anymore that the program in the simulation RAM is valid.
There are some other ways to abort the uploading process. One of which is by sending a new SB-Bus address to the bus. This will terminate the upload process without the generation of an error prompt. Another reason for the uploading to abort could be because there were errors found in the Intel HEX file.

It is also possible to use the Acknowledge flow control to upload an Intel HEX file. The Tiny EPROM Simulator will then generate an OK prompt ( = ) after each correctly received line. The computer is supposed to resend the last line if an error prompt ( ! or ? ) is returned by the Tiny EPROM Simulator.
Please refer to the SB-Bus chapter for a complete description of the Acknowledge flow control protocol.

Error messages:

NO PARAMETERS ALLOWED
No parameter was expected. A parameter was given anyway.

ABORTED ERROR
The file transfer was aborted by the user (ESC).

TOO MANY ERRORS
More than 10 successive error acknowledges were sent during the transfer under Acknowledge flow control.

CHECKSUM ERROR
There was a checksum error detected during file transfer.

HEX FORMAT ERROR
The transferred file contained illegal characters in the HEX strings.