ADC_CR_BURST Example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC_CR_BURST Example

723 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by blasiis on Mon May 24 05:03:45 MST 2010
I use LPC1758 with LPcXpresso.
I nedd to convert 6 analog input.
I think the correct way is to use the ADC_CR_BURST function and polling for reading.
Ther'is a example ?

Thanks
0 Kudos
Reply
2 Replies

711 Views
lpcware
NXP Employee
NXP Employee
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 !!
0 Kudos
Reply

711 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by domen on Mon May 24 23:03:18 MST 2010
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. :(
0 Kudos
Reply