HCS_C Combo card commands
Author: Bob Morrison
Revision: original 12/9/2006
1/29/2007 revision 1/29/2007
1.01 Revision 5/6/2007 line clear, color register
1.02 Revision 6/18/2007 video addressing example
// (c) Robert Morrison Jan 2007 All rights reserved. No part
// may be used or modified without express written permission
// of the author.
Format, all characters case sensitive. HCS_Net ID has format CMB<n> where <n> is any decimal number from 0 to 31. All HCS_Net Combo cards ship with HCS_Net ID CMB1 unless a different ID is specified when ordering (it's coded into the FPGA--it can be changed by downloading new bits). You need to be sure to tell the HCS_C to configure for your HCS_Combo card in your events.hcs file, for example:
config
hcsnet CMB1
end
COMMAND FORMAT
! <HCS_Net ID> <command> (read commands)
! <HCS_Net ID> <command>=<DDDD> (write commands)
! <HCS_Net ID> <command><select>=<DDDD> (write bit commands)
! <HCS_Net ID> <command>=x<DDDD> (write commands with hex parameter)
! <HCS_Net ID> <string command>=<string> (write string commands)
string commands terminate with <CR><LF>. You may embed a <CR> without
the <LF>, this causes the string to continue. No character is output
in this case, but video will go to a new line.
Read commands
T = Touchscreen
I = IO input
J = read input triggers
O = input optoisolator
P = optoisolator input level occurred (write clears)
R = relay state
K = Keyboard
(NOTE: simplified keyboard interface, just basic keys interpreted)
ALSO NOTE--big FIFO!! on powerup, do a CMB1 M=x100 to clear it out
V = Voice input
A1 = ADC input channel 1 (reads 10 bit value)
A2 = ADC input channel 2
A3 = ADC input channel 3
A4 = ADC input channel 4
S = Combo card status
bit 0: at least one IO input has hit trigger
(IO mode specifies trigger level)
bit 1: at least one opto input has hit trigger
(opto mode bits in combo mode register specifies trigger
level)
bit 2: keyboard has a character
bit 3: voice recorder generated an interrupt
bit 7-4: Analog input has hit minimum trigger
bit 11-8: Analog input has hit maximum trigger
E = send all input registers
Write commands
T = Write Touchscreen
I = IO output
J = clear input triggers
P = clear optoisolator occurred
R = set output relays
V = Voice output command
N1 = Set minimum channel 1
N2 = Set minimum channel 2
N3 = Set minimum channel 3
N4 = Set minimum channel 4
X1 = Set maximum channel 1
X2 = Set maximum channel 2
X3 = Set maximum channel 3
X4 = Set maximum channel 4
A1 = DAC output channel 1
A2 = DAC output channel 2
A3 = DAC output channel 3
A4 = DAC output channel 4
D = IO direction
a = video cursor address
example: HCSNET = "CMB1 a=AAA"
AAA is the cursor address, generated as X + (128 * Y).
You can use hexadecimal:
HCSNET = "CMB1 a=xAAA"
where the AAA address X value is bits 0-6, and the Y value
is bits 12-7.
M = mode register
bit 0-3: level to monitor opto inputs to trigger status
bit 5-4: select video display mode 00=low (VGA), 01=med, 10=high
bit 6: reset ADC (does not need to be cleared)
bit 7: oscillate unlock
bit 8: Clear keyboard FIFO (does not need to be cleared)
v = video character (string command)
p = IO pulse rate 1ms or 1 sec
C = clear input triggers
c = Set color and flashing for video chars that follow
bit 0: 0=red
bit 1: 0=green
bit 2: 0=blue
bit 3: 1=flashing
L = LCD string (string command)
s = Clear screen syntax is CMB1 s=x20 to clear screen
l = Clear line syntax is CMB1 l=x20 to clear line
W = create new character (string command)
Write bit commands
I<SS> set output and mode for IO bit
bit 0: bit value to set
bit 1: 0 = pulse, 1 = oscillate
To oscillate, the oscillate_unlock mode bit must be set
bit 2-15: interval time in ms or secs, depending on
the setting of the IO pulse rate register. If this
is zero, the IO bit will stay at the current level,
if it is not zero, it will toggle at the end of the
timeout.
Example read command (this is the actual string sent to the HCS_Combo card--HCS_C Xpress automatically prepends the "! ":
! CMB1 I
this will return
$ CMD1 I=0000
Example write command
! CMB1 R=4
this will set the third relay
Example clear screen command (parameter is ASCII character value, with the upper nibble specifying color and flashing.)
! CMB1 s=x20
Example write a character to the video display.
! CMB1 c=xE (specify red, flashing)
! CMB1 v=AAAAAA (write A characters, these will be red and flashing)
Example clear line command (parameter is ASCII character value, with the upper nibble specifying color and flashing.). This command fills the rest of the line with the specified character, without moving the cursor position.
! CMB1 l=x20 (clears the rest of the line)
! CMB1 l=xE41 (fills the rest of the line with flashing red "AAAA"s.
Example write hex value syntax command
! CMB1 I=x5555
This will set every other output to 1, assuming the IO direction command has specified all signals as outputs.
Example write bit sequence (assuming direction for IO bit 5 is
set for outputs)
! CMB1 I4=x1
this will set bit 4 (of bits 0-15) to 1
! CMB1 P=X20 // sets bit 5 pulse rate to seconds
! CMB1 I5=x10
this will cause a low level pulse for about four seconds
! CMB1 M=x80 // unlock oscillate mode
! CMB1 P=x20 // sets bit 5 pulse rate to seconds
! CMB1 I5=x12
this will cause oscillation on IO bit 5, it will toggle about once every 4 seconds (8 second period).
HCS_C Combo Card Users Guide
HCS_C INDEX
7/2/2005:
PC_BOARD A.02 to A.03 update list
Here are the various HCS_C pages.
HCS_C Main Board Block Diagram