Jump to content

Contributions:MicroLeadsADC

From BCI2000 Wiki

Introduction

MicroLeadsADC is a source module that allows for utilization of the Micro-Leads StimZ recording and stimulation device within BCI2000.

Versioning

Authors

  • Dhruva Mehta (mehta@neurotechcenter.org)

Version History

  • 2/10/2023 Initial Creation and Setup

Source Code Revisions

  • Initial development:
  • Tested under:
  • Known to compile under:
  • Broken since: --

Known Issues

Using the MicroLeads ADC

To use the MicroLeads ADC, you will need to have been provided with the basic hardware from Micro-Leads. Below we will go over the mandatory and optional hardware/software parts necessary to ensure a smooth use of the MicroLeads ADC.

Setting up the Hardware

Included Hardware

The following is a list of the hardware that should have been provided to you:

  • Wireless Implant
    • This is the implantable device that can record and stimulate wirelessly.
  • Powerpad with power cable
    • This is the device that allows for wireless charging of the implantable device.
  • Basestation with power cable
    • This is the device that communicates with the implant and the powerpad by sending commands, receiving information and data, and then relaying it to the router.
  • Wireless Router with power cable
    • The router is require for creating an ethernet sub-network for base station ethernet communication
  • Two Ethernet cables
    • Required to connect the basestation to the router and the router to the computer.
  • Ethernet to USB adapter
    • Optional adapter if the computer you are using does not have an ethernet port. Will be needed for verification with the Micro-Leads provided laptop.
  • Laptop with Micro-Leads Interface Software
    • This laptop should have the interface executable to use for initial device verification. It should also have the ***stimZ_config.ini*** that has the device information and properties.

Below are figures detailing what each device looks like with labels.

Hardware Setup

Considering how many cables and devices there are, it is helpful to have a step-by-step procedure to ensure that everything is set up smoothly.

Laptop

The first thing to set up is the laptop. Ensure that the laptop charger is plugged into an outlet and that the charger is plugged into the laptop.

Router

The next step is to set up the router.

First, plug the power adapter for the router into an outlet and then plug the power adapter into the router. Ensure that the router turns on.

Next, plug the ethernet to USB adapter into an open USB port on the laptop.

Finally, we will use one of the ethernet cables to connect the router and the laptop. Plug one end of the cable into the open port on the ethernet to USB adapter. Plug the other end of the cable into one of the 4 available black ports on the router. Do NOT plug it into the blue port.

Currently, our set up should look like this:

Basestation

Next we will set up the basestation.

First, ensure that the antenna is securely attached to the basestation. Use the shorter antenna.

Next, plug the power adapter into the outlet and then into the micro-usb port of the basestation.

Finally, we will use the other ethernet cable to connect the router to the basestation. Plug one end of the cable into the open ethernet port on the basestation. Then, similarly to the previous step, plug the other end of the cable into one of the 3 remaining available black ports on the router. Once again, do not plug it into the blue port.

Powerpad

Next we will set up the powerpad.

First, screw the power adapter onto the powerpad, ensuring that it is tightly attached.

Next, plug the power adapter into a wall outlet.

Test to see if the powerpad turns on by pressing the rubber power switch located on one of the short sides of the pad. The switch should light up blue when it is on. A square should also light up green, located to the left of the switch and the right of the location to screw the power adapter on.

Finally, attach the LONGER antenna to the powerpad by screwing it on.

With this, your initial setup should be complete! You should keep the powerpad and implant decently close to the basestation to ensure proper communication, but they don't need to be right next to each other.

System Level Setup

This section is only relevant to users with multiple devices.

The Micro-Leads system has capabilities for multiple device integration. You would follow the same steps as previous for each device.

However, there are limitations to the system overall when using multiple devices:

  • There can only be one router per laptop at a time.
  • There can only be one basestation per router at a time.
  • A basestation can connect to up to 7 powerpads simulataneously.
  • A basestation can connect to up to 7 implants simultaneously.
  • A powerpad can connect to only one basestation at a time.
  • An implant can connect to only one basestation at a time.
  • A basestation can only stream recording data from one implant at a time.
  • When a basestation is streaming recording data, it cannot communicate with any other powerpads or implants.
  • Two implants cannot share the same frequency/channel.

In essence, if you would like to stream recording data for multiple devices at once you need another full setup. This is because a basestation can only stream recording data from one implant at a time.

Otherwise, you may just need more powerpads and implants if you would like to switch between which device you are streaming recording data from.

Currently, MicroLeads ADC only supports one hardware setup at a time. However, if you have multiple hardware setups, you can still use BCI2000 with each. You would just need to have a PC with BCI2000 installed for each of them.

Verifying with Micro-Leads Software

At this point, all of the hardware should be set up to allow for communication and verification.

Initial Setup

First we will open up the interface executable on the provided laptop. This may be called Stim-Z-GUI or RHD2000Interface.

You should now see a GUI that looks similar to this:

Next, we will connect to the basestation. Click the pulldown menu that says "Select Base Station", and then click connect once you have it selected.

Next, click on the button in the lower left corner that says "Select Devices". A pop-up menu should appear that looks like this:

In this menu, select the devices on the left and click the middle arrow button. The devices should appear in the columns on the right like this:

Click "Confirm" to close the pop-up.

Next, click the "Pair Devices" button. Another pop-up menu should appear that looks like this:

On this menu, click the box labeled "Enable Charging". Then click "Scan". The scan will take a few seconds and take multiple tries to discover all devices. Discovered devices will be highlighted green while unverified devices will show up as red. If your implant has no charge, it may show up red for some time. In this case, you will need to charge the device which is discussed here.

At this time, you should be able to test your implant device.

Charging the Device

First, we will make sure that the device is charged.

Verifying Device Properties

How to set up with BCI2000

Creating a Batch File

Using MicroLeads ADC

User Settings

Understanding how it works

Communication Protocol

Packet Structures

Parameters

SourceCh

The total number of digitized and stored channels. Because of device limitations, this is set to 4 channels explicitly.

SampleBlockSize

Samples per channel per digitized block. Together with the sampling rate, this parameter determines how often per second data are collected, processed, and feedback is updated. For example, at 1000 Hz sampling and a SampleBlockSize of 20, the system (e.g., source signal display, signal processing, and stimulus presentation) will be updated 50 times per second.

SamplingRate

The sample rate of the system. This parameter cannot be edited, and will default to the sampling rate available from the implant which is 21500 Hz. In case you are experiencing problems by higher sampling rates (e.g., data loss, jerky display, etc.), increase the SampleBlockSize so that you are updating the system less frequently (usually, updating the system 20-30 times per second is sufficient for most applications).

SourceChOffset

Offset for each channel.

SourceChGain

Gain for each channel.

ChannelNames

Names of each channel.

ReferenceCh

This list defines what channels will be used as reference. This list is uploaded to the device and set in hardware, effecting the raw bio-signal data that is recorded by BCI2000. If you do not want to effect the raw bio-signal data that is recorded, you can use the spatial filter. If this parameter is set to auto, no reference channels are used.

Device Parameters

These parameters can be found in the "Device Settings" tab of the BCI2000 config window. These settings are provided to you from MicroLeads and are set for each device. If you were also provided a laptop from MicroLeads the settings may be found by navigating to the GUI configuration file, located at <user>/AppData/Roaming/RHD2000interface/config/stimZ_config.ini

Implant StimZ address

This parameter sets sets the StimZ address of the implant for use with BCI2000. This parameter is necessary to ensure that commands sent through BCI2000 are actually sent.

The possible values for this parameter are 0-13, and it will not be the same as the Powerpad StimZ address.

Powerpad StimZ address

This parameter sets sets the StimZ address of the powerpad for use with BCI2000. This parameter is necessary to ensure that commands sent through BCI2000 are actually sent.

The possible values for this parameter are 0-13, and it will not be the same as the Implant StimZ address.

Implant Radio Frequency Channel

This parameter sets sets the radio frequency channel of the implant for use with BCI2000. This parameter is necessary to ensure that commands sent through BCI2000 are actually sent.

The possible values for this parameter are 10, 20, 30, ... 80, and it will not be the same as the Powerpad Radio Frequency Channel.

Powerpad Radio Frequency Channel

This parameter sets sets the radio frequency channel of the powerpad for use with BCI2000. This parameter is necessary to ensure that commands sent through BCI2000 are actually sent.

The possible values for this parameter are 10, 20, 30, ... 80, and it will not be the same as the Implant Radio Frequency Channel.

Stimulation Parameters

These parameters can be found in the "Stimulation" tab of the BCI2000 config window.

Enable STIM0

This parameter enables/disables stimulation for the STIM0 channel.

Enable STIM1

This parameter enables/disables stimulation for the STIM1 channel.

Enable Recording

This parameter enables/disables streaming of neural data.

Supply Voltage

This parameter sets the supply voltage from a range of 4V to 9V. When the user is recording only, the voltage must be 4V. When the user is stimulating at all, the voltage must be 9V.

Stimulation Pulse Settings

This group of parameters define the shape of the charge balanced stimulation pulses, as described in Fig 1. Limitations will be detailed for each parameter. [[File: |600px|thumb|center|upright=2.5|Figure 1. Pulse definition]]

Phase1 Duration

This parameter sets the length of the Phase 1 Duration in counts of 11.6 microseconds. To obtain the proper value, divide your duration by 11.6 microseconds.

Interphase Duration

This parameter sets the length of the Interphase Duration in counts of 11.6 microseconds. To obtain the proper value, divide your duration by 11.6 microseconds.

Phase2 Duration

This parameter sets the length of the Phase 2 Duration in counts of 11.6 microseconds. To obtain the proper value, divide your duration by 11.6 microseconds.

Phase1 STIM0 Amplitude counts

This parameter sets the Phase 1 amplitude for the STIM0 channel in counts of 10 microAmps. To obtain the proper value, divide your amplitude by 10 microAmps.

Phase1 STIM1 Amplitude counts

This parameter sets the Phase 1 amplitude for the STIM1 channel in counts of 10 microAmps. To obtain the proper value, divide your amplitude by 10 microAmps.

Phase2 STIM0 Amplitude count

This parameter sets the Phase 2 amplitude for the STIM0 channel in counts of 10 microAmps. To obtain the proper value, divide your amplitude by 10 microAmps.

Phase2 STIM1 Amplitude count

This parameter sets the Phase 2 amplitude for the STIM1 channel in counts of 10 microAmps. To obtain the proper value, divide your amplitude by 10 microAmps.

Charge Recovery Counts

This parameter sets the length of the Charge Recovery Duration in counts of 11.6 microseconds. To obtain the proper value, divide your duration by 11.6 microseconds.

Stim Period Counts

This parameter sets the length of the Stim Period Duation in counts of 11.6 microseconds. To obtain the proper value, divide your duration by 11.6 microseconds.

ADC Gain

This parameter sets the ADC Gain. When recording only, set the parameter to 0. When stimulating, set the parameter to 1.

Exfil_Iface

This parameter sets the exfil settings. When recording only, set the parameter to 2. When stimulating, set the parameter to 0.

See also

User Reference:Filters, Contributions:ADCs