Jump to content

Contributions:RHX

From BCI2000 Wiki

Synopsis

The Intan RHS has four SPI ports (with each port labelled A,B,C,D) which can program, stimulate, and record data from connected RHS chips. Each chip controls 16 channels, with up to two chips per port. Over all four ports, a total of 8 chips (128 channels) can be simultaneously controlled.

The expansion board includes up to 16 digital input and output channels and 8 analog input (ADC) and output channels (DAC). The digital and analog outputs can be programmed for stimulation, and the data from the digital and analog inputs can be recorded.

The digital input and output data are recorded in two streams ("DigIn" and "DigOut", respectively). These streams consist of 16 bit unsigned integers with each bit representing the logic input/output. These values are computed in MSb format, with the greatest bit being controlled by channel 0. For example, a logic pulse recorded by channel 0 would result in a value of 2^15 (=1000 0000 0000 0000), while a logic pulse recorded from channel 15 would result in a value of 2^0 (=0000 0000 0000 0001).

Similarly, stimulation information from each headstage is recorded in the streams: "HeadstageAStim": The bit for the corresponding channel is set to 1 if stimulating, 0 otherwise. "HeadstageAChargeRecov": The bit for the corresponding channel is set to 1 if charge recovery is active, 0 otherwise "HeadstageAStimPol": The bit for the corresponding channel is set to 1 if the stimulation current is positive, 0 if negative or inactive "HeadstageAAmpSettle": The bit for the corresponding channel is set to 1 if the amplifier settle circuitry is active, 0 otherwise. ... (Repeated for headstages A-D)

Each of these streams contains a 32 bit unsigned integer, with a similar format to the "DigIn" and "DigOut" streams--for example, if channel 0 on headstage A is currently stimulating, a value of 2^31 will be recorded to "HeadstageAStim", and if channel 31 on headstage A is currently stimulating a value of 2^0 will be recorded to "HeadstageAStim".

Parameters

SamplingRate: Due to the RHS's ability to only take on discrete sampling rates, a value matching one of the following must be used for this parameter (given in Hz): 1000, 1250, 1500, 2000, 2500, 3000, 3333, 4000, 5000, 6250, 8000, 10000, 12500, 15000,20000 ,25000, 30000.

SampleBlockSize: The API provided by Intan only reads data in chunks of 128. Therefore, values that are multiples of 128 must be used for this parameter.

RHSAmpChannels: A list of headtsage channels which will be recorded from. The value of the first channel on headstage A is taken to be 0, and the final channel on headstage D is taken to be 127. Accepted formats are of the following form: For a range of sequential channels, an input of "A-B" will result in the configuration being uploaded to channels A,A+1...B. For a single channel, one may simply input the channel number as "A". For channels that are not sequential, one may input "{A-B,C,D-E,..}". This will upload the configuration to channels A,A+1..B,C,D,D+1...E... . Lists of this form must use commas to separate channel values/ranges.

For example, an entry of {0-8,32-35} will record from the first 9 channels on headstage A, and the first 4 channels on headstage B.


Stimulation Configuration Parameters (note: all text is case insensitive, and any non-applicable parameters can be left empty. Further, all values are rounded to multiples of the sampling period and stimulation step size!):

Channels: Specifies the channels which the configuration applies to. The accepted formats are the same as for RHSAmpChannels.

Trigger: Specifies the source which triggers stimulation. This can either be one of the digital or analog inputs, or a state. Accepted input is: "digx", "anax", or "state", where x is an integer between 1 and 8 (all independent of capitalization). If "state" is used, "State Trigger Value" must be specified.

Trigger State: The name of the expression to trigger stimulation. This does not necessarily have to be a state, for example the "KeyDown" is a valid entry. If not using a state trigger, this can be left empty.

State Trigger Value: If using a state as a trigger, this section determines the condition for the state to trigger stimulation. If not, this can be left as empty.

Edge/Level: Specifies whether stimulation is edge or level triggered. Supported entries are "edge" or "level".

High/Low: Specifies whether stimulation is triggered on high or low. Supported entries are "high" or "low".

Trigger Delay: Specifies the duration of time between the trigger and first phase of stimulation. The expected format is a value along with a unit, for example "10ms", "10 ms", "100 us". Accepted units are ns,us,ms,s. If no unit is provided, the default is us.

Amp Settle Start: Specifies the time before the first phase of stimulation in which the amplifier settle circuitry is activated. This value must not exceed Trigger Delay. The expected format is the same as Trigger Delay.

Phase 1 Duration: Specifies the duration for the first phase of stimulation. The expected format is the same as Trigger Delay.

Phase 2 Duration: Specifies the duration for the second phase of stimulation. The expected format is the same as Trigger Delay.

Phase 3 Duration: Specifies the duration for the third phase of stimulation. The expected format is the same as Trigger Delay. This parameter only needs to be defined for a triphasic waveform, otherwise can be left blank.

Amp Settle End: Specifies the duration after the final phase of stimulation at which the amplifier settle circuitry is deactivated. The expected format is the same as Trigger Delay.

Num Pulses: Specifies the number of stimulation pulses after a trigger event.

Pulse Period: Specifies the period of the stimulation waveform. The trigger delay is not factored. For example, a biphasic waveform with a phase 1 duration of 100us, a phase 2 duration of 100us, and a pulse period of 300us will look like a biphasic waveform with a 100us delay following the second phase before repeating (regardless of the trigger delay).

Post Stim Recovery Delay: Specifies the duration after the last phase of the final pulse at which the charge recovery circuitry will be activated. The expected format is the same as Trigger Delay.

Post Stim Recovery Duration: Specifies the duration for which charge recovery will be active. The expected format is the same as Trigger Delay.

Refractory Duration: Specifies the duration after either charge recovery is deactivated (if this charge recovery parameters were set), or after the end of stimulation (otherwise).