Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enablePGA doesn't work on second adc #52

Closed
paulhayes opened this issue Apr 7, 2020 · 5 comments
Closed

enablePGA doesn't work on second adc #52

paulhayes opened this issue Apr 7, 2020 · 5 comments

Comments

@paulhayes
Copy link
Contributor

When using continuous differencial reading on adc1 I get the error
Error ADC1: Wrong pin
But only if I try to enable the PGA. If I omit the call to enablePGA it works, and it works if using adc0. Is this expected?

  adc->adc1->enablePGA(1);
  adc->adc1->setAveraging(32); // set number of averages
  adc->adc1->setResolution(16); // set bits of resolution
  adc->adc1->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED); // change the conversion speed
  adc->adc1->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED); // change the sampling speed
  
  adc->adc1->enableInterrupts(adc1_isr);
  adc->startContinuousDifferential(A10,A11,ADC_1);
@pedvide
Copy link
Owner

pedvide commented Apr 11, 2020

What board is this?

@paulhayes
Copy link
Contributor Author

Sorry this was on a Teensy 3.2

@EclipseBoom
Copy link

Unless I'm reading the RefMan wrong PGA0 only connects to ADC0. So even though you can get differential inputs for ADC1 on these pins (9,10) you can't connect the PGA0 to ADC1.

If that is true then the "wrong pin" error is correct.

I think that's right...

@paulhayes
Copy link
Contributor Author

ah thanks. I didn't know.

@pedvide
Copy link
Owner

pedvide commented May 27, 2020

Sorry, for the delay, yeah, that's correct. I think the image on the forum post shows this.

@pedvide pedvide closed this as completed May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants