The goal of this project is to get non-blocking analogRead()'s added to Arduino core libraries. I recently made a change to chipKIT-core libraries to add this feature. It had the surprising effect of making existing hardware 2.5 to 5 times faster.
1. The primary challenge this project addresses is the ability to wrangle hardheaded Arduino developers into taking pushes from down stream
2. I'm not sure I can solve this problem of hardheaded developers, not am I sure I want to being one myself, but I'll try.
3. This project makes the world better by breathing new life into old hardware!
4. See picture to the left.
5. These changes have already been published in the chipKIT-core repo, but a Arduino version is needed. https://github.com/chipkit32/chipKIT-core/ 6. BSD 3-Clause
Files
chipKIT-core 1.4.0 Non-Blocking Analog Reads.pdf
Original foils I created after implementing in chipKIT-core
Adobe Portable Document Format -
662.13 kB -
03/23/2017 at 20:29
If you only need a single channel, just need to turn on the free running mode in the ADC, then you can grab the latest results anytime you want. Most microcontrollers have something like this. On chips with DMA, just grab and process whole block of data. Some might even let you specify the channel sequence.
For a PID loop, you want to take the ADC snapshots from a hardware timer and not a software timing loop. Jitters in the sampling time affects the D term in a PID controller. Faster isn't necessarily better.
I use the D term quite a bit. It gets you a faster settling time while controlling the oscillations/overshoots. As with finite derivatives, it is unfortunately prone to noise. :(
If you only need a single channel, just need to turn on the free running mode in the ADC, then you can grab the latest results anytime you want. Most microcontrollers have something like this. On chips with DMA, just grab and process whole block of data. Some might even let you specify the channel sequence.
For a PID loop, you want to take the ADC snapshots from a hardware timer and not a software timing loop. Jitters in the sampling time affects the D term in a PID controller. Faster isn't necessarily better.
https://www.chiefdelphi.com/forums/archive/index.php/t-83734.html