+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default MCC Configurator

    I am trying to use the MCC configurator.

    Up to this moment I have created an *.mc3 file. What next?

    Seems this is some kind of markup language file and I cannot read it or import it to PBP editor.

    Or in MPLAB-X, should this be imported to the project? How?

    Ioannis

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: MCC Configurator

    in your mplabx project folder will be a folder "mcc_generated_files"
    in there a C file for each configured "module"

    eg
    mcc_generated_files/pin_manager.c
    mcc_generated_files/spi

    spi.c has this section in it, the highlighted bits are whats needed to be converted to pbp lingo
    ie 0x becomes $

    void SPI1_Initialize(void)
    {
    // Set the SPI1 module to the options selected in the User Interface

    // R_nW write_noTX; P stopbit_notdetected; S startbit_notdetected; BF RCinprocess_TXcomplete; SMP Middle; UA dontupdate; CKE Idle to Active; D_nA lastbyte_address;
    SSP1STAT = 0x00;

    // SSPEN enabled; WCOL no_collision; CKP Idle:Low, Active:High; SSPM FOSC/16; SSPOV no_overflow;
    SSP1CON1 = 0x21;

    // SSP1ADD 0;
    SSP1ADD = 0x00;
    }
    This is more entertaining than Free to Air TV

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: MCC Configurator

    ditto for pins, there's not much to it except that
    for things like
    IOCAFbits.IOCAF4 = 0;

    become
    IOCAF.4 = 0;


    as the microchip bits definits don't seem to work for pbp
    IOCAF.IOCAF4 = 0; is a compile error
    which is a pity



    void PIN_MANAGER_Initialize(void)
    {
    /**
    LATx registers
    */
    LATA = 0x00;
    LATC = 0x00;

    /**
    TRISx registers
    */
    TRISA = 0x37;
    TRISC = 0x18;

    /**
    ANSELx registers
    */
    ANSELC = 0x18;
    ANSELA = 0x03;

    /**
    WPUx registers
    */
    WPUA = 0x00;
    WPUC = 0x00;

    /**
    ODx registers
    */
    ODCONA = 0x00;
    ODCONC = 0x00;


    /**
    IOCx registers
    */
    //interrupt on change for group IOCAF - flag
    IOCAFbits.IOCAF4 = 0;
    //interrupt on change for group IOCAF - flag
    IOCAFbits.IOCAF5 = 0;
    //interrupt on change for group IOCAN - negative
    IOCANbits.IOCAN4 = 1;
    //interrupt on change for group IOCAN - negative
    IOCANbits.IOCAN5 = 1;
    //interrupt on change for group IOCAP - positive
    IOCAPbits.IOCAP4 = 1;
    //interrupt on change for group IOCAP - positive
    IOCAPbits.IOCAP5 = 1;



    // register default IOC callback functions at runtime; use these methods to register a custom function
    IOCAF4_SetInterruptHandler(IOCAF4_DefaultInterrupt Handler);
    IOCAF5_SetInterruptHandler(IOCAF5_DefaultInterrupt Handler);

    // Enable IOCI interrupt
    PIE0bits.IOCIE = 1;


    SSP1DATPPSbits.SSP1DATPPS = 0x02; //RA2->MSSP1:SDI1;
    SSP1CLKPPSbits.SSP1CLKPPS = 0x10; //RC0->MSSP1:SCK1;
    RC0PPSbits.RC0PPS = 0x18; //RC0->MSSP1:SCK1;
    CLCIN0PPSbits.CLCIN0PPS = 0x02; //RA2->CLC1:CLCIN0;
    RC5PPSbits.RC5PPS = 0x04; //RC5->CLC1:CLC1OUT;
    }
    Last edited by richard; - 2nd November 2019 at 22:43.
    This is more entertaining than Free to Air TV

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: MCC Configurator

    Thanks Richard.

    OK, now it makes sense.

    This is saving hours of DS searching for config settings.

    Ioannis

Similar Threads

  1. Replies: 6
    Last Post: - 8th December 2014, 06:12
  2. Configurator
    By Ioannis in forum PBP Wish List
    Replies: 27
    Last Post: - 25th October 2014, 16:03
  3. PIC Configurator
    By Ioannis in forum General
    Replies: 18
    Last Post: - 28th November 2013, 03:29

Members who have read this thread : 14

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts