How do I read 6 analog channels from a evkmimxrt11170 board

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read 6 analog channels from a evkmimxrt11170 board

Jump to solution
171 Views
GarageDirt
Contributor II

I have recently purchased a evkminxrt1170 board.  From the specs, this board has all the capabilities that I need for my project.  One key requirement is to make AD conversions of  6 analog channels at the fastest possible rate.  The ADC values can be stored in memory for later retrieval. 

 

In the SDK,  the example program "lpadc high sample rate sample signal cm7" appears to be exactly what I need.  With a slight modification of this program, I am able to get analog data from J26[2], store it, and print it out on a terminal .  Perfect.  However, there are some things that are confusing.  The program as written shows the DEMO LPADC CHANNEL NUM to be 0U,  and the DEMO DMA CHANNEL to be 0U also.  When built and run, with  pin select  as [R17] GPIO_AD_10,   I get ADC values printed out, but I have no idea what I am reading.   It appears to be a floating pin.   However, when I change both the channel number and  dma channel to 2U, I get data converted from J26[2].  I don't understand that at all.  Even though it makes no sense,  I can probably live with that.

 

The real problem is how do I read all 6 inputs on the J26 header and scan through them as fast as possible.  I have read for days, all the information online that I could find.  Much of the online information points you to fsl_lpadc.  Unfortunately,  I am not able to glean from those sources, a clear path forward in solving my problem, resulting in incredible frustration.

 

Here is the request.  Can someone supply code or snippets of necessary code that will allow for collection of analog data from 6 channels?  I would be nice if a complete working program similar to "lpadc high sample rate sample signal cm7" could be supplied, but any help what-so-ever would be appreciated.  I suspect there are others out there who have similar requirements.  If someone has already addressed this problem, and submitted an app or other document, I have not found it.

 

You would think that if nxp goes to all the effort to make this very nice device, they would also supply some knowledge on how to use it.

 

0 Kudos
1 Solution
113 Views
jingpan
NXP TechSupport
NXP TechSupport
0 Kudos
4 Replies
161 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @GarageDirt ,

LPADC1 channel 0 is mux to GPIO_AD_06. Please sample voltage by J9-10 pin. LPADC1 channel 2 is CH2A in demo, that is GPIO_AD_10. Please refer to 87.7.13.3 in page 6163 and table 11-1 in RM.

I can't find code or snippets of necessary code which can meet your request. If you want to scan 6 channels, you can use CMDHx.[NEXT] field to link 6 command to sample 6 channels. All the result will be stored in RESFIFO. Then you can set FIFO watermark to 6. When 6 samples are stored in FIFO, it can trig a DMA request. DMA read all data out from FIFO.

Please read Figure 87-3 for ADC command execution flow.

Regards,

Jing

0 Kudos
150 Views
GarageDirt
Contributor II

Hi Jing,

Thanks for fast reply.  I guess I have a basic problem.  In my problem with ADC, you refer to "87.7.13.3 in page 6163 and table 11-1 in RM".  So, my question is  .... what is that document, and where do I find it?

0 Kudos
153 Views
GarageDirt
Contributor II

Hi Jing,

Thanks for quick reply.  I have a basic problem.  In regards to your reply, you refer to "87.7.13.3 in page 6163 and table 11-1 in RM.  My question is ...... what is that document, and where can I find it?    I assume RM means Reference Manual.  In searching the nxp site, I don't find such a document.  Thanks

GD

 

0 Kudos
114 Views
jingpan
NXP TechSupport
NXP TechSupport
0 Kudos