Skip to content

Commit

Permalink
Remove call to ADC_readComparators in acquisition loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiegle committed Sep 3, 2024
1 parent 46ad07c commit 78a8035
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Source/Basestations/OneBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ void OneBox::initialize (bool signalChainIsLoading)

adcSource->initialize (signalChainIsLoading);

errorCode = Neuropixels::setSWTrigger (slot);
errorCode = Neuropixels::arm (slot);

if (errorCode != Neuropixels::SUCCESS)
{
LOGC ("Failed to arm OneBox on slot ", slot, ", error code = ", errorCode);
Expand Down
12 changes: 8 additions & 4 deletions Source/Probes/OneBoxADC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ OneBoxADC::OneBoxADC (Basestation* bs) : DataSource (bs)
ui = nullptr;

channel_count = NUM_ADCS;
sample_rate = 9500.0f;
sample_rate = 30300.5;

sourceType = DataSourceType::ADC;
status = SourceStatus::CONNECTED;
Expand All @@ -54,6 +54,13 @@ OneBoxADC::OneBoxADC (Basestation* bs) : DataSource (bs)
void OneBoxADC::initialize (bool signalChainIsLoading)
{
LOGD ("Initializing OneBoxADC");

errorCode = Neuropixels::ADC_enableProbe (basestation->slot, true);

if (errorCode != Neuropixels::SUCCESS)
{
LOGD ("Error enabling ADCs: ", errorCode);
}
}

void OneBoxADC::startAcquisition()
Expand Down Expand Up @@ -239,7 +246,6 @@ void OneBoxADC::run()

if (errorCode == Neuropixels::SUCCESS && count > 0)
{


for (int packetNum = 0; packetNum < count; packetNum++)
{
Expand All @@ -253,8 +259,6 @@ void OneBoxADC::run()
adcSamples[j * count + packetNum] = float (data[packetNum * NUM_ADCS + j]) * bitVolts; // convert to volts
}

Neuropixels::ADC_readComparators (basestation->slot, &adcThresholdStates);

sample_numbers[packetNum] = sample_number++;

}
Expand Down
2 changes: 1 addition & 1 deletion Source/Probes/OneBoxADC.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "../NeuropixComponents.h"

#define MAXPACKETS 64
#define NUM_ADCS 12
#define NUM_ADCS 24

class OneBoxInterface;

Expand Down

0 comments on commit 78a8035

Please sign in to comment.