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, 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. 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.
Solved! Go to Solution.
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 188.8.131.52 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.
Thanks for fast reply. I guess I have a basic problem. In my problem with ADC, you refer to "184.108.40.206 in page 6163 and table 11-1 in RM". So, my question is .... what is that document, and where do I find it?
Thanks for quick reply. I have a basic problem. In regards to your reply, you refer to "220.127.116.11 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