Re: Question for Hardware Guys

From: sleeper75se (sleeper75se_at_yahoo.se)
Date: 2002-03-08 05:37:13


Hi John,

my device is not exactly up and running yet (too busy these past few
days to even make some progress...) so I have not implemented any
protocol. Also, I will take care of the details myself so you don't
have to worry about the specific data coming into the serial port.

Anyway, since you asked, here's the preliminary data format. The
firmware source code for it is written, but completely untested...

>From the source code file: -----------------------------

Transmission protocol for 4 channels, 12-bits at a data rate of 512
Hz per channel. Bitrate is 57600bps.

Data frame (this could be formatted in a nice nine-column table.)

0: Bit 7-1: Channel 0 bits 11-5, bit 0: SYNC=1
1: Bit 7-3: Channel 0 bits 4-0, bit 2: BAT, bit 1: ID, bit 0: SYNC=0

2: Bit 7-1: Channel 0 bits 11-5, bit 0: SYNC=0
3: Bit 7-3: Channel 0 bits 4-0, bit 2-1: AUX 1-0, bit 0: SYNC=0

4: Bit 7-1: Channel 0 bits 11-5, bit 0: SYNC=0
5: Bit 7-3: Channel 0 bits 4-0, bit 2: TEMP, bit 1: ESR, bit 0: SYNC=0

6: Bit 7-1: Channel 0 bits 11-5, bit 0: SYNC=0
7: Bit 7-3: Channel 0 bits 4-0, bit 2-1: not used, bit 0: SYNC=0

BAT: low battery indicator
ID: identification data bitstream. This is a repeatedly transmitted
bitstream containing an ASCII-string identifying the device. The
string begins and ends with 0xfe 0xff which provides synchronization.
MSB is transmitted first.
AUX1, AUX0: State of two pins (PD3/PD2) on the microcontroller,
sampled at the beginning of the frame. For general purpose use, such
as switches and event markers.
TEMP: transmits a temperature bitstream. (not implemented, exact
format is TBD).
ESR: transmits an ESR bitstream. (not implemented)

-------------------------------------

There are a few commands you can issue. None are actually transmitted
to the hardware but handled within my acquisition class (the
hardware abstraction layer, if you will).

"Initialize" waits for the ID-string to come in. Will fail if it
doesn't, within a certain amount of time.
"Get hardware info" would return the identification string.
"Set/Get samplerate" sets/gets the sample-rate for the individual
channels. This is done by downsampling the 512Hz signal to whatever
you set.

... to be expanded.

How the data-transfer mechanism looks is up to you (I prefer filling
a std::vector<float> with data by the way), but there will be four 12-
bit channels with EEG or other data, and I'm making provisions for
adding a temperature and ESR/GSR board later, for a total of six
channels. The hardware actually supports eight channels, so in total
there might be ten streams of data that needs to be taken care of,
but then the frame will look slightly different.

Regards,

Andreas



This archive was generated by hypermail 2.1.4 : 2002-07-27 12:28:40 BST