|   |
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Home |
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).
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).
Here are a few examples of commands and parameters:
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.
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?
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.
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:
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:
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.
You can switch to slow mode by sending the *SLOW command. Error messages:
Use: *FLOW XOFF | ACK
This command sets the flow control mode of the SB-Bus.
The default flow control mode is XON/XOFF.
Examples:
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:
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:
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.
Error messages:
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:
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:
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:
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:
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.
Error messages:
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.
Error messages:
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:
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:
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:
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.
Error messages:
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.
After the file is 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.
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.
Error messages:
|