ohnoitsaninja
Well-known member
I'm trying to do this on some teensy-LCs.
I need to measure 3 light-dependent-resistor analog voltages and use the data to predict another number and send it out over usb midi.
The weak point in my project is the ADC code and accuracy. My schematic is currently as simple as can be with just the LDRs hooked up to 10k variable resistors for tuning, fed from the 3.3v line. I program in the arduino IDE and can't find/understand much on teensy ADC prescalers/speed/averaging. I have resorted to filling the almost all available memory with buffers for the ADCs and doing very slow software averaging to get better sensor data. I have used an arduino before to do real time audio sampling and effects, so I know that crazy high speed with acceptable accuracy can be reached, I just can't seem to get it setup on teensy. I can't find clear, working, documentation on how to use the adc prescaler and hardware averaging for teensy-lc.
I have limited knowledge on the analog circuitry front. I'ved tried throwing in some 22pf caps, I know I could benefit greatly from a better external ADC or op-amps but I'd like to make a lot of these and keep costs down. I've done some research into high speed sampling and oversampling, but much of the code samples I try are not compatible (ADCSRA not declared for example) with the teensy. Any help in any aspect of this design would be greatly appreciated.
I don't know enough on how to implement any of this easily, but I believe there to be useful stuff in the CMSIS DSP section that could speed this up. http://www.keil.com/pack/doc/CMSIS/DSP/html/index.html
I need to measure 3 light-dependent-resistor analog voltages and use the data to predict another number and send it out over usb midi.
The weak point in my project is the ADC code and accuracy. My schematic is currently as simple as can be with just the LDRs hooked up to 10k variable resistors for tuning, fed from the 3.3v line. I program in the arduino IDE and can't find/understand much on teensy ADC prescalers/speed/averaging. I have resorted to filling the almost all available memory with buffers for the ADCs and doing very slow software averaging to get better sensor data. I have used an arduino before to do real time audio sampling and effects, so I know that crazy high speed with acceptable accuracy can be reached, I just can't seem to get it setup on teensy. I can't find clear, working, documentation on how to use the adc prescaler and hardware averaging for teensy-lc.
I have limited knowledge on the analog circuitry front. I'ved tried throwing in some 22pf caps, I know I could benefit greatly from a better external ADC or op-amps but I'd like to make a lot of these and keep costs down. I've done some research into high speed sampling and oversampling, but much of the code samples I try are not compatible (ADCSRA not declared for example) with the teensy. Any help in any aspect of this design would be greatly appreciated.
I don't know enough on how to implement any of this easily, but I believe there to be useful stuff in the CMSIS DSP section that could speed this up. http://www.keil.com/pack/doc/CMSIS/DSP/html/index.html
Last edited: