Help a beginner with ADC inputs

Status
Not open for further replies.

muggins

Well-known member
Hi
I have a project that requires inputs from DS18B20 temperature sensors, voltage measurements via analogue input, and a couple of other inputs using ADC.
My question is, if I put interrogations of these inputs in the loop function, is the Teensy capable of handling all of this as well as handling code to drive a servo, led outputs etc. I don't need microsecond updates of the inputs and wonder if it is better to have some sort of periodic reading of inputs at say 1 second intervals.
thanks
John
 
The Teensy 3.x is so quick that it can handle all that without problems, even if you write simple not very efficient code.
I'll give you an example from my current project : Taking 48000 16bit audio samples per second, "shoot" these through a 65 step polyphase finite impulse response filter for 4x oversampling, and thus outputting data with 192000 samples per second, "eats" about 30% of the CPU time.
 
Hi thanks for that. In my own loop one of the inputs needs to be sampled at 16 bit. I read somewhere that there was a library/fools guide for us novice Teensyduino folk.
I can't find it.
thanks
John
 
That is the ADC library which forum member Pevide has created. But you should be aware of the fact that although the 2 internal Delta-Sigma ADCs of the Teensy sample 16bit, only 12 or 13bit are significant because of noise and other side effects. If you need true 16bit, you should go for an external ADC with a separate filtered and buffered power supply.

Even if you are a beginner, you should never use a library without having read, studied and fully understood its source code. That is a good way to learn, and it has the advantage that debugging your code becomes a lot easier.
 
Status
Not open for further replies.
Back
Top