Content originally posted in LPCWare by blasiis on Tue May 25 00:33:01 MST 2010
Quote: domen
The only sane way. :-)
I've done it recently (sampling channels, then stopping burst mode), and here's what I found out (no code here):
- disregard the example, you're WAY better off writing burst mode from scratch
- setup clocks, pins, enable adc on nvic, enable irq for [B]last[/B] of the converted channels
- when you want to start burst sampling just set burst chans, and enable burst mode in CR
- in irq, disable burst mode, read enabled channels
- if you follow the example... it's just wrong, you can't use that switch/case, because more than one channel can be finished on irq entry. Also seems wasteful to trigger interrupt for every channel.
So... this "works (tm)" for me, but there's still a problem. I'm consistently getting overruns on first channel (because burst is disabled too late, and the next channel gets sampled? but why, datasheet says all should get?).
I also tried just toggling BURST bit to start sampling... that didn't start the sampling.
I'm wondering what's the correct way to do this, since datasheet's description is a bit short and the example just plain wrong. :(
Thanks for your opinion; I have changed method: I convert only one analog input each 1 ms without using BURST, and in 8 ms i convert 8 different analog sequentially.
For my application is enough !!