[Closed] D21G analogRead acquisition frequency
Hello Industruino users,
I would like to make high speed acquisition of analog sensors (20 kHz). I dug on the web some information about the clock frequency of the ADC that could be change thanks to the bits ADPS0, ADPS1 and ADPS2 (prescaler) of the ADCSRA register on Atmega 2560. The CTRLB register has the same features for the SAMD21G. The problem is that I cannot access the PRESCALER0, PRESCALER1 and PRESCALER2 bits of the CTRLB register (error: 'CTRLB' was not declared in this scope). So my question is : how can I access this register and change the prescale bits ? Does anyone already performed high frequency acquisitions with the Industruino ?
Thnaks for the help
Up !!
In fact the problem is due to the analogRead which takes a lot of time: 5 ms. How is this possible ? Registers manipulations do not seem to work, how can I speed that up ? Thanks for your reply. This is an important matter, I'm stuck here with this issue. I tried with a basic arduino Uno and analogRead can be reduced to 50 µs with registers manipulations. This is quite a gap between the Industruino ADC and the Uno ADC...
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 7/10/18, 7:40 AM |
Seen: 2267 times |
Last updated: 8/14/18, 7:25 AM |
As discussed by email: In our current architecture, these 4 channels are not directly connected to the ADC pins of the MCU. They pass through an expander over I2C, to get an isolated analog zone. You can have a look at the schematics in https://static.industruino.com/downloads/diagrams/Industruino_INDIO_D21G_pinout_map_April'17_S.pdf If you want to manipulate the ADC chip (using I2C commands) you can have a look at the standard Indio library https://github.com/Industruino/Indio/blob/master/src/Indio.cpp However, i think the current hardware limitation is 12bit@240SPS, 14bit@60SPS, 16bit@15SPS and 18bit@3.75SPS (samples per second) The UNO is faster, but only has 10-bit resolution, and most importantly, does not have isolation which is the main feature of our INDIO product.