Thank you very much for getting this going! I think I installed it as directed, but I am wondering which examples should work.
"adc_pdb" only works if you comment out the pdb_isr() function, which I guess is what you meant about not needing a separate one to clear the interrupt.
Code:
adc_pdb: In function 'void pdb_isr()':
adc_pdb:113: error: 'PDB0_SC' was not declared in this scope
PDB0_SC &=~PDB_SC_PDBIF; // clear interrupt
"analogReadIntervalTimer" fails to compile with this error:
Code:
analogReadIntervalTimer:188: error: 'ADC0_SC1A' was not declared in this scope
uint8_t pin = ADC::sc1a2channelADC0[ADC0_SC1A&ADC_SC1A_CHANNELS]; // the bits 0-4 of ADC0_SC1A have the channel
Do you have an example of some working code with the new T4 ADC library using PDB?
I have a very precise and stable oscillator which can generate for example 1 kHz or 10 kHz output. I could get a batch of samples at a fixed rate using PDB, and then take a FFT of the output and look at the spectrum. Any instability in the effective sampling rate would show up as a wider spectral peak, or sidebands of some kind.
I tried a version of the adc_pdb example uncommenting the line in the adc0_isr() to blink the LED:
Code:
void adc0_isr() {
adc->adc0->readSingle();
digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) );
}
and with a 1000 Hz sample rate there is no obvious jitter on the scope; less than a microsecond anyway.