• AVR Freaks

Hot!PIC32MZ Interleaved ADC configuration

Author
Andey
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/04/11 01:27:13
  • Location: 0
  • Status: offline
2019/05/03 08:28:47 (permalink)
0

PIC32MZ Interleaved ADC configuration

Hello, all.
Can you please point me to a sample of interleaved ADC (4 channels) configuration with MICROCHIP IDE + HARMONY. 
#1

4 Replies Related Threads

    Paul PortSol
    Super Member
    • Total Posts : 471
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: PIC32MZ Interleaved ADC configuration 2019/05/03 09:12:45 (permalink)
    0
    Depends on the PIC32 type, best provide full part number.
    Also need versions of MPLABX, XC32, Harmony, MHC.
    What do you mean by interleaved?
     
    #2
    Andey
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2019/04/11 01:27:13
    • Location: 0
    • Status: offline
    Re: PIC32MZ Interleaved ADC configuration 2019/05/04 14:00:00 (permalink)
    0
    Hello. I have MPLAB X IDE 5.10 + MPLAB Harmony + PIC32MZ Embedded Connectivity with FPU (EF) Starter Kit (DM320007) with  PIC32MZ2048EFH144 chip.
    Documentation says that ADC can be programmed in interleaved mode. Link to document is: http://ww1.microchip.com/downloads/en/AppNotes/Worlds-Fastest-Embedded-Interleaved-12-bit-ADC-Using-PIC32MZ-and-PIC32MK-Families-DS00002785A.pdf
    Interleaved ADC mode is a special way to perform sampling up to 4 times faster. PIC32MZ has a number of ADC and it can be programmed to perform sampling from 4 ADC with preprogrammed time shift for each channel. So overall sampling rate can be increased up to 12,5 msps. Document in link contain sample code how to program it. But it seems that this document is old and it describes programming with direct registers access, not using modern MPLAB development tools.
    #3
    Howard Long
    Super Member
    • Total Posts : 677
    • Reward points : 0
    • Joined: 2005/04/04 08:50:32
    • Status: offline
    Re: PIC32MZ Interleaved ADC configuration 2019/05/04 16:05:53 (permalink)
    5 (1)
    Dump Harmony for ADC configuration and use bare metal is my very strong recommendation. You can still use Harmony for stuff like USB, ethernet, wifi and graphics, but for other stuff I just find myself spending more time second guessing and debugging the Harmony generated code.

    I use interleaving in one of my applications configured for a pair of triple interleaved ADCs with DMA.

    Edit: some code I wrote some time ago is already on the forum here: https://www.microchip.com/forums/m1079365.aspx
    post edited by Howard Long - 2019/05/04 16:09:27
    #4
    Mysil
    Super Member
    • Total Posts : 3327
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: PIC32MZ Interleaved ADC configuration 2019/05/04 16:33:36 (permalink)
    0
    Hi,
    I somehow suspect that, if there is not a button or an example in Harmony,
    that you will have to do this the hard way.
     
    The 12 bit SAR ADC in PIC32MZ__EF  and PIC32MK are very similar.
    There are also a number of Errata for the ADC modules, read the Errata document for the device you are using.
     
    In addition to the Application Note you have found,
    there is also the Family Reference Manual document: FRM Section 22, document  DS60001344D  or later revision.
    It have more description, and example code for some modes of operation.
     
    Even if the automatic interleaving, aka. Turbo mode, do not work,
    it may be possible to use staggered triggering using 2 or 3 timers, and 2 or more Output Compare modules.
     
        Mysil
     
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5