• 0

MX7 Blink example problem

Go to solution Solved by Cristian.Fatu,


I am trying to load my first program on to my new MX7 chipkit pro.  I'm using the MX7_blink example written by Christian Fatu and Michele Yu.  Using MPLAB X IDE I am getting errors during debugging, undefined reference to 'PORTWrite' and undefined reference to 'PORTSetPinsDigitalOut'.  I am a rookie C coder, do these need to be declared as some type of functions above the main() ?   

Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
  • Solution


Indeed, this simple demo is issuing errors related to plb.

Plib used to be a set of peripheral functions that allowed easy access to microcontroller functionality. For example 


was a simple way to set to digital 1 a pin of a specific port.

Looks like Microchip has removed Plib from their latest XC32 compilers.

So here some things that we can do:

- if you want to see this code running you should install an older version of MPLAB, like 2.35, available here: http://www.microchip.com/pagehandler/en-us/family/mplabx/

- I will try to find on this matter and let you know when we have more information.

Link to post
Share on other sites
  • 0

Cristian.Fatu thanks for this valuable information. I too am going in the plib direction with a code I got from

http://hades.mech.northwestern.edu/index.php/Using_the_LS7366R_SPI_Quadrature_Counter (See bottom of page)

These guys are using plib.h in a library to decode via SPI the infamous LS7366 Quadrature decoder. (no it's not infamous, It's a great chip actually, it's a fantastic chip!)

Except that the code listed include the plib.h file. And since I am implementing this chip for further use, might as well do things correctly and up to date. Furthermore, my beginners ability in C++ is leading me to a brick wall for which I will need help to go over. So here is the question: How can I elegantly implement the code without the outdated plib.h ?

Is there an updated version ? How would you do that ? What is the Microchip new way of replacing plib.h ?

Appreciate your help

Link to post
Share on other sites
  • 0

Thank you Tom for posting the link to the porting peripheral libraries to Harmony document. Indeed, Harmony seems to be the Microchip approach for replacing the old plib.

What you can also try to use is the Code Configurator, available in MPLAB X (Tools / Embedded / Code Configurator) http://www.microchip.com/pagehandler/en_us/devtools/code_configurator/home.html

Edited by Cristian.Fatu
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now