RD Controls Hardware Release Note 21.0
CAMAC C1015 Module
Group3 DTM Teslameter Trigger Module
R. West
January 28, 1991
Introduction
The C1015 CAMAC module connects to a Group3 Model DTM-100 Series Hall Effect
Teslameter via an RS232 interface. There is an RS232 port on the front
of the C1015 module and also one on the rear of the module. The teslameter
is connected to the module's rear RS232 port. The C1015 module is able to
transmit to
the teslameter input it receives through its front RS232 port.
The module is also able to output to its front RS232 port all text received
from the teslameter.
A 16-bit digital signal is input to the module via its external status
connection on the rear of the module. A 16-bit trigger value is input
to the module via a CAMAC command. Each time a new trigger value is
received, the trigger bit in the module's status register is cleared.
Every millisecond, an interrupt
routine compares the digital input signal with the trigger value. When the
two are equal, an event flag is set to notify the base-level
processing routine in the module. The trigger bit in the module's status
register is also set at this time. This status register may be read via a
CAMAC command to determine if the external value has been matched.
After the trigger occurs, the base-level routine of the module writes
the ASCII character V to the teslameter to trigger a field
measurement.
360 milliseconds after the V command
is sent, the module writes an ASCII character F to the teslameter to read
the field measurement triggered by the V command. The teslameter
returns the value in the form of an ASCII text string and the module converts
it to a binary value. The data-ready bit is then set in the module's status
register. After the binary value is read via a CAMAC command, the module
clears the data-ready bit.
Text communication from the teslameter to the module may be written into
a circular text output buffer where it may be accessed via the Fast Online
Protocol (FOP) CAMAC
commands. The FOP commands may also be used to write characters into a
circular text input buffer. This input can then be written to the teslameter
to change or read various control paramenters. Response from the teslameter
to such inputs are then accessed via the FOP commands.
Operational Considerations
The sequence of steps which normally occur when obtaining a
triggered reading from the teslameter are the following:
- new trigger value set via CAMAC
- trigger bit cleared in status register
- match of external value with trigger value
- trigger bit set in status register
- V command sent to teslameter to trigger field measurement
- 360 ms timer elapses
- F command sent to teslameter to request field reading
- ASCII string received from teslameter and parsed
- data-ready bit set
- data value read via CAMAC
- data-ready bit cleared
Note that the trigger value and the external value must match exactly for a
trigger
event to be declared. If the trigger value is less than the external
value and the external value is increasing or if the trigger value is greater
than the external value and the external value is decreasing, no trigger
event will ever be declared. If the external value is changing faster than
the module can read it, an exact comparison may be missed and no trigger
event will be declared.
After a trigger event occurs,
the external value is not compared with the trigger value until the teslameter
has obtained the requested field measurement, i.e., for the 360 ms
interval between sending the V command and sending the F command. It is
possible to set a new trigger value during this time, but no comparison
of this new value against
the external value will be done. Hence, the possibility of missing a
comparison exists.
Ziptrack Application
The Ziptrack application uses the C1015 module to trigger and then obtain
field readings from a teslameter probe which is on a moving cart (see
Figure 1).
A 16-bit value available from the motor controller indicates the position
of the cart. The application program executing on the PC specifies a
value to the C1015 module at which to trigger a field mesuarement.
When this specified value matches the 16-bit digital input from the motor
controller, the C1015 module writes a V command to the teslameter to trigger
the reading and then after 360 milliseconds an F command to read the field
value from the teslameter. The PC program polls the status of the C1015 module
to determine when the new data is present and then reads the new value.
The PC program specifies positions of the cart which are at least 500 ms apart.
Therefore, the field measurement trigger always occurs at least 140 ms after
the previous field reading request.
If the PC program sees the value of the cart position stop changing before
the C1015 status indicates a field measurement has been triggered,
the program sets an error flag and displays an error message.
Module Configuration
The C1015 module is based on the CAMAC 1111 single board computer:
- Zilog 8002 16-bit processor
- Zilog 8036 Counter/Timer
- up to 32K of RAM
- up to 32K of ROM
- CMCSLV - CAMAC functions are handled by an ALTERA EP1800 EPLD chip
- DUART - RS232 communication functions are handled by a
dual power MAX232 and Signetics SCN2681 communications chip
- programmable data format
- 7 or 8 data bits plus parity
- odd, even, or no parity
- 1 or 2 stop bits
- programmable baud rate from 300 to 19200
- no echo
- no RTS
- no CTS
On the front panel of the module are the following buttons and indicators:
- N LED - indicates when the crate controller has initiated a dataway
cycle
addressed to the module's slot
- LAM LED - indicates the module is asserting its slot's dataway LAM
signal
- LAMEN LED - indicates unmasked bits in the LAM source register will
cause
module LAM to be asserted
- HB LED - indicates failure of the processor. The Heart Beat is
generated
by software via the Counter/Timer circuit (2 second one shot).
- RESET Button - resets the processor, peripheral chips, and other
circuits
- ST LEDs - eight status LEDs which may be used by application software
RS232 Interface Configuration
The C1015 module has an RS232 I/O connector port on the rear of the module
and also on the front. Each port's baud rate may be set to a value from 300 to
19200. RS232 serial data transmitted from the teslameter must be formatted
as follows:
- 9600 baud
- 8 data bits
- no parity
- 1 stop bit
I/O Connector
There are 8 switches on the I/O connector used to indicate the type of device
connected to the C1015 module. Switches 1 through 4 indicate the type of the
connected meter and switches 5 through 8 indicate the baud rate. For the C1015
module, all switches must be in the OFF position to indicate a 9600 baud
teslameter is connected.
Group3 Model DTM-100 Series Hall Effect Teslameter
The DTM-100 may be configured by use of DIP switches to transmit
each new reading on the serial line in a known format at a maximum
rate of 2.34 Hz.
Switch Settings
To enable the C1015 module to process data from the teslameter,
the switches on the processor board of the teslameter must be set
appropriately. The 16-position switch used to specify the serial
data bit rate must be set to the 9600 position.
The DIP switches must be set in the following manner:
- switch S1-6 = 1 - one stop bit
- switch S1-7 = 0 - no parity
- switch S1-8 = 1 - 8 transmission/reception data bits
- switch S2-1 = 0 - on demand only
- switch S2-2 = 0 - line feed terminator
- switch S2-3 = 1 - carriage return inserted before line feed terminator
- switch S2-4 = 1 - echoing of commands enabled
- switch S2-5 = 0 - tesla field units
- switch S2-6 = 1 - units symbol inserted after numerical reading
The RS232 jumpers on the processor board must be connected in the following
manner:
- options pins: single device system
- handshake pins: +5 volts for both CTS and DCD
- t/m pins: terminal mode
Message Formats
Upon request, the teslameter transmits to the C1015 module a string of ASCII
characters which is terminated by a carriage return, line feed pair and which
has the following format:
bddddducl
where
- b is the blank or space ASCII character and is always the first character
- d is one of the ASCII decimal digits 0 through 9 with a maximum of five
decimal digits in the string
- an ASCII decimal point is always present somewhere within the string
- leading zeroes are suppressed
- u units are indicated by one of the following ASCII characters:
- c is the carriage return character
- l is the line feed character
Teslameter Initialization
In addition to the physical switch settings, the C1015 module must send the
DTM teslameter certain configuration commands whenever the module is reset
or powered on:
- CTRL-X - reset the system, reinstating all default values and
returning the message RESET
- GV - measure field value only when receive V command
CAMAC Functions
When a CAMAC operation is performed, the Z8002 processor executes a vectored
interrupt to a routine which reads the CMCSLV data lines and determines the
function code. A jump is then executed to the appropriate routine to process
the request.
- Data
- F0 A0 - Read low 16 bits of most recent data value
- F0 A1 - Read high 16 bits of most recent data value
- F0 A2 - Read trigger value
- F0 A3 - Read external value
- F1 A8 - Read module status
- F6 A2 - Read selected options
- F16 A2 - Write trigger value
- F16 A3 - Write external value (for hardware diagnostic purposes)
- Identify
- F6 A0 - Read module number
- F6 A1 - Read software version
- F6 A5 - Read module serial number
- Fast On-line Protocol (FOP)
- F6 A3 - Read FOP status
- F6 A4 - Read FOP reply data
- F19 A2 - Write FOP command
- F19 A3 - Write FOP data
- Hardware
- F8 A0 - Test LAM
- F9 A0 - Reset module
- LAM
- F1 A13 - Read LAM mask register
- F1 A14 - Read LAM source register
- F17 A13 - Write LAM mask register
- F17 A14 - Write LAM source register
- F17 A15 - Clear selected LAM source register bits
- F24 A0 - Disable LAM
- F26 A0 - Enable LAM
Function Code Descriptions
- F0 A0 - Read low 16 bits of most recent data value
- F0 A1 - Read high 16 bits of most recent data value
- F0 A2 - Read trigger value
- F1 A8 - Read module status
- F1 A13 - Read LAM mask register
- F1 A14 - Read LAM source register
- F6 A0 - Read module number, returning the decimal value 1005
- F6 A1 - Read software version, returning
a sixteen-bit value with the major version (release) number
in the most significant byte and the revision level number in the least
significant byte.
- F6 A2 - Read selected options, returning
a reading of the switch settings on the I/O connector
used to indicate the type of the attached meter. Only the low 8 bits are
significant. FF indicates a 9600 baud teslameter is connected. Any other
value is incorrect.
- F6 A3 - Read FOP status
- F6 A4 - Read FOP reply data
- F6 A5 - Read module serial number
- F8 A0 - Test LAM; determine if the module has requested LAM,
independent of whether or not LAM is enabled.
If the module has requested LAM, Q is returned. Otherwise, no Q is
returned.
This function is totally implemented in hardware and does not interrupt the
embedded processor.
- F9 A0 - Reset the module, causing the embedded processor to be reset.
This CAMAC function is
ton on the module's front
panel. Q is always returned.
However, trying to communicate with the module before the reset is complete
results in no Q. This function is totally implemented in hardware.
- F16 A2 - Write the trigger value
- F16 A3 - Write a value to the register from which the external input is
read. This is a diagnostic function is for checking out the hardware.
- F17 A13 - Write the accompanying 16-bit word to the LAM mask register.
- F17 A14 - Set selected bits in the LAM source register. The user
must supply a 16-bit word which has a bit set for each corresponding LAM bit
which is to be set.
- F17 A15 - Clear selected bits in the LAM source register. The user
must supply a 16-bit word which has a bit set for each corresponding LAM bit
which is to be cleared.
- F19 A2 - Write FOP command
- F19 A3 - Write FOP data
- F24 A0 - Disable the assertion of LAM to the crate controller.
- F26 A0 - Enable the assertion of LAM to the crate controller. Any
LAM request made while LAM was disabled is immediately asserted.
Data Format
The C1015 module converts the ASCII text string from the connected
device to
a signed 32-bit integer representing the floating point data value
times 10 to the 7th power.
Status Format
The low byte of the status register contains a code providing information
about the data text string returned by the attached teslameter:
- 0x01 - Reading in units of Tesla
- 0x02 - Reading in units of degrees F
- 0x03 - Reading in units of degrees C
- 0x11 - No NMR signal
- 0x12 - Teslameter not in AUTO mode
- 0x13 - Reading not significant
- 0x21 - Precision greater than 31 bits
- 0x31 - Reading in units of degress C, not TESLA
- 0x32 - Reading out of range
- 0x33 - Reading in units of MHz, not TESLA
- 0x34 - Invalid units
- 0x41 - Invalid terminator
If the teslameter is correctly configured and is returning valid data,
the low byte of the status register will contain a 1, indicating the
reading is in units of Tesla.
The upper byte of the status register contains information about the
triggger and the field measurement:
- bit 8 - Triggered - set when external value matched with trigger value
- bit 9 - Data Ready - set when field measurement received
Diagnostics
Diagnostic commands may be directly input to the module by connecting a
computer terminal to one of the RS232 ports. A HELP menu displays the
commands which are available to assist in trouble shooting. The following
commands can be executed at a terminal:
- CS - Clear display
- DB/DW m n - Display bytes/words from addresses m to n
- DR - Display register contents
- GO m - Execute program at address m
- HE n - Display help menu n
- HL - Load Intel hex file
- MW m n - Monitor words from addresses m to n
- OM a d - Write data value d to memory address a
- SM/SW - Substitute memory (bytes/words)
- LB - List breakpoints
- RB b - Remove breakpoint b
- SB b a - Set breakpoint b to address a
- DS - Display I/O connector switch settings
- TE - Start echoing teslameter transmission to console
- TM s - Write text string s to the teslameter
- TN - Stop echoing teslameter transmission to console
- TR - Reset the Group 3 teslameter
- RV - Read external value
- WV - Write external value
- RR a t - Repeatedly read address a for t ms
- RW a d t - Repeatedly write value d to address a for t ms
Status LEDs
All status LEDs are cleared whenever a carriage return is received.
- ST 0 - receiving ASCII character input
- ST 1 - new valid data available for reading via CAMAC
- ST 2 - RS232 interface error (framing, parity, overrun)
- ST 3 - sent trigger command
Security, Privacy, Legal
rwest@fsus04.fnal.gov