Jump to content
  • 0

Where can I download <plib.h> library?


Jack Z

Question

16 answers to this question

Recommended Posts

On 11 August 2015 at 1:14 AM, JColvin said:

Hi Jack,

What code are you using? Most of the code developed for chipKIT (at least most code that is released by Digilent) has been developed to no longer have any dependency on Microchip's plib.h.

If you are working with MPIDE, plib.h can be found in the following folder within your directory:

/.../main_MPIDE_location_name/hardware/pic32/compiler/pic32-tools/pic32mx/include/plib.h

Let me know if you have any more questions.

Thanks,
JColvin

Okay I am trying to locate example code for PIC32mx250f128B. The stuff that I have found uses plib.h and I managed to download plib, install and build one of the examples. So where would I find examples that don't use plib?

I don't mean sketches. I am under the impression that the Arduino library does not support SPI slave mode, only master, so I cannot use a sketch downloaded to the bootloader with MPIDE. My plan is to use MPLAB-X and a PicKit3 

Link to comment
Share on other sites

23 hours ago, JColvin said:

I doubt I'll have much time in the near future to work on this, but it is something that I would like to see done, so I'll see if time can be made for it.

Hi JColvin :)

So I've found out that the chipKIT community has recently (2 weeks ago), updated the libraries and placed them on GitHub: https://github.com/chipKIT32/thirdpartylibraries

One other thing I wanted to note, though. Some time ago (maybe at least a year or so ago), I noticed that the OLED library for the Basic I/O Shield was different than the PmodOLED library (confusing), and I brought it up somewhere, maybe here on this forum or Instructables (as a comment on one of Digilent's posts), I can't remember. Whoever replied to me noted that this needed to be fixed. Since both boards use identical OLEDs, they should use the same library. If you wanted a Basic I/O Shield library, it should be a wrapper library that adds in the OLED library, Temp Sensor Library, and EEPROM library, so the code is reused.

My two cents :) 

 

Link to comment
Share on other sites

Hi bellizima,

Yes, both of those libraries do still use plib.h. In MPIDE (not the Arduino IDE) was able to comment out the plib.h and have all the code examples compile successfully (I only had to create an absolute value function for one of the libraries, the rest I could just comment out the inclusion). But, when I did the same thing in the Aruduino IDE environment (using Arduino IDE 1.6.9) while plib.h seemed to not be a problem I started running into a lot of compilation issues with int's vs uint8_t's and the like. 

I attempted to work around this for the Oled (since the Basic I/O Shield Oled and the PmodOLED libraries are the same since they use the same display) for awhile, but was unable to resolve all of the issues. If I get the opportunity, I'll try to restructure the PmodOLEDrgb library to be compatible with the PmodOLED and the Basic I/O Shield in the Arduino environment since it does not use plib.h and I'm hoping that there will be minimal tweaking to make sure the correct commands are sent. Otherwise, I would also like to add support for the "standard" SPI library rather than having it solely rely on the DSPI library since Pmods should be compatible with any system board.

I doubt I'll have much time in the near future to work on this, but it is something that I would like to see done, so I'll see if time can be made for it.

Thanks,
JColvin

Link to comment
Share on other sites

Hi JColvin,

On 8/10/2015 at 5:14 PM, JColvin said:

Most of the code developed for chipKIT (at least most code that is released by Digilent) has been developed to no longer have any dependency on Microchip's plib.h.

The library for the Basic I/O Shield (and PmodOLED), as far as I know, still use plib.h and are not usable with Arduino IDE. Is there plan to update the libraries? Mind you, not only the OLED on the Basic I/O Shield depends on plib.h, but also the temp sensor and EEPROM.

Link to comment
Share on other sites

I'm using the ChipKit Max32 and wanted to run some examples that used plib.h in Mplab X IDE 3.10 / XC32 1.40 Linux.
After pulling out tufts of hair (installing the legacy peripheral libraries and not getting any joy) I finally found a solution.

After stumbling upon this PDF I proceeded to attempt to install XC32 v1.22 for Linux, which apparently is the last version of XC32 to include all the plib.h files that you will need.

http://kibacorp.com/wordpress/wp-content/uploads/2015/09/ERRATA-Selecting-XC32-Complier-for-PIC32-Book-Code-Examples.pdf

No go... (segmentation error)
So I went back through all versions until finally XC32 v1.0 installed.
It will ask you for a key. Just select to use as the free version.

I then loaded up the demo project and chose XC32 v1.0 as the compiler I wanted.
Deleted any references to go looking for external source/lib in the project settings and linker etc.

Bingo! Compiled all ok at long last.

As noted above I'm on Linux so your mileage may very on Win/Mac as regards which versions will install.

edit: I'm flashing with a PicKit3 with no problems.

Link to comment
Share on other sites

Hi KeithSloan,

From my understanding as well, both the Arduino and MPIDE environments do not support the SPI slave mode. You could always "bit-bang" the slave mode, but that would take a bit of extra work. The code that Digilent has made (referring to my quote) is written in MPIDE, although I'm not sure examples exist specifically for the PIC32MX250 chip (which is on Digilent's DP32). I don't know if Microchip has any non-plib examples available for it either. 

Thanks,
JColvin

Link to comment
Share on other sites

Actually, the error message says that 

“…/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/bin/ld.exe: function at exception vector 3 too large

…/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/bin/ld.exe: function at exception vector 24 too large

…/hardware/pic32/compiler/pic32-tools/bin/../lib/gcc/pic32mx/4.5.2/../../../../pic32mx/bin/ld.exe: Link terminated due to previous error(s).

collect2: ld returned 1 exit status”

I looked at the pic32-gcc.exe file. It turned out that there is something called pic32-gccbug file right below it. Do they relate to each other please?

Thanks, 
Jack

Link to comment
Share on other sites

Hi Jack,

All the currently available versions of MPIDE that I am aware of are available here. You'll notice that there is not an MPIDE 0022.

The reason for this (from my understanding at least) is that MPIDE was originally created off of the Arduino IDE and has been slowly modified over time as bugs were fixed and whatnot and eventually became known as MPIDE. I was able to find all of this in the revisions list here, although I wasn't able to find any of the older versions that they mentioned in the text file.

Thanks,
James Colvin

Thank you James! The author of this code said that they used MPIDE 0022 in the readme.txt file. Here is what it said: 

"Tested on MPIDE 0022 - 2011.12.14.

One modification is required: compiler optimisations must be disabled. This is required so that the compiler
doesn't produce unpredictable code, or multiple code paths for the same bit of source code. So we do this to
ensure our code is deterministic.

To disable compiler optimisations, edit <MPIDE_folder>/hardware/pic32/platforms.txt and replace all instances of '-O3' with '-O0'."

The code did not work in MPIDE0023. I tried to disable compiler optimisations in MPIDE 0023, but did not find anything called '-O3' in the platforms.txt. Do you know whether this matter or not please? 

Thanks, 
Jack

Link to comment
Share on other sites

Hi Jack,

All the currently available versions of MPIDE that I am aware of are available here. You'll notice that there is not an MPIDE 0022.

The reason for this (from my understanding at least) is that MPIDE was originally created off of the Arduino IDE and has been slowly modified over time as bugs were fixed and whatnot and eventually became known as MPIDE. I was able to find all of this in the revisions list here, although I wasn't able to find any of the older versions that they mentioned in the text file.

Thanks,
James Colvin

Link to comment
Share on other sites

Hi Jack,

What code are you using? Most of the code developed for chipKIT (at least most code that is released by Digilent) has been developed to no longer have any dependency on Microchip's plib.h.

If you are working with MPIDE, plib.h can be found in the following folder within your directory:

/.../main_MPIDE_location_name/hardware/pic32/compiler/pic32-tools/pic32mx/include/plib.h

Let me know if you have any more questions.

Thanks,
JColvin

Thank you JColvin! I found the plib.h library. The code that I am using is called a PineBlaster code. It can be found on-line. 

http://labscriptsuite.org/hardware/pineblaster/

 

This code was written in MPIDE0022, so I guess this is why it does not work on my computer since I am using MPIDE0023. Do you know where I can download MPIDE0022 please? 

Thanks, 

Jack

Link to comment
Share on other sites

Hi Jack,

What code are you using? Most of the code developed for chipKIT (at least most code that is released by Digilent) has been developed to no longer have any dependency on Microchip's plib.h.

If you are working with MPIDE, plib.h can be found in the following folder within your directory:

/.../main_MPIDE_location_name/hardware/pic32/compiler/pic32-tools/pic32mx/include/plib.h

Let me know if you have any more questions.

Thanks,
JColvin

Link to comment
Share on other sites

You can downloads peripheral libraries from the Microchip website at this location. I hope this is what you're looking for. If not let me know and I'll do some more digging.

Best Regards,

Bobby

Yeah I think this is the file that I'm looking for. It still seems not working. Do you know where I can download MPIDE0022 please? I am using MPIDE0023 and this might be a problem for the code that I'm using. 

Thanks, 

Jack

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...