MOD5441X/NANO54415 PeriodicAD Example

Post your example source code and application notes to share with others
Post Reply
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

MOD5441X/NANO54415 PeriodicAD Example

Post 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
Attachments
PeriodicAD_NANO54415.zip
(20.45 KiB) Downloaded 937 times
PeriodicAD_MOD5441X.zip
(19.95 KiB) Downloaded 1035 times
Dan Ciliske
Project Engineer
Netburner, Inc
mbaybutt
Posts: 11
Joined: Thu Dec 22, 2011 10:03 am

Re: MOD5441X/NANO54415 PeriodicAD Example

Post 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
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: MOD5441X/NANO54415 PeriodicAD Example

Post 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
Dan Ciliske
Project Engineer
Netburner, Inc
mbaybutt
Posts: 11
Joined: Thu Dec 22, 2011 10:03 am

Re: MOD5441X/NANO54415 PeriodicAD Example

Post 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
Bryon865
Posts: 1
Joined: Wed Nov 27, 2013 8:39 pm

Re: MOD5441X/NANO54415 PeriodicAD Example

Post by Bryon865 »

Great job.
jediengineer
Posts: 192
Joined: Mon Dec 17, 2012 6:24 am

Re: MOD5441X/NANO54415 PeriodicAD Example

Post 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.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: MOD5441X/NANO54415 PeriodicAD Example

Post by TomNB »

Yes, it is in the current release, 2.9.5.
Post Reply