• AVR Freaks

Hot!What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0

Author
MisterHemi
Super Member
  • Total Posts : 258
  • Reward points : 0
  • Joined: 2017/11/02 12:24:21
  • Location: Commerce, CA USA
  • Status: offline
2020/01/24 17:18:16 (permalink)
0

What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0

Hello,
 
I have this board and from what I understand the only two changes I need to make are to:
 

#pragma config ICESEL = ICS_PGx1
#pragma config UPLLFSEL = FREQ_12MHZ

and it should run albeit at a slower rate because the settings for the Version 1 board were for a 24MHz clock and the Version 2 board has a 12MHz clock (I wonder why they decided to change it).
 
However after programming the board it's inactive/dead.
 
So i'm wondering what else may need to be changed/configured?
 
 

My configuration:
MacBook Pro (Retina, 15-inch, Mid 2015) with MacOS Mojave (10.14.6) and MPLAB X IDE v5.30
 
Curiosity PIC32MZ EF 1 & 2, PIC24F Curiosity, XPRESS EVAL BOARD (PIC16F18855), SAMA5D3 Xplained and various custom boards.
#1

7 Replies Related Threads

    ibbro
    Starting Member
    • Total Posts : 87
    • Reward points : 0
    • Joined: 2015/10/22 07:34:56
    • Location: 0
    • Status: offline
    Re: What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0 2020/01/24 17:53:45 (permalink)
    0
    I'm successfully using those boards in Harmony. Using the clock configurator in Harmony with the external 12mhz  SYSCLk can be set to 198mhz so it doesn't change that much from the 200mhz obtainable with a 24mhz clock. It has been a while since I have done a startup configuration by hand, but there are many more pragma settings to get the clock you want than the just one you spec'd. I'd recommend taking a look at a sample Harmony V3 project for the curiosity 2 board and getting the clock config from that if you are writing from scratch.
     
    There are not many examples in Harmony 3 for the curiosity 2 board, cdc_com_port_single is one. You could get working clock pragma from it for 198mhz.
     
    -IB
    #2
    MisterHemi
    Super Member
    • Total Posts : 258
    • Reward points : 0
    • Joined: 2017/11/02 12:24:21
    • Location: Commerce, CA USA
    • Status: offline
    Re: What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0 2020/01/24 18:04:33 (permalink)
    0
    Thanks. I'll try to locate the sample projects and get the pragmas from there.

    My configuration:
    MacBook Pro (Retina, 15-inch, Mid 2015) with MacOS Mojave (10.14.6) and MPLAB X IDE v5.30
     
    Curiosity PIC32MZ EF 1 & 2, PIC24F Curiosity, XPRESS EVAL BOARD (PIC16F18855), SAMA5D3 Xplained and various custom boards.
    #3
    Mysil
    Super Member
    • Total Posts : 3671
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0 2020/01/24 18:23:42 (permalink)
    5 (1)
    Hi,
    There is also WatchDog Timer  (WDT)   and  DeadManTimer (DMT) 
    that may need to be Disabled in configuration bits, if you are not prepared to deal with them in software.
     
    Then JTAG interface is 4 pins, and may be disabled in configuration bits, if those pins are going to be used.
    This may also be done by SFR register in the running program.
     
    In:  /docs  directory installed together with XC32 compiler, there are .html   files
    with documentation of configuration bits for all PIC32  devices.
     
        Mysil
    #4
    MisterHemi
    Super Member
    • Total Posts : 258
    • Reward points : 0
    • Joined: 2017/11/02 12:24:21
    • Location: Commerce, CA USA
    • Status: offline
    Re: What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0 2020/02/03 12:19:02 (permalink)
    0
    Mysil
    Hi,
    There is also WatchDog Timer  (WDT)   and  DeadManTimer (DMT) 
    that may need to be Disabled in configuration bits, if you are not prepared to deal with them in software.
     
    Then JTAG interface is 4 pins, and may be disabled in configuration bits, if those pins are going to be used.
    This may also be done by SFR register in the running program.
     
    In:  /docs  directory installed together with XC32 compiler, there are .html   files
    with documentation of configuration bits for all PIC32  devices.
     
        Mysil



    Thank you, i'll check those too.
     
    FYI for anyone needing this here's what I found:
     

    /*** DEVCFG0 ***/
    #pragma config DEBUG = OFF
    #pragma config JTAGEN = OFF
    #pragma config ICESEL = ICS_PGx1
    #pragma config TRCEN = OFF
    #pragma config BOOTISA = MIPS32
    #pragma config FECCCON = OFF_UNLOCKED
    #pragma config FSLEEP = OFF
    #pragma config DBGPER = PG_ALL
    #pragma config SMCLR = MCLR_NORM
    #pragma config SOSCGAIN = GAIN_LEVEL_3
    #pragma config SOSCBOOST = ON
    #pragma config POSCGAIN = GAIN_LEVEL_3
    #pragma config POSCBOOST = ON
    #pragma config EJTAGBEN = NORMAL
    #pragma config CP = OFF
    /*** DEVCFG1 ***/
    #pragma config FNOSC = SPLL
    #pragma config DMTINTV = WIN_127_128
    #pragma config FSOSCEN = OFF
    #pragma config IESO = OFF
    #pragma config POSCMOD = EC
    #pragma config OSCIOFNC = OFF
    #pragma config FCKSM = CSECME
    #pragma config WDTPS = PS1048576
    #pragma config WDTSPGM = STOP
    #pragma config FWDTEN = OFF
    #pragma config WINDIS = NORMAL
    #pragma config FWDTWINSZ = WINSZ_25
    #pragma config DMTCNT = DMT31
    #pragma config FDMTEN = OFF
    /*** DEVCFG2 ***/
    #pragma config FPLLIDIV = DIV_1
    #pragma config FPLLRNG = RANGE_8_16_MHZ
    #pragma config FPLLICLK = PLL_POSC
    #pragma config FPLLMULT = MUL_33
    #pragma config FPLLODIV = DIV_2
    #pragma config UPLLFSEL = FREQ_12MHZ
    /*** DEVCFG3 ***/
    #pragma config USERID = 0xffff
    #pragma config FMIIEN = ON
    #pragma config FETHIO = ON
    #pragma config PGL1WAY = ON
    #pragma config PMDL1WAY = ON
    #pragma config IOL1WAY = ON
    #pragma config FUSBIDIO = ON
    /*** BF1SEQ0 ***/
    #pragma config TSEQ = 0xffff
    #pragma config CSEQ = 0x0

     
    You might want to check the settings as Mysil stated and TSEQ and CSEQ.

    My configuration:
    MacBook Pro (Retina, 15-inch, Mid 2015) with MacOS Mojave (10.14.6) and MPLAB X IDE v5.30
     
    Curiosity PIC32MZ EF 1 & 2, PIC24F Curiosity, XPRESS EVAL BOARD (PIC16F18855), SAMA5D3 Xplained and various custom boards.
    #5
    MisterHemi
    Super Member
    • Total Posts : 258
    • Reward points : 0
    • Joined: 2017/11/02 12:24:21
    • Location: Commerce, CA USA
    • Status: offline
    Re: What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0 2020/02/15 11:19:03 (permalink)
    0
    ibbrowning
    I'm successfully using those boards in Harmony. Using the clock configurator in Harmony with the external 12mhz  SYSCLk can be set to 198mhz so it doesn't change that much from the 200mhz obtainable with a 24mhz clock. It has been a while since I have done a startup configuration by hand, but there are many more pragma settings to get the clock you want than the just one you spec'd. I'd recommend taking a look at a sample Harmony V3 project for the curiosity 2 board and getting the clock config from that if you are writing from scratch.
     
    There are not many examples in Harmony 3 for the curiosity 2 board, cdc_com_port_single is one. You could get working clock pragma from it for 198mhz.
     
    -IB




    I found a post on the forum that has the settings to make the board run correctly at 200MHZ instead of 198MHZ.
     
    Here's the link: https://www.microchip.com/forums/FindPost/1125395
     
    I'm using these pragmas and they work fine.

    My configuration:
    MacBook Pro (Retina, 15-inch, Mid 2015) with MacOS Mojave (10.14.6) and MPLAB X IDE v5.30
     
    Curiosity PIC32MZ EF 1 & 2, PIC24F Curiosity, XPRESS EVAL BOARD (PIC16F18855), SAMA5D3 Xplained and various custom boards.
    #6
    simong123
    Lab Member No. 003
    • Total Posts : 1391
    • Reward points : 0
    • Joined: 2012/02/07 18:21:03
    • Location: Future Gadget Lab (UK Branch)
    • Status: offline
    Re: What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0 2020/02/15 14:46:09 (permalink)
    0
    MisterHemi
    I found a post on the forum that has the settings to make the board run correctly at 200MHZ instead of 198MHZ.

     
    Those settings run the PLL out of spec., so 'correctly' is debateable. The specified minimum PLL input frequency for the 'MZ is 5MHz, 12MHz/3 = 4MHz.
    It is not possible to run the 'MZ at 200MHz with a 12MHz oscillator as PRI clk and stay in spec. The only way you can do this and stay in spec is run the USB off the PRI oscillator and the system of FRC. Not good if you require accurate frequencies for other things though.
    MCHP should not have changed from a 24MHz oscillator on the curiosity. Someone obviously didn't think it through. :-<
    #pragma config FPLLIDIV = DIV_1         // System PLL Input Divider (1x Divider)
    #pragma config FPLLRNG = RANGE_8_16_MHZ // System PLL Input Range (8-16 MHz Input)
    #pragma config FPLLICLK = PLL_FRC       // System PLL Input Clock Selection (FRC is input to the System PLL)
    #pragma config FPLLMULT = MUL_50        // System PLL Multiplier (PLL Multiply by 50)
    #pragma config FPLLODIV = DIV_2         // System PLL Output Clock Divider (2x Divider)
    #pragma config UPLLFSEL = FREQ_12MHZ    // USB PLL Input Frequency Selection (USB PLL input is 12 MHz)

    #7
    MisterHemi
    Super Member
    • Total Posts : 258
    • Reward points : 0
    • Joined: 2017/11/02 12:24:21
    • Location: Commerce, CA USA
    • Status: offline
    Re: What are the pragmas for the Curiosity PIC32MZEF Dev Board 2.0 2020/02/17 04:01:21 (permalink)
    0
    simong123
    MisterHemi
    I found a post on the forum that has the settings to make the board run correctly at 200MHZ instead of 198MHZ.

     
    Those settings run the PLL out of spec., so 'correctly' is debateable. The specified minimum PLL input frequency for the 'MZ is 5MHz, 12MHz/3 = 4MHz.
    It is not possible to run the 'MZ at 200MHz with a 12MHz oscillator as PRI clk and stay in spec. The only way you can do this and stay in spec is run the USB off the PRI oscillator and the system of FRC. Not good if you require accurate frequencies for other things though.
    MCHP should not have changed from a 24MHz oscillator on the curiosity. Someone obviously didn't think it through. :-<
    #pragma config FPLLIDIV = DIV_1         // System PLL Input Divider (1x Divider)
    #pragma config FPLLRNG = RANGE_8_16_MHZ // System PLL Input Range (8-16 MHz Input)
    #pragma config FPLLICLK = PLL_FRC       // System PLL Input Clock Selection (FRC is input to the System PLL)
    #pragma config FPLLMULT = MUL_50        // System PLL Multiplier (PLL Multiply by 50)
    #pragma config FPLLODIV = DIV_2         // System PLL Output Clock Divider (2x Divider)
    #pragma config UPLLFSEL = FREQ_12MHZ    // USB PLL Input Frequency Selection (USB PLL input is 12 MHz)





    I see... glad you noticed that.
     
    Yes they didn't think things through and I wondered why they made so many changes from version 1 to version 2.
     
    For example on the version 1 board I use both I2C-1 and I2C-2 from the mikroBUS headers but now the both share I2C-1 and I can't seem to access I2C-2 anywhere (I posted about that here: https://www.microchip.com/forums/m1128481.aspx ) so that's a problem for me and sometimes I have problems with some of my I2C devices now too.

    I do prefer the 144 pin package over the 100 pin version, due to more I/O and that's the one I use for some projects too.
     
    There are some improvements admittedly, for example my USB stack enumerates faster for some reason on the version 2 board and on my version 1 board it wouldn't enumerate through a hub but now it does.
     
    It's kind of hit and miss :-/

    My configuration:
    MacBook Pro (Retina, 15-inch, Mid 2015) with MacOS Mojave (10.14.6) and MPLAB X IDE v5.30
     
    Curiosity PIC32MZ EF 1 & 2, PIC24F Curiosity, XPRESS EVAL BOARD (PIC16F18855), SAMA5D3 Xplained and various custom boards.
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5