chipKIT® Development Platform

Inspired by Arduino™

How to configure MCU pins without Chipkit equivalent pin no

Created Mon, 28 Apr 2014 16:35:51 +0000 by samdesd


Mon, 28 Apr 2014 16:35:51 +0000

Hi, I recently bought WF32 board from Element14. From the WF32 doc, there are some MCU pins without equivalent Chipkit pin number. Example pin 73, 74 and several other pins on the MCU.

How do I configure these pins in the MPIDE (Arduino) ... I mean, how do I config it to Arduino style?

By the way, can I access the MCU registers just like I did in MPLAB/C32 compiler?

Thank you.



Mon, 28 Apr 2014 22:12:41 +0000

To answer your question about the registers: yes, you can directly access the MCU registers in MPIDE. You just have to include p32xxxx.h at the beginning of your sketch. Then you can go about accessing the registers the same way you did with MPLAB. :)

If you check the pinout in the WF32 reference manual against its schematic, you'll see there are some pins that you will not want to access. These are the ones that do not have a chipKIT pin number, because they are not meant to be used as GPIO. For example, MCU pins 63 and 64 are connected to the external oscillator, and MCU pins 73 and 74 are connected to the footprint for another unloaded external oscillator. The ones you may want to access are the USB pins, which can also function as GPIO by using RG2, RG3, or RF3. However, they are tied only to the USB circuitry and not to any of the GPIO headers.


Mon, 28 Apr 2014 23:18:14 +0000

Hi, I thank you for the very speedy reply. The reason for asking the question is that, I am planning to come out with my own board based on the WF32 design AND pin 73, 74 supposed to be treated as digital OUTPUT ports.

I guessed, I have to use the standard <p32xxxx.h> to declared the ports by accessing the respective registers? Can the <plib.h> be used as well in Arduino style programming?

Thank you again.... I am new to Arduino!



Tue, 29 Apr 2014 01:15:47 +0000

Yes, you can use <plib.h> to access Microchip's peripheral library functions, alongside traditional Arduino-style programming. There is a potential for incompatibility between those two approaches, because the same system resources can't be used for two different things at once. So you'd be taking on some extra responsibility to avoid problems, or to repair them.

Sometimes people choose to avoid plib, because the source code is licensed only for use on Microchip MCUs. Practically speaking, that is not much of a limitation. But if complete open-sourceness is important to you, its a thing to consider. Sometimes you can learn useful things by reading the plib source code, and then writing your own code as needed.



Tue, 29 Apr 2014 01:28:01 +0000

Hi guymc,

Thank you for the help. I am actually writing in MPLAB/C32 environment previously. However, with Arduino overwhelming libraries and communities... I wanted to migrate to its platform. For that in fact... I have several questions with respect to changing platform despite both are still programming in C.

Any way.... thank you so much for your kind answer. Good life.


Jacob Christ

Wed, 30 Apr 2014 14:59:00 +0000

Unless I am overlooking something, there should be a variant file for the board your using that you would need to create a custom version for your board. We had a similar issue with the Quick240 which is based on the Max32. I think the variant files are in mpide/pic32/hardware or visa versa (I am not in front on my computer right now so I can't verify). You will then need to add a entry in the boards.txt file to support your new variant.



Wed, 30 Apr 2014 17:39:56 +0000

Hi Jacob,

Thank you for the reminder. However I hope you can explain further ABOUT THE NEEDS OF HAVING CUSTOM BOARD VERSION's VARIANT FILE... can you please do so?

From my point of view, I plan to bring up my board as much the same to the WF32 in terms of I/Os connections (with exceptions that)... I will connect all the available I/Os to external peripherals like RTC, EEPROM, temperature sensor, etc AND an extra WIFI module via other SPI port available to PIC32MX695 (the 2nd one - for certain reason!).

So to me, it is just like having WF32 board and connecting its I/Os to all the mentioned peripherals. Logically... all should be the same from the programming point of view. Do I missed something...? Please tell me AND if possible the sample of your variant file... how it looks like. Thanks Jacob



Thu, 01 May 2014 17:10:42 +0000

There is a very informative document here:



Thu, 01 May 2014 17:55:42 +0000

Hi guymc,

Thanks, will look into it.



Thu, 01 May 2014 18:14:31 +0000

Hi guys,

The link you gave is about adding CUSTOM BOARD to MPIDE. At present, I will just go ahead developing my custom board based on WF32. By the way, thanks for the info.