@DavidL
Manual/Direct control mode will not be able to achieve as high sample rate as the firmware based tests which are paced by the microcontroller on the teensy 3.2. So your best bet for higher frequency sampling is to use one of the firmware based tests. Manual/Direct mode is paced via software on the PC and at each step it requires setting the voltage and then requesting the current. Each of these requires sending a command to the teensy followed by a wait for the response. This limits the sample rate quite a bit. In contrast, with the firmware based tests, the teensy just streams the data to the host PC - so we can achieve higher sample rates. The highest sample rate I can acheive with Manual/Direct mode on my PC here is about 60Hz (the results will probably vary with your hardware). Whereas with the firmware based test I can get 1000Hz.
If you are trying to measure the impedance of the cell - then I'm guessing you might be testing with sinusoids in order to put together something like a Bode plot (https://en.wikipedia.org/wiki/Bode_plot) ? If that is the case then maybe the firmware based 'sinusoid' test will work for you. This test outputs a sine wave and you can set the amplitude, period, phase (shift), offset, etc. I've attached an example below showing how to run the firmware based 'sinusoid' test at 1000Hz sample rate.
from __future__ import print_function
from potentiostat import Potentiostat
import matplotlib.pyplot as plt
port = '/dev/ttyACM0'
dev = Potentiostat(port)
dev.set_curr_range('100uA')
dev.set_sample_rate(1000)
name = 'sinusoid'
param = {
'quietValue' : 0.0,
'quietTime' : 0,
'amplitude' : 2.0,
'offset' : 0.0,
'period' : 100,
'numCycles' : 5,
'shift' : 0.0,
}
dev.set_param(name,param)
t,volt,curr = dev.run_test(name,display='pbar')
plt.figure(1)
plt.subplot(2,1,1)
plt.plot(t,volt,'b')
plt.ylabel('(V)')
plt.grid('on')
plt.subplot(2,1,2)
plt.plot(t,curr,'b')
plt.ylabel('uA)')
plt.xlabel('(s)')
plt.grid('on')
plt.show()
The above test outputs a sine wave with 100ms period, 2V amplitude (goes from -2V to 2V) and no DC offset. The data are sampled at 1000Hz.
Note, depending on your system you might start to drop samples above 500Hz - so you might want to examine the time points. This will usually happen with longer tests and high sample rates.
With respect to achieving even higher sample rates e.g. 2000Hz, the teensy 3.2 is definitely capable of it. However, achieving this would require some modifications to the firmware.