how to pick ports for analogRead () on T3.2

Status
Not open for further replies.

floating.

Well-known member
I remember reading here a while ago that depending on pin assignment, analog reads can take place either serially or in parallel.
I'm currently reading 2 analog sources, but it's possible that 1 or 2 more will be added as last minute features continue to cree-eep in....

What would be the best assignment for 2, 3, or 4 ports? I can use any port from A1 to A9. The other analog ports are either NC or used for something else.
 
Since the T3.2 has 2 internal ADCs which can be routed from different input pins, you can do a maximum simultaneous reading of only 2 pins. Reading more signals is possible, but it would need fast switching between different input pins. This can basically be done at high speed, so that the readings will appear pseudo-simultaneous, using DMA to store the actual reading away, using the DMA interrupt to reconfigure the ADC input channel and to trigger the next reading.
 
It also may depend on how you are reading the analog pins. That is if you are calling analogRead it does not return until that analog reading has completed.

If however you are using some other code like: the ADC library, than you have more control. More details about that library in the thread:
https://forum.pjrc.com/threads/25532-ADC-library-update-now-with-support-for-Teensy-3-1
And if you can choose two analog pins where one is on ADC0 and the other on ADC1, you can have booth of them reading at the same time.
 
I spread my analog channels over the two ADCs. E.g. if I use two channels, I make sure each one is on a different ADC. I do use analogRead, but if I ever find some time to upgrade my software with the ADC lib, at least the PCB routing doesn't prevent me from using simultaneous reads.
 
Thanks, I got it. Pedvide's drawing shows how the pins are hooked up. Apparently, all but two pins (A2, A3) I can use can be read only with ADC0.
 
Yes if you are restricted to only use the outer pins than A2/A3 are the only ones available on ADC1. Some other easy to use pins (A10, A11, A13) can also be used... And of course there are some on the bottom pins as well...
 
Hi Guys:
It has been a long time since I have posted to this forum, I hope you can see this question.
Is there a table or chart somewhere that shows which Analog Pins can be read from each A/D converter? I'm using A10 and A11 and I am not 100% certain which pin will work with ADC0 or ADC1.

Thanks,
Ed
 
Yes if you are restricted to only use the outer pins than A2/A3 are the only ones available on ADC1. Some other easy to use pins (A10, A11, A13) can also be used... And of course there are some on the bottom pins as well...
Currently, the only pins we use are those on the perimeter. We might incorporate the 4 through hole pins into the next rev, but I highly doubt we'll use the other bottom pins anytime soon.
 
Status
Not open for further replies.
Back
Top