Writing floats to PG-4

Hi all,

Working with the PG-4, the current write command,
nnp.write(7, ‘1F57’, 4, uint8(50), ‘uint8’);
Currently only takes a unit8. Since 50 corresponds to 5 mA, that means a current like 750 uA would be 7.5, which rounds automatically up to 8 for 800 uA. Is there a way to specify floats here or does the unit8 type limit resolution to 100uA intervals?

Answer

The stimulation is limited to 100uA resolution on a few different fronts. NNP-API deals with uint8 data inputs for nnp.write(pg4node, '3212', channel, [pw pa]), the PG4 firmware deals with uint8, and the hardware corresponds with this–the digital-analog converter (DAC) currently uses 8/10 bits.

Alternative Option

For the current PG4 design, the only thing you could do to alter the current intervals is to make a hardware change at a feedback resistor in the PG4 output circuitry. The group at Scuola Superiore Sant’Anna did this for their pudendal nerve stim experiment, documented on the site here. This is obviously not possible right now for your implantable modules, but could be done on your benchtop kit and it could be a design change (component swap) baked into implanted modules for you in the future.

Future

The next version of the stimulating modules from us will have a bit more flexibility for changing current intervals. The next PG4 design will have a hardware limit of ~20uA current interval, but the plan was to keep the NNP-API and firmware consistent at 100uA. We’re taking this as important feedback for one of those modules, and we will scope out how we could scale the current range and intervals.

Additional Context for Others

@bscoventry is using this nnp.write command with the power module to set stimulation parameters in an alternative way. This command is indirectly setting stimulation parameters into a non-volatile section of memory, to be used on an as-needed basis to adjust. An automated script is pulling from this memory address in order to determine the stimulation parameters when entering stim mode. This allows stimulation parameters to be set once and the ON/OFF of stim to be handled by the script rather than having a computer running MATLAB present at all times to turn stim ON/OFF.