Want to design your own software for
the Thoughtstream?
Below you'll find the data format.
SERIAL FORMAT FOR THE THOUGHTSTREAM
Baud rate 4800 : No parity : 8 data bits : 1 stop bit
The computer interface is optically isolated so power is supplied via the
DTR and RTS I/O lines from the computers serial port, though other means
can be used).
Using Visual Basic the following code will set the port up for communication
with the Thought Stream unit...
MSComm1.CommPort = PortNum 'Use ports (1,2,3 or 4)
MSComm1.Settings = "4800,N,8,1"
MSComm1.InputLen = 1
MSComm1.RThreshold = 1
MSComm1.InputMode = comInputModeText
MSComm1.PortOpen = True
MSComm1.DTREnable = False
MSComm1.RTSEnable = True
**************************************
A SERIAL BLOCK OF DATA IS SENT EVERY 0.5 SECONDS.
THE SERIAL BLOCK IS NINE BYTES LONG.
BYTE 1) ... 1st HEADER VALUE = $AA = 170 decimal
BYTE 2) ... 2nd HEADER VALUE = $AA = 170 decimal
BYTE 3) ... DEVICE CODE VALUE = 1
BYTE 4) ... RELAXATION VALUE
255 = ALL RED. IF = 0 THEN DISPLAY WILL BE ALL GREEN.
BYTE 5 & 6) CURRENT 12 BIT ADC VALUE RECORDED BY THE THOUGHT STREAM
BYTE 6) BITS 7-4 SHOULD BE ALL 0's. BITS 3-0 CONTAIN THE FOUR MOST
SIGNIFICANT BITS OF THE 12 BIT VALUE.
BYTE 5) CONTAINS THE EIGHT LSBs.
BYTE 7) STATUS OF THE THOUGHT STREAM
BIT ALLOCATIONS...
BIT 0) PROBE ERROR... SET IF RESISTANCE OF THE HAND PROBE IS OPEN
OR SHORTED. (If not correct in 10 seconds then TS unit will shut off)
BIT 1) LOW BATTERY... SET IF LOW BATTERY HAS BEEN DETECTED
(If Start/Stop button is not pushed within 10 seconds the unit will shut
off)
BIT 2) NEW DATA. SET IF DATA IN CURRENT BLOCK HAS BEEN UPDATED SINCE THE
LAST.
BIT 3) RECALCULATION HAS OCCURRED. SET IF THIS HAS HAPPENED...
(If the current probe resistance happens to go lower than the initial starting
resistance the TS would generate garbage values. To get around this the
TS recalculates everything and starts anew, assuming that the 'new' lower
resistance to be the beginning resistance. This wont effect byte 5 & 6
in anyway but bytes 4,8 and 9 will take on new significance.
BIT 4) Not Used
BIT 5,6 & 7) 3 BIT CODE REPRESENTING WHICH SENSITIVITY IS BEING USED
BIT 5 = LSbit : BIT 7 = MSb
BYTE 8 & 9) 12 BIT ADC VALUE OF THE STARTING PROBE RESISTANCE. THIS
WILL BE SET AT THE BEGINNING OF A SESSION OR IF THE THOUGHT STREAM UNIT
RE-CALIBRATES DURING A SESSION. BYTE 8) BITS 7-4 SHOULD BE ALL 0's. BITS
3-0 CONTAIN THE FOUR MOST SIGNIFICANT BITS OF THE 12 BIT VALUE.
BYTE 9) CONTAINS THE EIGHT LSBs. |