• 0
Zonan

MX7 Blink example problem

Question

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() ?   

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hello,

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 

PORTWrite (PORT,  BIT);

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.

Share this post


Link to post
Share on other sites
  • 0

Thanks for that info Cristian, that explains it.

I just used these commands instead and seems to work OK

#define LD1 LATGbits.LATG12

TRISGbits.TRISG12=0

LD1=1;

etc.

thanks again

 

Share this post


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

Share this post


Link to post
Share on other sites
  • 0

Hi JimVaiu,

It looks like Microchip is moving to a new platform called Harmony. Here is the webpage for Harmony, and here is a document that goes over porting legacy peripheral libraries. I have not tried using it yet, but it looks like there is plenty of documentation that can get you moving!

Respectfully,

Share this post


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

Share this post


Link to post
Share on other sites
  • 0

I made a mistake in my previous post, suggesting to use Code Configurator with PIC32. Unfortunately Code Configurator is not available for PIC32. I used it succesfully on PIC16, for example.

Share this post


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