Page 1 of 1

MOD5441X/NANO54415 PeriodicAD Example

Posted: Wed Mar 06, 2013 5:49 pm
by dciliske
Periodic is a buffering Analog to Digital example which samples at a given frequency on the selected channel. It also creates a .wav file of the samples it made.

Code: Select all

/******************************************************************************
 *
 * PeriodicAD - DMA Driven, periodic sampling Analog to Digital example
 *   
 *  This example shows how to setup a periodic sampling Analog to Digital 
 *  conversion with buffering. It uses the onboard Analog to Digital Converter
 *  in loop mode to continuously sample. It then utilizes the DMA Timer to 
 *  trigger a dma transfer from the selected ADC channel, to the next location 
 *  in the sample buffer. The example includes interrupt triggers at a half-full
 *  and completely full buffer. Finally, the specific result of the application
 *  is to sample for some period of time, record the data to an output .wav file,
 *  and repeat.  
 *
 *****************************************************************************/
[Edit] The two platform examples are the same for the A/D code, they simply vary in their filesystem utilities (the MOD5441X use a different style than other platforms).

-Dan

Re: MOD5441X/NANO54415 PeriodicAD Example

Posted: Wed May 29, 2013 5:04 pm
by mbaybutt
Hi Dan,

Great example code, thanks for developing it and posting it! One comment and one question...

Comment:
Both versions of code make use of the "dspi.h" header. I am currently running the latest stable release of NBEclipse of 2.6. Searching around the forum it appears this header and more advanced support for SPI interface was introduced in later more recent packages of NBEclipse (i.e. 2.6.1). Not a biggie, but just figured I would mention this doesn't compile "right out of the box" with 2.6. Unless I missed something?

Question:
The function calls to the ADC manipulate the low level sim structs. Not a problem, but I was curious if there was an abstraction of this in the Nano54415 driver code? I looked through the runtime library manual and there wasn't any mention of higher level function calls. If it doesn't exist now, is this on the development road map? Nevertheless, low level register manipulation is always good in my book :)

Thanks,

- Mark

Re: MOD5441X/NANO54415 PeriodicAD Example

Posted: Thu May 30, 2013 9:02 am
by dciliske
... Not sure why I had the dspi header included. I guess I started from the DSPI2Serial app? As for the low level manipulation, no, there is not a roadmap for a system level driver to do this. Perhaps if this finds enough use, it may get there (a la the Stopwatch util becoming the HiResTimer), but not now.

-Dan

Re: MOD5441X/NANO54415 PeriodicAD Example

Posted: Thu May 30, 2013 9:34 am
by mbaybutt
Got it, thanks for the speedy reply! The evolution of the Stopwatch utility into HiResTimer was great... it has become a key component to hitting timing in one application I'm working. If I make (quality) headway on implementing an abstraction layer for the ADC, I'll be sure to post it!

Thanks,

- Mark

Re: MOD5441X/NANO54415 PeriodicAD Example

Posted: Wed Nov 27, 2013 8:41 pm
by Bryon865
Great job.

Re: MOD5441X/NANO54415 PeriodicAD Example

Posted: Mon May 31, 2021 4:10 am
by jediengineer
Did this ever get itself worked into NBEclipse? I couldn't find an example file, only a header, but there wasn't much in there to go with.

Re: MOD5441X/NANO54415 PeriodicAD Example

Posted: Fri Jun 04, 2021 2:37 pm
by TomNB
Yes, it is in the current release, 2.9.5.