The Radio Frequency Link Controller, RAFL, is an assembled module that controls a Radio Frequency (RF) transceiver module. The RAFL modules are typically used in pairs to transfer data up to a kilometer.
In the simplest configuration, one board acts as a Master and one board acts as a Remote. The Master is controlled with a serial port and a simple command structure. The serial port on the Remote is typically connected to serial Client, such as a terminal or a data acquisition system.
A single Master can also control multiple Remotes, each with their own unique address. The Master can also broadcast data to all Remotes, later polling selected Remotes for their responses (stored in a buffer). A loopback mode allows verification of communication with selected remotes.
Each RAFL module also has local inputs and outputs (I/O) that can be displayed and controlled with simple commands. The Master can access its own local I/O and also the Remote's I/O.
Page ii
(BLANK)
Page iii
Page iv
Page 1
The RAFL module provides flexible communication between a Master station and one or more Remotes. Each module can be configured as either a Master or a Remote. A minimal configuration is a single Master and a single Remote. A Master can also communicate with multiple Remotes using a unique address for each Remote.
Messages can be sent in one of several modes:
Terminal Mode -- Data exchanges controlled by a serial terminal or a control processor. Data is generally ASCII text but control characters, such as carriage return and line feed, are allowed.
Data Mode -- This mode allows all valid data values to be transmitted to the Remote(s). Because all bytes are allowed, messages terminate on a user-specifiable message length.
Broadcast Mode -- In this mode, the Master simultaneously broadcasts a message to all Remotes. Afterward, each Remote can be queried for its response to the message.
Loopback Mode -- The loopback mode verifies the communication link between the Master and a selected Remote. Messages are re-transmitted from the Remote's message buffer back to the Master immediately after they are received.
The microprocessor on each RAFL board controls all functions. The on-board processor has spare pins that are not needed to control the transceiver module. These spare pins are configured to provide local I/O, including an analog input, a buffered digital output and four digital inputs. The temperature of the processor can also be read. The Master can read and control its own local I/O and also read and control I/O on individually addressed Remotes.
Commands are provided for monitoring and controlling the extra I/O using unique commands for the Master and the Remotes. The I/O available at each module is described in more detail below.
Page 2
Features include:
Assembled and Tested -- Each RAFL board is assembled and tested with connections available on 0.1 inch-spaced holes on the board edges. This allows easy connection of wires or stake pins.
Serial Command and Readout -- Each module has a serial port. The Master port allows a terminal or control processor to exchange data with the Master, including responses from selected Remotes. The Remote serial port can connect to a Client processor, commanding it according to messages sent from the Master. Serial commands are used to configure the Master and Remotes. Serial commands also control and monitor Master and Remote I/O. The Master's serial command format is simple and can be issued manually via a terminal program, control processor or a command script (e.g., a Linux shell script from a Raspberry Pi). Responses are designed for easy interpretation from a script or control processor.
Display Formatting -- Master and Remote messages, status information and I/O data can be displayed on a single line for a quick visual overview or for easy parsing by a command script. The analog input voltage and temperature values are displayed directly in Volts, Celsius degrees and Fahrenheit degrees. The state of digital inputs and Master/Remote outputs are also easily interpreted.
Buffered Output
One open-collector transistor-buffered output is available on each module. Outputs requiring voltages up to 40 Volts and currents up to 600 milliamperes can be driven.
Digital Inputs -- Four 5-Volt tolerant digital inputs are available on each module. These inputs are internally pulled up to 3.3 Volts for easy readout of switches and contacts but are otherwise unconditioned. This allows the user to implement custom conditioning such as opto-isolation for voltages higher than 5 Volts. User conditioning can also include external noise filtering.
Analog Input -- Each module has one 12-bit factory-calibrated analog input. Typical resolution is several millivolts over a 3-Volt span. Room temperature accuracy is on the order of 10 millivolts (or less) over the input range of 0 to 3 Volts. Accuracy is rated at better than one percent over typical temperature ranges and is compatible with scaling networks using one percent resistors.
Temperature -- Each module has a factory-calibrated temperature readout. The readout is based on the internal temperature sensor in the on-board microprocessor chip. Temperature readings are verified using a thermocouple-based meter and a laboratory grade mercury thermometer to within a degree Celsius. The temperature accuracy is rated at two degrees Celsius or better. Temperature readout is available in both degrees Celsius and Fahrenheit.
Page 3
Documentation -- This manual provides detailed descriptions of the board features, setup and command usage. The manual is formatted so that, when printed, it produces a correctly-paginated double-sided document. To see the formatted document, use the "print preview" option available on most browsers.
The operation of the module is described more fully in the following sections. Because these descriptions frequently refer to Schematic 1-1, we recommend downloading and printing a copy for reference.
Download the schematic by placing the mouse cursor on the link and performing a right-mouse-click or alternate-mouse-click on it. From the resulting menu, select the "Save Target As" or the "Save Link As" option. Once saved, you can print a copy.
The schematic is not presented on a page in the manual. This is because detailed schematics do not always scale down well to a single-page format. This manual allocates blank pages so that full-size printed copies of the schematics can be inserted at their proper position in the manual.
Page 4
Photo 1-1 shows an assembled RAFL module (RAFL board with 4432 board mounted along one edge). Note: All modules are shipped with a 4432 board mounted and with factory voltage and temperature calibrations.
Page 5
Physical
The RAFL board measures 1.25 by 1.0 inches (approximately 32 by 26 mm). As shown in Schematic 1-1, Power, serial and programming connections are available on our standard six-pin BOBI interface located along one board edge. Digital inputs and serial connections are available on another six-pin board-edge connector. Two two-pin conectors on another board edge provide connections for ground, analog input and a transistor-buffered output.
Power
Input power within the range of 5-12 Volts can be applied between pins 1 and 5 on the BOBI interface connector. In receive mode, current consumption is approximately 25 milliamperes. In high-power transmit mode, the current is approximately 90 milliamperes. Note that 5 Volt power derived from a USB port may not be sufficient for powering a module; ports connected a powered hub, however, are usually able to supply the required current. Also note that the power input is not protected against voltage reversal.
Output
The single transistor-isolated output is rated at the following maximums: 40 Volts, 600 milliamperes and 330 milliwatts. These maximums may not be mutually compatible or sustainable for long periods. The output is not protected against inductive switching transients. Typical transient protection consists of a diode wired across an inductive load such as a relay or a solenoid.
Digital Inputs
There are six logic-level digital inputs. Inputs are internally pulled up to 3.3 Volts with weak pullups and are 5-Volt tolerant.
Analog Inputs
There is one analog input with a range of 0 to 3 Volts. Resolution is 400 microvolts but the input is displayed only to the nearest millivolt. Accuracy is typically less than one percent (a few millivolts): inputs are suitable for use with 1% scaling resistors. Inputs are not protected against overvoltages, reverse voltages or noise.
Temperature
A temperature reading is available that is derived from the on-chip temperature sensor on the RAFL board (the 4432 module's sensor is not used). The temperature sensor is calibrated at the factory using the single-point method described in the Silicon Laboratories datasheet for the C8051F850 chip. This calibration can be user-adjusted with a serial command. The temperature reading is rated at two degrees Celsius.
Page 6
With a pair of RAFL modules, you can quickly check out some basic features of a simple system and get a feel for how messages are transmitted between a Master and a Remote. Module pairs are normally delivered with USB to serial connections attached from factory configuration and testing. Units are typically marked with an "M" (for Master) or an "R" (for Remote) to designate factory configurations.
First, read the power and serial sections below to see how to connect power and a serial terminal to the board. In most cases, boards are shipped with a USB to serial adapter connected to the board with four jumper wires. These are the factory test connections.
Often, power can be furnished to the boards from the USB adapters, provided that the USB ports can furnish approximately 100 milliamperes. Most powered hubs can furnish this power, provided that other ports are lightly-loaded. The USB connectors on PCs or unpowered hubs are generally rated for only 50 milliamperes (maximum). Use of these USB connections is not recommended for the Remote.
In most cases, bringing up the Master is as simple as plugging the USB adapter to a USB port, bringing up a terminal and configuring it. For serial port configuration, including typical serial port designations, refer to Application Note 8. Configure the terminal for operation at 19.2K baud with 8 data bits, no parity and 1 stop bit (8N1). Also disable local character echoing.
With a properly-configured terminal attached to the Master, entering a carriage return should produce a ">" prompt.
Another way to verify configuration as a Master is to cycle power to the board: it should respond with a version prompt such as "> RAFL Ver. 141126" followed by a ">" prompt. A ">" prompt should appear each time a carriage return is pressed on the terminal's keyboard.
The configuration can also be verified by entering the cfg command and noting the display fields. One field should contain the text "|mas ff|", indicating that the master flag is true (i.e., a hexadecimal value of ff).
If you mis-enter a command, the board should respond with a "?" to indicate that it doesn't understand the command. Try entering a "garbage" command such as garbage to observe this error response.
The Remote RAFL does not require a terminal connected to its serial port, but you can connect one for testing, provided that the transmit and receive wires from the adapter are crossed over to connect to the receive and transmit connections, respectively, on the Remote's BOBI connector. For boards furnished from the factory and programmed as a Remote, this crossover connection is performed at the factory.
Page 7
Verifying the Remote is different than for the Master. When power is cycled to a Remote, there is no version text or prompt. This is because Remotes are typically connected to a serial client, such as our DACS module or a terminal. In fact, the absence of version text or a prompt is a reasonably good indication that the board is configured as a Remote.
There are more direct ways of verifying a Remote configuration by interrupting the bootup process, as explained later in this manual. One caveat: do not enter any keys on the Remote's terminal during the first 10 seconds after bootup -- this interrupts the bootup process so that the Remote can be configured (e.g., to give it a new address).
At this point, the Master and Remote should be able to communicate with each other. Although the default address of the Remote is hexadecimal (hex) 1f (the same as the Master), this is ok for a system with just one Remote.
With both RAFL modules re-powered, the modules are ready to test. The default startup mode is Terminal Mode. To verify that the Remote can respond to Master messages, enter the lm command to set the Master to operate in the Loopback Mode. In this mode, messages sent by the Master are echoed back by the Remote. This verifies that the link between the Master and the Remote is operational.
For the best test, place the modules at least 6 inches from each other. At the Master station's terminal, enter the following command sequence: t testing 123. Note that the "t" part of the sequence is a command prefix that tells the Master that the following text should be sent in Terminal mode. More on this later.
This should result in a response (on the following line) of: "testing 123^^" . The two "^" characters at the end of the response represent special characters displayed by the terminal to indicate a carriage return and a special byte were returned in the Remote's response. The characters shown in place of the "^" placeholders will vary from terminal to terminal. Ignore them for now and observe that the message was successfully sent to the Remote.
Next, test the Master's response to a link failure by turning off power to the Remote. Enter the same command as above and note that the response (after a delay of a few seconds) is: "|adr= 1f|err timeout|" . The "adr= 1f" part of the response indicates the address of the Remote that the Master was trying to reach. The "err timeout" part of the response indicates that there was a transmission error (err) and that the error was a timeout (timeout). Ignore the bars for now -- they frame multiple response snippets to make it easier for a script to parse.
Page 8
For a further test of the system, re-power the Remote and enter the rio command. This queries the Remote for its local I/O points. Because the I/O points are not yet connected to anything, the results are not particularly useful. But you can observe the format of the I/O output messages. You can see the Master's I/O by entering the mio command.
The temperature is framed in the "tmp" field: the readout is in both Celcius and Fahrenheit. A typical response would be: |ad= 1f|out 0|ins 1011|vin 1.231|tmp 22.8 73.0| .
Note that the address of the Remote being queried is returned (e.g., "ad= 1f"). This allows multiple Remote queries to be put in a file for later processing according to Remote address. Later sections describe how to assign a unique address to a Remote so that the Master can talk to multiple Remotes.
Page 9
Page 10
Page 11
As shown in Schematic 1-1, power, serial and programming connections are available on the six-pin BOBI interface connector, PL1, on one side of the board. Digital inputs (and also serial I/O) are available at PL3, along another board edge. The analog input and buffered output are available on the side of the board opposite to PL3 at PL2.
The 4432 RF module plugs into socket SO1. The module is inserted at the factory and does not require removal for any user operations.
The module is not protected against input voltage reversal. Take care to verify that the correct voltage polarity is applied to the power input pins on PL1/1 (positive) and PL1/5 (ground).
In receive mode, the module draws approximately 30 milliamperes; in transmit mode power draw is approximately 90 milliamperes. If using a powered hub, a USB to serial adapter may be able to power the board. But, a typical USB port maximum current when not connected to a powered hub is only 50 milliamperes.
Because of USB hub capacity and other uncertanties, we recommend connecting a separate 5 Volt power supply to the RAFL Remote module. This is especially important if other loads are connected to the 5 Volt power pins at PL1.
The on-board regulator accepts input voltages up to 12 Volts but the regulator can only dissipate a few hundred milliwatts. A supply voltage of 12 Volts is marginally workable for a board that frequently transmits. But, modules should not be routinely operated at a voltage higher than 5 Volts unless transmissions are infrequent (i.e. so that the regulator does not overheat). The user is responsible for determining whether or not module operation is feasible at any voltage above 5 Volts.
Serial link connections are available at the BOBI interface, PL1 pins 2 and 3. These connections are also availble on PL3 pins 1 and 2. Note that connections are at logic levels: connection to a true RS-232 link requires a TTL to RS-232 adapter. More serial link information is contained in Application Note 7 on serial interfacing and programming.
As noted above, I/O connections are available at 0.1 inch spaced connections on the board edge. The I/O section provides additional specifications, limits and commands related to the on-board I/O.
Page 12
Commands are designed to be simple, consistent and easy to use. Commands are also designed to facilitate automated processing from a control processor such as a Raspberry Pi, Beaglebone, Arduino, PC or microcontroller.
Most commands consist of two or three characters. Frequently-used commands, such as the t command for terminal entries, may consist of a single-character. The commands for configuring the module as a Master or a Remote, master and remote, are the only commands exceeding three characters.
Commands to set operating parameters typically end with an "=" to indicate a value that can be set as a user option. Displayed user parameters are typically preceded by the entry command, with the "=" serving as a reminder that this is a changeable value that has been (or can be) set. For example, the command eb= sets the value of the escape byte used to abort the current terminal message.
Operating parameters are entered as two or four hexadecimal digits. Each digit consists of ASCII characters ranging from "0" to "9" and "a" to "f". Digits are entered by typing (or sending) the command, followed by a space or carriage return. An entry automatically terminates as soon as the required number of digits are received.
The value of the entry is echoed after each input to confirm that the value was changed as intended. Errors during entry leave the existing value unchanged. The user or a control program must verify that an entry is correct. Except for manual entry from a terminal, incorrect entries are seldom a problem.
Some commands apply only to the Master or to the Remote. Commands for the Master generally start with an "ma"; Remote commands generally have an "re" prefix. For example, the mas command displays the Master status, the res command displays the Remote status.
One exception to the Master/Remote command prefix convention is the cfg command which always displays the Master's configuration. This is because the command is used to verify module's configuration only when it is set as Master. Remotes are configured by setting a module as a Master and making changes. After configuration, the module is set as a Remote prior to deployment.
To minimize code space, commands and prefixes are mostly limited to three characters. In some cases, this makes the command mnemonics difficult to remember. Also, there was not room on the chip for help text.
Fortunately, many commands are used only for initial setup and the need to look them up in this manual is (hopefully) not much of an inconvenience. More frequently used commands were designed to be somewhat mnemonic, such as the commands for displaying Master and Remote I/O, mio and rio, respectively.
Page 13
Commands execute when a carriage return or a space is entered. Commands do not have embedded spaces. Because commands can execute with a space, multiple commands cannot be executed on the same line. Either a space or a carriage return can be used to terminate a command issued from a control processor or script.
For commands that set hex values, entry automatically terminates when enough digits are entered (usually two hex digits). Value-setting commands echo the entered value on the command line to show the setting result. For example, the completed entry for setting the maximum length of a data entry to 20 (hex) characters would appear as follows: ml= 20 |ml= 20|.
All parameters apply only to the current session and are not restored at startup. Parameters can be saved for restoration at startup with the ! command. This command saves all current values. Thus, several values can be changed, followed by a single ! command to save them all.
For valid commands, the RAFL command interpreter responds with the requested information or action, followed by a space and the command termination sequence. The termination sequence is a carriage return, a line feed and a ">" character.
For unrecognized commands, the response is a "?" followed by the termination sequence. For a reboot, the response is a "!" followed by the termination sequence. There are no hidden commands: commands used for factory calibration and test are embedded in the firmware but disabled before units are shipped.
As noted previously, the "=" suffix denotes values or commands that can be changed by the user. Similarly, the "+" and "-" suffixes are used to indicate "on" and "off", thus shortening commands. For example, the ro+ and ro- commands turn the remote output on and off, respectively. Similarly, the mo+ and mo- commands turn the Master's output on and off, respectively.
The character "m" is also used as a suffix to designate commands that change or display a mode. For example, the commands lm, tm, bm and dm set the Loopback, Terminal, Broadcast and Data modes, respectively. The ?m command displays the current mode.
Refer to the command summary table for an overview of the commands and their syntax.
Page 14
There are three types of RAFL errors: command errors, data entry errors and data exchange errors.
The response to a command error is a "?" followed by the termination sequence consisting of a carriage return, line feed and ">" prompt. For automated applications where the commands and responses are issued and processed by a control processor or script, the "?" character can be used to detect a command error.
Data entry errors typically occur during entry of hexadecimal constants such as those used for escape and termination characters in Terminal mode. If invalid hexadecimal digits are detected during entry, the current setting remains unchanged. There is no other error indication except for the variable setting that is echoed after each entry. This echo can be used to verify a setting.
For entries limited to less than the full range of an 8-bit hexadecimal number, such as an address or a length, entries exceeding the maximum are rejected and the current setting remains unchanged.
Errors encountered during a data exchange vary, but are generally indicated by an error message (e.g., "timeout"). Messages and error indications are discussed in other sections as they relate to specific types of transmissions.
Page 15
Before use, RAFL modules may require configuration. This especially applies to Remotes that require a unique address. Configuration requires the module to be connected via a serial link to a serial terminal such as minicom. The serial link operates at a rate of 19.2K baud, 8 bits, no parity and 1 stop bit. Serial connections are available at the BOBI interface, as shown in Schematic 1-1.
Serial connections are made to the SI (serial input), SO (serial output) and ground (GND) pins. Application Note 8 contains more information on serial connections and configuration.
All modules automatically set their configuration as Master or Remote at startup, depending on configuration values stored in flash memory. The default configuration is that of a Master with an address of hex 1f.
The simplest configuration consists of two RAFL modules: one module is configured as a Master station (Master) and the second is configured as a Remote. When sold in pairs, RAFL modules require no additional configuration to operate with each other. A factory-configured Remote may require configuration if changing the the default address of hex 1f.
The following sections discuss commands and procedures useful in setting, saving and displaying the configuration of a RAFL module.
The ! command saves all user-settable values to non-volatile (flash) memory for restoration at startup. Saved values are:
The serial nummber is set at the factory and cannot be changed without reprogramming the chip. The % command restores all values to their default (factory) settings. Use the ! (save all) command if restored defaults are to be used after a reset.
Page 16
The cfg command displays the current Master station configuration. This command displays the configuration parameters for most values discussed in this section and in the Mode section. The command does not display calibration constants -- these are displayed by status and I/O commands. Figure 5-1 shows a typical cfg display.
Each of the configuration values and their mnemonic identifiers are enclosed within "|" bar characters. This allows them to be easily parsed using a control processor such as a Raspberry Pi executing a Python script.
>cfg |ser 0001|mas ff|ad= 1f|cmd 00|eb= 1b|tb= 0d|ml= 3f|
Page 17
All modules are automatically configured as Master or Remote at startup. Configuration depends on the value of the master/remote flag, "mas", stored in non-volatile (flash) memory. A Master has a "mas" value of hex ff (true); a Remote has a "mas" value of zero (false). The master/remote flag may be changed and saved during the configuration process.
A module configured as a Master displays a ">" prompt at startup. A Remote does not issue a prompt does not respond to any characters sent to its serial input.
The serial I/O of a Remote is controlled by the Master and the Client processor. The Master controls Remote serial output and the Client controls the Remote serial input.
If your system has more than one Remote, each remote requires a unique address. Addresses are entered in hexadecimal format and can range from 00 to 1f. Thus, 32 remote addresses are possible. The default address of hex 1f is generally reserved for the Master or a system with a single Remote. A Remote can have the same address as the Master and still operate in a system with other remotes.
To change a Remote's address it must be configured with a terminal and a special "breakout" procedure. The breakout sequence consists of the following:
If a module has already been configured as a Master and this setting has been saved in flash memory, breakout is not required: the autostart sequence terminates in the Master configuration. In this case, the the Master immediately starts up and displays the current firmware version followed by a "!" character and the normal termination sequence.
Page 18
When a Remote breaks out of its autostart sequence, it is automatically configured as a Master and displays the normal Master startup message. This consists of the current firmware revision, a "!" and the termination sequence.
For example, a typical breakout response might be: RAFL Ver. 141128 ! followed by a command prompt on the following line. The version number is the date of the firmware release coded in "yymmdd" format.
Note that the delay before breaking out of an autostart sequence is needed for the Remote to wait before accepting any terminal input: when a Remote has Client processor attached, it must ignore any startup messages from the Client. This prevents a Client output from initiating a breakout.
After breakout, the Remote's address can be changed by entering ad= followed by a space and a two-digit hexadecimal number in the range of 00 to 1f. The hexadecimal entry process is described in more detail in the Commands/Execution section above.
For example, to set the address to hex 15 (decimal 21), enter: ad= 15. After setting a Remote's address, enter the remote command and save the new remote address to flash with the
!
command. This ensures that the module starts up as a remote with the newly-entered address.After entering a new address, the address is displayed on the current line in the same format as used for the cfg command. This is shown in Figure 5-1 above. Entry of an invalid hexadecimal value or an address outside the allowed hex range of 00 to 1f does not change the current setting.
When breaking out of the autostart sequence, the module is automatically configured as a Master. To ensure that the module automatically starts up as a Remote at the next restart, enter the
Page 19
To configure a module so that it starts up as a Master, enter the master command, followed by a ! (save all) command. Strictly, the master command is not needed: commands can be entered only when a module is configured as a Master; the master command is provided as a "belt and suspenders" command.
After configuring a module as a Master or a Remote, the current configuration is displayed on the same line as the command entry. The display uses the same format as the cfg command shown in Figure 5-1 above.
Configuration as a Master displays as follows: |mas ff|. This indicates that the Master flag ("mas") is set to true (hex ff).
Page 20
The controller can operate in several different modes, depending on the type of data being sent and the source of serial data:
Use the ?m (query mode) command to display the current mode. The startup mode is Terminal. Thus, entering ?m at startup displays the following: |tm= 01|. The mode value can be used by a control program to verify the current mode. The hex codes are "00", "03" and "04" for the Loopback, Data and Broadcast modes, respectively. The codes "02" and "05" are used for transient modes used during messaging and are not displayed by the ?m command.
The following sections describe the modes outlined above, their commands and typical usage.
Page 21
In the Terminal mode, the Master behaves as if it is connected to a serial terminal. Although commanding from a serial terminal is possible, commands are typically issued from a control processor issuing terminal-type commands to the Client processor attached to a Remote. The Terminal mode is the default mode at startup.
Enter the Terminal mode with the tm command. The command is confirmed with the message |tm= 01|, shown on the same line as the command. The hex value used for the Terminal mode is "01", which can be used by a control processor to confirm that the mode was set properly.
In Terminal mode, each message requires a t command prefix. To use the t command, type or send a t, followed by a space (or carriage return) and the data to be sent. An entry is terminated with a terminator character, an escape character or a maximum length, as described below.
Terminal messages normally terminate with a terminator byte, such as a carriage return or line feed. The default terminator is a carriage return. View the terminator with the cfg command. Change the terminator with the tb= command.
As with most data entry commands, the terminator command is followed by a space and a two-digit hexadecimal value; the entry automatically terminates when two digits are received. Like other value-setting commands, the set value is echoed on the command entry line to confirm the setting.
For example, to set the terminator to a line feed (hex 0a), enter: tb= 0a. The changed value can be saved to flash memory for restoration at startup with the ! command.
A Terminal message also terminates based on the length of the message. The default length is 63 characters (hex 3f). This length includes the terminator byte (e.g., a carriage return).
An extra byte is appended to each message. This byte specifies both the remote address and how the message should be processed (remote command). Thus, the maximum message length sent to a remote is 64 bytes.
To change the message length, use the ml= command. The length is entered in the same way as the terminator command. For example, to specify a maximum message length of 32 characters (hex 20), enter: ml= 20.
For the previous example, the completed entry would appear on a terminal as follows: ml= 20 |ml= 20|. To save the message length so that it is restored at initialization, use the ! command. Length values exceeding 63 or data entry errors are ignored and the result in an unchanged length.
Page 22
A Terminal message can be aborted by entering an escape byte. This is primarily useful when making a mistake while manually entering data but can also be used by a control processor to abort a message in progress.
The default escape byte is an "escape" (hex 1b), which can be entered manually with a serial terminal by pressing the "Esc" key on the keyboard. The Escape byte is changed with the eb= command. Its operation is similar to that of the Length and Terminator commands. It can also be saved for restoration at startup with the ! command.
Although a command/address byte is appended to each message to a Remote, it is used only by the Remote and is not sent to the Client processor attached to it.
However, other characters in message from the Master, such as carriage returns or line feeds, are sent to the Client. Typically, the Remote's Client requires a character such as a carriage return or a line feed to terminate its commands.
Use the cfg command to display all terminal mode settings, as illustrated in Figure 5-1 above.
As noted previously, the Terminal mode is typically used to send messages to a remote that has a serial Client processor attached (e.g., a DACS module). In this configuration, the Remote sends the contents of a message to the Client via the Remote's serial output and returns the Client response (if any) to the Master's serial output port. Client communication is assumed to take place at 19.2K baud.
Figure 6-1 shows a command sent in Terminal mode to query a DACS Client for its analog voltage inputs using the DACS v command.
>tm >t v v 2.170 3.232 3.132 1.269 ^^> >x |lss 73|rss 7a| |snt v^? 03 |76|0d|3f| |rcv v 2.170 3.232 3.132 1.269 ^^> 1e |76|20|32|2e|31|37|30|20|33|2e|32|33|32|20|33|2e|31|33|32|20|31|2e|32|36|39|
Page 23
It is often useful to send messages to a remote without having to preface every message with a t command. Use the tt command to enter multiple terminal lines without a command prefix. After entering the tt command, enter subsequent messages without a t prefix..
To exit the tt command mode, enter the escape character (e.g., "Esc"). This aborts any message in progress and returns to the current mode (e.g., Terminal, Broadcast or Loopback).
Page 24
Enter the Loopback mode with the lm command. The lm command is confirmed with the message: |lm= 00|, displayed on the same line as the command. The value of the Loopback mode is "00", which can be used by a control processor to confirm that the mode was set properly.
The Loopback response from the remote is displayed as a carriage return followed by the data sent, including the command/status byte appended to every transmission.
If a Loopback transmission is immediately followed by an x (exchange) command, the transmitted and returned data is displayed on several lines in hexadecimal format. Figure 6-2 shows a Loopback message, the remote's response, and a hexadecimal display of the exchange. Figure 6-1 shows the use of the x command to display the results of a Terminal mode exchange.
Note that the "^" characters shown in the figures represent non-displayable data such as carriage returns, line feeds and the command/address byte appended to each message. The actual character displayed varies, depending on your serial terminal. The actual values of these special characters can be viewed using the x command.
The x command is followed by a response that includes values labeled "lss" and "rss." The "lss" value is the local (Master) signal strength monitored just prior to the transmission of the message. The "rss" value is the signal strength measured during the receipt of the return message from the Remote. The "|snt" prefix indicates that the following characters are the message sent by the Master. The "|rcv" prefix indicates that the following characters are the message received from the Remote.
The text display of each message is followed by a hexadecimal display of the same message. Each hex display is prefixed with the total number of characters sent, in hexadecimal. For the example in Figure 6-2, the total number of characters sent and received is hexadecimal 15 (decimal 21). Note that the total character count includes the address/command byte appended to each Master station message.
>t test message abc123 test message abc123^^ >x |lss 70|rss 7f| |snt test message abc123^^ 15 |74|65|73|74|20|6d|65|73|73|61|67|65|20|61|62|63|31|32|33|0d|1f| |rcv test message abc123^^ 15 |74|65|73|74|20|6d|65|73|73|61|67|65|20|61|62|63|31|32|33|0d|1f|
Page 25
Enter the Data mode with the dm command. The command and its value is confirmed with the message: |dm= 03|, which is displayed on the same line as the command. The command value can be used to confirm the mode setting.
The Data mode is primarily used to send binary data to a remote. In the Data mode, all values from hex 00 to hex ff can be sent to a remote but the data must be sent in a fixed-length block. Terminator and escape bytes cannot be used in Data mode because they may be part of the message data.
The Data mode requires a d prefix for each message (similar to the "t" prefix used for Terminal messages).
Use the "message length" command, ml=, to set the fixed size of each Data message. Use the ! command to save a changed message length setting for restoration at startup. The default message length is hex 3f (decimal 63) bytes.
In the Data mode, the Remote sends all data that it receives to its serial output for processing by the Client. The Client must be able to interpret the binary data block and return a response to the Master. In the event that the response is also binary, it is sent in raw form to the Master's serial output; the control processor on the Master's end must be able to process these raw responses.
The x command can be used in the Data mode to view the data exchange. Caution: when manually testing the d command with a terminal program, some escape sequences may be intercepted by the terminal program and cannot be sent to a remote. For example, the minicom program intercepts a "Ctl-A" entry and displays a menu.
The Broadcast mode sends terminal-type commands simultaneously to all remotes. Messages are sent using the t command. Remotes do not respond with a return message and the Master does not expect any response.
Enter the Broadcast mode with the bm command. The command is confirmed with the message: |bm= 04|, which is displayed on the same line as the command. The value returned by the Broadcast mode command can be used to confirm the mode setting.
Broadcast messages are sent using the t command. Each Remote saves its response to a Broadcast message in a special buffer.
After sending a Broadcast message, the Master can query each Remote for its saved response by setting the address of the Remote and then executing the b command. Note that the saved response may not be valid if any other messages have been sent to a Remote after a Broadcast message is sent (e.g., another Broadcast message).
Page 26
Use the mas command to display status values for the Master station. Figure 7-1 shows typical Master station display for this command.
The "ad=" value shows the current address setting as set by the ad= command. Note that this is the address of the Remote currently being addressed. For a multiple-remote system (i.e., a multi-drop configuration), this address changes frequently as different remotes are addressed.
The current Remote address is stored in volatile memory and is simply a current working value. At Master station startup, this value is set from flash memory and reflects the Master station address (usually the default of hex 1f). If this address is not changed, any transmissions to the Remote assume that its address is the same as the Master (e.g., hex 1f). This is the typical configuration for a system that consists of a Master station with a single Remote.
The next two items in the Master status display are the local (Master) and Remote signal strengths measured during the last data exchange, as discussed in the Configuration/Loopback section (see the x command).
The next item in the Master status display is the battery voltage of the Master, as measured by the 4432 chip. The voltage can be calculated (in millivolts) by adding 1700 and the "bat" count multiplied by 50. For example, the value of hex 1e represents a battery voltage of 1700 + (30)(50) = 3200 millivolts (3.2 Volts).
For the Master, the "bat" reading is not very interesting because it typically shows the voltage output by the on-board 3.3 Volt regulator (i.e., hex 1e).
The next item in Master status display, "ver", is the version number read from the Master's 4432 chip.
The "cz=" value is the 16-bit hexadecimal number for the Celsius zero crossing value. This is a single-point calibration performed at the factory and generally does not need to be changed. See the I/O section for more information on this value and how to change it.
Page 27
The "as=" value is the 16-bit hexadecimal number for the analog scaling factor. Like the Celsius zero crossing value, the analog scaling factor is a factory calibration setting that does not normally need to be adjusted. See the I/O section for more information on this value and how to change it.
>ms |ad= 0b|lss 6b|rss 73|bat 1e|ver 06|cz= 067e|as= 9df5| >rs |ad= 0b|lss 7b|rss 8c|bat 1e|ver 06|cz= 067e|as= 9df5|
As shown in Figure 7-1, the Remote Status command, res, produces a display that is identical in format to the Master Status command. However, the values displayed are read remotely from the currently active Remote (i.e., as set with the ad= command).
The "ad=" value shows the address of the Remote being addressed. This value is read from the Remote's address variable which is initialized from flash at startup.
The next two items in the Remote status display are the signal strengths measured during the last data exchange at the remote. Thus, the "lss" value is the signal strength measured at the Remote while listening for a Master station message. The "rss" value measures the signal strength received during message reception from the Master.
The "bat" value measures the battery voltage read at the Remote. For remotes using the on-board regulator, the voltage calculated from this value should be 3.2 Volts (see the Master section above).
The "bat" value is most useful when monitoring a Remote powered with a battery (i.e., the regulator has been removed and replaced with an input/output jumper). In this case, "bat" measures the Remote's battery voltage.
The "ver" for the Remote is the version number read from the Remote's 4432 chip (typically, 06).
The "cz=" and "as=" values are the Celsius zero crossing and analog scaling values read out at the Remote. These are described in more detail in the I/O section. Note that these can only be changed when a RAFL board is connected to a serial terminal, as described in the Configuration section.
Page 28
In addition to a serial link for a Client processor, RAFL provides one one digital output, one analog input and four digital inputs that can be controlled and displayed with user commands. These I/O connections are shown in Schematic 1. The I/O connections and the user commands are described in more detail in following sections.
The digital output drives an open-collector transistor that allows control of loads with higher voltages and currents than available from a raw processor output. A typical load would be a relay or LED.
The analog input provides a 12-bit readout of voltages in the range of 0 to 3 Volts.
The digital inputs accept logic-level inputs a can can be read out as a group.
Commands are available for I/O attached to both the Master and Remotes. Additional I/O can be brought back from Remotes by attaching a serial data acquision and control module such as our DACS product.
Page 29
To display the Master station I/O, use the mio command. To display the I/O of a Remote, set the address of the Remote using the ad= command and use the rio command to query the addressed Remote. Figure 8-1 shows the display resulting from these commands.
Following sections discuss the individual fields in the I/O display. These sections also discuss device connections, ratings, specifications and commands.
As shown in Schematic 1, the output connects to PL2/2. This is labeled "21" on the board to indicate that the output is driven by port 2, pin 1. This connection point is wired to the collector of Q1, a SMBT2222 transistor in a SOT23 package.
The ground reference is available at P6/1 (labeled "RST") or at PL1/5 (the BOBI interface connector).
The transistor maximums are: 40 Volts collector to emitter, 600 milliamperes collector current and a package dissipation of 330 milliwatts. The user should ensure that maximum device ratings are not exceeded.
If you intend to operate near any of the device limits, we recommend downloading the data sheet for this device to determine the operating characteristics at the planned load voltage, current and temperature. For example, at a collector current of 600 milliamperes, the maximum collector to emitter saturation voltage may be as high as 1 Volt, thus exceeding the power dissipation limit, particularly at higher operating temperatures and high duty cycles.
A typical application might be driving an indicator LED drawing 20 milliamperes with a battery voltage of 12 Volts. This application would be well within the limits of the device.
The output is not protected against high voltage transients that may be caused by switching inductive loads. An appropriately-rated diode should be intstalled across inductive loads such as relays or solenoids. Connect the cathode of the diode to the end of the load connecting to the positive supply and connect the anode to the other end of the load.
At startup, the output transistor is turned off. There may be a small delay in turning the output off: this may affect some applications that must be handled by the user (e.g., with de-glitching circuitry). Normally, the turn off delay is not a problem (e.g., with most LEDs and relay outputs).
To turn on the Master's output transistor, use the mo+ command. To turn the transistor off, use the mo- command. After executing either of these commands, the current output state is displayed on the same line as the command in the same format as the mio and rio commands. The output indicatior field is labeled "|out" and can be readily parsed using a script. The output reads "1" when the transistor is turned on and reads "0" when the output is turned off.
Page 30
Figure 8-1 shows the display resulting from the Master output commands.
>mo+ |ad= 1f|out 1|ins 1011|vin 1.238|tmp 51.7 124.| >mio |ad= 1f|out 1|ins 1011|vin 1.237|tmp 51.6 124.| >mo- |ad= 1f|out 0|ins 1011|vin 1.240|tmp 51.6 124.| >mio |ad= 1f|out 0|ins 1011|vin 3.001|tmp 23.9 75.1| > >rio |ad= 1f|err timeout| >ad= 0b |ad= 0b| >rio |ad= 0b|out 0|ins 1101|vin 3.000|tmp 23.9 75.1| >ro+ |ad= 0b|out 1|ins 1101|vin 1.224|tmp 23.9 75.1| >rio |ad= 0b|out 1|ins 1101|vin 1.225|tmp 23.9 75.1| >ro- |ad= 0b|out 0|ins 1101|vin 1.225|tmp 23.9 75.1| >rio |ad= 0b|out 0|ins 1101|vin 1.223|tmp 23.9 75.1| >
After setting the desired remote address, use the ro+ command to turn on the output transistor of the selected Remote. Similarly, use the ro- command to turn off a Remote's transistor.
Figure 8-1 shows the display resulting from the Remote output commands, including the timeout error that displays when the remote address is set to a non-existent remote address (or if the remote is inoperative).
Page 31
As shown in Schematic 1, digital inputs connect to PL3 pins 3, 4, 5 and 6 (PL3/4,5,6). Inputs are labeled "03", "06", "07" and "13" to indicate their processor pin connections (e.g., "13" connects to port 1, pin 3).
The ground reference for the inputs is available at P6/1 (next to the "RST" label) or at PL1/5 (the BOBI interface connector).
Inputs are internally pulled up to the 3.3 Volt supply through weak pullups. Thus, inputs may be left floating for a reading of "1" and pulled to ground for a "0" reading. If the inputs must be pulled up harder than the weak pullups provide, they can be connected through a resistor to a 5-Volt or 3.3-Volt supply (inputs are 5-Volt tolerant). If a pullup is used, a "hard" pullup resistor of 10K is sufficient for most applications.
The 3.3 Volts from the board regulator is not available on a connector pin. This prevents inadvertent overload of the internal digital regulator. If the inputs are pulled up externally to 3.3 Volts, we recommend using a separate 78L3.3 regulator (e.g., powered from PL1/1). Many USB to serial adapters also provide regulated 3.3 Volts that can be used for pullups.
Applying more than 5 Volts to any input may damage the processor. To prevent this, isolate inputs with added circuitry such as opto-isolators or logic gates. Opto isolation is ideal for connections susceptible voltage transients or external noise.
To reduce radio frequency interference, bypass susceptible inputs to ground through a 0.01 to 0.1 microfarad capacitor. Install the bypass as near as possible to the PL1 connections. Module shielding may be needed for more severe cases of interference.
Avoid applying negative voltages, no matter how small, to inputs. The potential for input damage due to negative inputs can be minimized by connecting a reverse-biased diode from a susceptible input to ground.
Often, a pair of reverse-biased diodes are used to limit both positive and negative excursions on an input. Small dual-diode packages such as the MMBD4148SE can be used for this type of protection. Other types of protection or opto-isolation may be required, depending on the application.
Input opto isolation is a good way to monitor voltages that may be too high or too noisy for direct connection to inputs. Opto-isolation is also effective when monitoring a voltage at some distance from the board. This breaks ground loops and minimizes noise pickup and transients induced in long wiring runs.
Input isolation circuitry is discussed in more detail in the DACS manual.
Page 32
As shown in Schematic 1, the analog input connects to PL2/1. The input is labeled "17" to indicate its processor pin connection (i.e., "17" connects to port 1, pin 7).
The ground reference for the input is at P6/1 (near the "RST" label) or at PL1/5 (the BOBI interface connector).
The input uses the 1.65 Volt internal reference and a gain of 0.5 to provide an analog input range of 0 to 3.3 Volts. Because the supply voltage may be less than 3.3 Volts, the analog input is specified for operation only in the range from 0 to 3.0 Volts. Depending on the voltage regulator's output, readings above this (e.g., 3.1 Volts) may be usable, but an extended range must be determined by the user on a case-by-case basis.
The input is a raw input to a chip pin and typically requires external circuitry to protect against noise and over-voltage.
The analogs are set up for 13-bit readings (dithered 12-bit operation, as explained in the Silicon Laboratories datasheet). This provides a basic resolution of 3.3/8192 = 400 microvolts. Accuracy is a bit more difficult to predict because it depends on many variables such as chip manufacturing, temperature, converter offset and slope errors.
We have performed measurements at room temperature using an Electronic Development Corporation (EDC) Low Impedance DC Millivolt Standard and an Agilent 34410A 6 1/2 Digit Multimeter.
After calibration, reading errors were within a few millivolts of the measured inputs. As expected, maximum error was at zero (zero offset) and was typically 2.8 to 3.2 millivolts (7 or 8 counts). The software compensates somewhat for this non-zero reading. Results are displayed to the nearest millivolt.
The observed maximum error corresponds to an accuracy of approximately (3 millivolts)/(3000 millivolts) = 0.1 percent. But, the actual accuracy can be expected to be less than this, depending on the factors given above.
The RAFL module was designed to provide overall accuracy of less than a percent so that 1 percent resistors can be used for voltage scaling. If greater accuracy is required, modules should be individually characterized over the range of conditions expected during operation.
Use the mio command to display the analog voltage at the Master. Use the rio command to display the analog voltage at the Remote. The voltages are labeled "vin" on the Master and Remote I/O displays. Figure 8-1 shows typical output readings.
Page 33
Each unit is calibrated for a full-scale reading of 3.000 Volts with a precision 3-Volt source. This calibration compensates for variations in the on-board voltage reference and other factors. The calibrated analog scaling factor is stored in non-volatile memory as the default. To display the analog scaling factor, use the ms command and observe the field labeled "as=", as shown in Figure 7-1.
The analog scaling factor is discussed in more detail in the DACS manual.
Because the analog scaling factor is set at the factory, it does not normally need to be adjusted. However, you can change the analog scaling factor with the ad= command. After entry, the changed value and the current analog voltage reading is echoed on the command line. If there are entry errors, the scaling factor remains unchanged.
When changing the analog scaling factor, we recommend recording the default value so that it can be readily restored. Although all factory defaults can be restored with the % command, this restores all values from flash. It is much simpler to restore just the default scaling factor and save it to flash with the ! command.
Page 34
Figure 8-2 shows an example of how the analog scaling factor and the zero crossing count for temperature calibration can be adjusted to provide an exact reading for a known voltage input or temperature.
>as= 9d27 |as= 9d27|vin 3.001| >as= 9d25 |as= 9d25|vin 3.000| >as= 9d20 |as= 9d20|vin 2.999| >as= 9d25 |as= 9d25|vin 3.000| > >cz= 074c |cz= 074c|tmp 24.1 75.3| >cz= 074d |cz= 074d|tmp 23.9 75.1| >cz= 074e |cz= 074e|tmp 23.8 74.8| >cz= 074d |cz= 074d|tmp 23.9 75.1| >! >mas |ad= 0b|lss 63|rss 73|bat 1e|ver 06|cz= 074d|as= 9d25|
Page 35
Use the mio command to display the Master station temperature in both degrees Celsius and Fahrenheit. Use the rio command to display Remote temperature readings. Figure 8-1 shows typical output readings for a Master and a Remote.
Because of the high resolution used for a single temperature reading, single readings vary. To minimize these reading to reading variations, the displayed result is the average of multiple temperature readings.
The temperature accuracy for each chip varies, depending on the offset at zero degrees Celsius. A more accurate temperature reading can be obtained if a single-point temperature calibration is performed, as outlined in the C8051F850 datasheet and discussed in the DACS manual.
Also see the Silicon Laboratories Application Note titled "Accuracy Considerations for Microcontroller-Based Temperature Sensors." A single-point calibration is performed at the factory for each RAFL board using a BK Precision Model 910 thermocouple meter. The calibration is also checked with a laboratory-grade thermometer.
The 16-bit Centigrade zero-degree crossing count can be adjusted with the cz= command. Like most "=" commands, the changed value is echoed on the command line. The resulting temperature reading is also echoed on the command line. The calibration value is not changed if there is an entry error. To save a calibration value, use the ! (save to flash) command.
Before changing the zero crossing calibration, we recommend recording the default value so that it can be readily restored. Although all factory defaults can be restored with the % command, this restores all default values from flash, not just the temperature calibration. It is much simpler to restore just the default scaling factor and save it to flash with the ! command.
Figure 8-2 (above) shows an example of how the temperature zero crossing can be adjusted to provide an exact reading for a known temperature.
Page 36
ad= Set Remote address | The "ad=" command sets the address of the current Remote. At the Master, this is a value stored in volatile memory and changes whenever a new remote is addressed. For initial Remote setup, set this value, execute the remote command and save to flash with the ! command. When set at the Master, the command simply establishes the address of the current attentive Remote (no save is needed). Read this command out with the mas (Master stats) command. |
as= Set the 16-bit analog scaling factor. | This value is set at the factory with a precision voltage reference and normally does not require adjustment. We recommend recording the factory value before adjustment so that it can be readily restored. |
b, bm | The bm command sets the broadcast mode. In this mode, messages are sent to all remotes. Remotes store their responses in a local buffer. These buffers can be individually displayed by setting the attentive remote with the "ad=" command and then issuing the "b" command. |
cfg Display Master station configuration data | The "cfg" command displays Master station configuration data. Data consists of the serial number (ser), Master/Remote flag ($ff=Master), attentive address (ad=), command mode (cmd), escape byte (eb=), termination byte (tb=) and maximum message length (ml=). This command is primarily intended to aid in the configuration of Master and Remote modules. |
cz= Set Celsius zero count | The "cz=" command sets the Celsius zero crossing offset. This single point calibration constant is set at the factory but can be adjusted. We recommend recording the factory default setting before adjusting the zero offset so that it can be easily reset to the factory default. After changing this constant, you can save it to flash with the "!" command. |
d, dm Enter data in data mode, set data mode. | The "dm" command enters the Data mode. In this mode, a "d" must precede data (similar to the "t" command in Terminal mode). Any data value can be sent in the data mode. Messages are fixed in length and terminate when the maximum message length is reached. The maximum message length is set with the "ml=" command. |
Page 37
eb= Enter the escape value for the terminal mode. | The "eb=" command sets the escape byte to be used to escape from a Terminal mode entry. The default escape byte is hex 1b (Esc). When this value is entered, the current terminal entry is aborted and a new entry is elicited with a command prompt. After an escape, RAFL remains in the Terminal mode. Also use the escape byte to exit from the "tt" (no prefix) mode. |
lm Set the Loopback mode (startup default). | The Loopback mode sends a terminal message to the attentive Remote. The received message is sent back to the Master to confirm link operability and establish local and remote signal strength readings. |
master Set for autostart as the Master station. | This command sets the module as the Master station. When this is saved using the "!" command, the autostart breakout sequence is bypassed at the next startup. As this command can only be issued when connected to a Master, it is somewhat redundant. |
mio Display Master station I/O. | The "mio" command displays all Master station I/O. For the output, a "1" indicates that the output transistor is being driven low (e.g., to turn on an LED). A reading of "0" for the output indicates that the output is not driven. For inputs, a "1" indicates an input that is not pulled down to ground (e.g., via a switch contact). A "0" indicates an input that has been pulled down to ground. The analog input is labeled "vin" and reads out in Volts (last digit is millivolts). The temperature reading, "tmp" is given in both Celsius and Fahrenheit. |
ml= Set the maximum message length (hex 3f default) | The "ml=" command sets the maximum message length allowed in both Terminal and Data modes. For Data mode, this length is used to terminate the message. |
mo+, mo- Activate, deactivate Master station output. | The "mo+" command activates the Master station output by driving the output transistor low (e.g., to turn on an LED or relay connected to a positive voltage). The "mo-" command deactivates the output. Use the "mio" command to read the current state of the output: an "out" reading of "1" indicates the output transistor is being driven; a "0" reading indicates the transistor is not being driven. The default output state is "0" (transistor not driven). |
Page 38
mas Display Master station status values. | The "mas" (Master status) command displays the following Master station status values: "ad=" (attentive address), "lss" (listen receive strength), "rss" (receive signal strength), "bat" (encoded battery voltage), "ver" (4432 version code: 6 = version 1B), "cz=" (Celsius zero calibration), "as=" (analog scaling factor). |
rio Display Remote I/O. | The "rio" command displays the I/O of the attentive Remote. See the "mio" command for more details. |
remote Set the current module to be a Remote (default). | The "remote" command sets a module to act as a Remote at startup. This must be done with an attached terminal and a module that has exited from the automatic startup mode. The configuration at exit from autostart is "master" so the "remote" command must be executed after configuring the Remote and saving it to flash (i.e., with the "!" command). Normally, a Remote only needs to be reconfigured if its default address (hex 1f) needs to be changed (i.e., with the "ad=" command). |
ro+, ro- Activate or deactivate the attentive Remote's output. | The "ro+" command activates the output of the current Remote; the "ro-" command deactivates it. See the "mo+" and "mo-" commands for display and activation conventions. |
res Display the status of the attentive Remote. | The "res" command is similar to the "mas" command, but it displays status values read from the attentive Remote. See the "mas" command for the display format. |
tb= Set the termination byte value for the Terminal mode. | The "tb=" command allows setting of the byte value to be used to terminate a Terminal entry. The default value is a carriage return (hex 0d) but some applications may require another value, such as a line feed (hex 0a). This value terminates the Terminal mode entry and is also sent to the Remote as part of the Terminal message (e.g., for use by a Client processor attached to the Remote). |
Page 39
tm, t, tt Set the Terminal mode, enter data in a Terminal mode. | The "tm" (terminal mode) command sets the Terminal mode for message data entry. In the Terminal mode, messages must be prefixed with a "t" command. Terminal messages can be aborted by entering the escape character (see "eb=" command). Messages also terminate on entry of a termination byte (see "tb=" command) or a maximum length (see "ml=" command). Multiple messages can be sent in the Terminal mode by prefixing the first message with a "tt" command. Subsequent messages do not require a "t" or "tt" prefix. Escape from the "tt" entry mode by entering the escape character (usually an Esc). |
x Hex display of last exchange. | The "x" command displays the last exchange in hexadecimal. This is a more convenient format for data exchanges that may include non-displayable characters. |
! Save values to flash. | The "!" command saves all settable values to flash memory so that the current configuration is restored at the next startup (e.g., at reset or power up). |
% Reset all values to default (factory) settings. | The "%" command resets all settable values to the factory default settings. If this command is followed by a "!" command, all values are restored to default values at startup. |
?m Display the current mode. | The "?m" command displays the current operating mode and code. For example, a "loop 00" indicates that the Master is in the loopback mode which is coded as a hex 00. |
Page 40
Photo 10-1 shows our test fixture for a two-RAFL system. Modules are mounted on part of a case from an old CD drive. Carrier boards for the RAFL Master and Remote are mounted to the base with E6000 glue and nylon standoffs. The Client used for testing is a DACS module, which is also glued to the base with standoffs.
Wiring is performed point-to-point, with connections to stake pins performed with with breadboarding wires ( mostly socket-to-socket wires).
In Photo 10-1, the Master is at the top left of the fixture, mounted on a perf-board carrier. It has a BOBI breakout board connected to split out connections for the programming connector (bare stake pins) and the USB to serial adapter from the Raspberry Pi (on the end of the silver USB cable). Commanding to the Master is via a minicom terminal on the Pi. The terminal is controlled (SSH) from from a development PC running Debian Linux.
Page 41
In Photo 10-1, the Remote is mounted on the bottom left of the fixture. It also has a BOBI breakout board attached. A ribbon cable (with a yellow socket) is shown connected between the programmer and the Remote's BOBI breakout. The programmer is shown on the left side of the photo, mounted on the perforated grille.
The programmer shown here is made with one of our general-purpose MINT processor boards mounted on a piece of perf board. The MINT processor is programmed with the MIDE program. The programmer has a magnet glued on the bottom of the perf board so that it "sticks" to the black sheet of steel that supports the entire assembly.
The cable to the input of the programmer comes from the harware serial port of a Raspberry Pi. Programming is performed SSH from a PC to the Pi. The programming cable from the programmer, shown connected to the Remote, is manually switched between the Master and the Remote.
The DACS Client for the Remote is mounted at the bottom right of the fixture.
A switch plate is mounted on the top right corner of the fixture. It allows independent switching of power to the Master, Remote and DACS. This capability is used to verify that there are no startup problems between the Remote and the Client and to verify that errors are reported correctly at the Master if the Remote is inoperable.
The input power to the switch plate is from an external 5 Volt supply: all modules are separately powered and do not use power from the USB to serial adapters. Note that the BOBI breakout has a jumper option that allows USB power to be disconnected from its attached product board. Application Note 8 provides a schematic of the BOBI breakout board and a description of its use.
A wooden support is mounted at the middle left of the fixture. It has two grommets glued on one side to hold a labratory-grade thermometer. The thermometer is fitted through the grommets and wedged in place with a toothpick. The grommets also provide routing for the thermocouple wire from a BK Precision Model 910 thermocouple meter (not shown).
The two green and blue wires disappearing on the bottom left of the photo connect to a USB to serial adapter and are used to monitor the output from the DACS Client. Monitoring is via a SSH link connected to a second minicom terminal running on the Pi.
Page 42
MyForth source is compiled on the development PC and the resulting program image file is copied SCP to the Pi via an shell script. Chip programming is performed on the Pi and is managed with a shell script that calls GForth (installed on the Pi).
You can download rafl.tar, a tar archive of the MyForth source. On Linux systems, the source can be extracted with the command: tar xvf ralfl.tar. This results in a directory, rafl, containing the source. If you are using the "standard" MyForth source tree, this directory should be put in the ~/myforth/projects/850 directory.
There are several Bash shell scripts in the source to aid in developing with a Raspberry Pi, including topi.sh which transfers the program image.
Also available in the tar file is the latest firmware in both Intel hex (chip.hex) and binary image (chip.bin) formats. The Intel hex file can be used with the Silicon Laboratories IDE or MIDE programmer to program the 850 chip.
Page 43
Production Release |
||
Final rough check, no detailed edit review |
||
Major cleanup, no final edit review |
||
Initial Release, minimal editing |
Copyright © 2014, Bob Nash.
Page 44
(BLANK)