chipKIT® Development Platform

Inspired by Arduino™

Use MPIDE libraries in MPLab

Created Thu, 30 May 2013 10:06:57 +0000 by light


light

Thu, 30 May 2013 10:06:57 +0000

I love the Arduino-like libraries developed in MPIDE. Is it possible to create a project in MPLab and use the MPIDE libraries? For Atmel platform, it is possible to migrate the Arduino libraries over to Atmel Studio. I wonder whether someone has done the same for MPIDE libraries and MPLab. But, is this possible in the first place?


majenko

Thu, 30 May 2013 12:56:44 +0000

You're not the first to ask this question.

The short answer is yes, it is possible.

The long answer is yes, it is possible, but it takes a huge amount of work.

The libraries rely on the core software (in hardware/pic32/core/pic32), which is what makes a board arduino-like. It is perfectly possible to create an MPLAB-X project (with XC32++) and include all that core code into the project along with any libraries you may want to use. As I say, it's a lot of work and not trivial to do - and you'd need to do it for every program you wrote.

Better would be to use the libraries as a starting point and write your own code directly in your project.


light

Thu, 30 May 2013 13:06:00 +0000

You're not the first to ask this question. The short answer is yes, it is possible. The long answer is yes, it is possible, but it takes a huge amount of work. The libraries rely on the core software (in hardware/pic32/core/pic32), which is what makes a board arduino-like. It is perfectly possible to create an MPLAB-X project (with XC32++) and include all that core code into the project along with any libraries you may want to use. As I say, it's a lot of work and not trivial to do - and you'd need to do it for every program you wrote. Better would be to use the libraries as a starting point and write your own code directly in your project.

This is good news. I can always create a project template as a starting point for all the projects.

I am a newbie and has not even installed MPLab before. Should I use MPLab 8 or MPLab-X? Which one is better or both will work?


majenko

Thu, 30 May 2013 13:13:33 +0000

You require C++, so XC32 is needed (with a C++ license - they did do them free for personal / academic use IIRC). I don't know if that works in MPLAB-8 or not - I'd go for MPLAB-X.


Muhammad

Tue, 06 Aug 2013 07:20:06 +0000

Hi

I am planning on doing the same thing, but i have a few questions, as my programming knowledge isn't that great.

Do i only add the '.h' and '.c' files to the library folder of my project, then use '#include' in my main file? Is there anything else i should do? and finally if i add these files, would i be able to write code just as if i was programming an arduino, using pinMode, the setup and loop functions etc?

*edit Which 'Board_Defs.h' file should I use, and how whould i addapt it to work for a PIC32MX360F512L

Thanks