chipKIT® Development Platform

Inspired by Arduino™

Issues with ReadCoreTimer in OpenGLCD

Created Tue, 20 May 2014 17:01:31 +0000 by GrahamM242


Tue, 20 May 2014 17:01:31 +0000

I'm attempting to use OpenGLCD, but I'm encountering an issue when linking happens, where I'm getting a lot of:

delay_cycles_pic32.h:41: undefined reference to `ReadCoreTimer'

and I'm not sure why this is. As far as I can see, the affected code includes <peripheral/timer.h>, which I understood was where ReadCoreTimer lives. Any suggestions as to what I might have missed?




Tue, 20 May 2014 19:54:57 +0000

That's one of the symptoms of the dropping of the microchip peripheral library plib.h. It's a matter of capitalisation between the core and plib.h. One uses readCoreTimer, and the other uses ReadCoreTimer, and I can't remember off hand which is which. Try changing the case and see what happens.


Wed, 21 May 2014 13:29:32 +0000

Fantastic! readCoreTimer() is what I'm looking for, and seems to sort the issue out.

Now just to debug why only half of the display is working! ;)


Thu, 22 May 2014 03:27:41 +0000

I'm working on a fix. It isn't as easy as I thought. Wsystem.c was invented around July 2013 and contains readCoreTimer() the plib peripheral/timer.h which declare ReadCoreTimer() still exists, however, in the most recent release of MPIDE the ReadCoreTimer() function itself does not exist in the final linked image.

One easy option is to not support MPIDE prior to the 2013-07-13 release. That may be the final solution, if I can't figure out out how to autodetect the older releases.

--- bill


Thu, 22 May 2014 04:14:58 +0000

For now, I've created an updated release that fixes this by requiring readCoreTimer(). This means that it only works on MPIDE versions starting with 0023 2013-07-15

--- bill


Thu, 22 May 2014 06:48:44 +0000

You could examine the macro MPIDEVER which contains a crude version number of the IDE you're working with at the time. Currently it's at


You'll have to examine older versions of MPIDE to see what it was when it changed from R... to r...


Thu, 22 May 2014 11:48:23 +0000

A quick check with the versions of MPIDE I have...

0x01000202 - 20120903 0x01000305 - 20130609-test 0x01000307 - 20130626 0x01000308 - 20130715 0x01000308 - 20130724-test 0x01000308 - 20130817-test 0x01000308 - 20130918-test 0x01000308 - 20131118-test 0x01000308 - 20140121-test 0x01000308 - 20140307-test 0x01000309 - 20140316 0x01000309 - 20140407-test 0x01000308 - 20140417-test 0x01000309 - 20140511-test

I did not test with all versions, but 20120903 is the only version I can find that won't compile with readCoreTimer. 20130609-test, 20130626, 20140417-test and 20140511-test are all capable of compiling with readCoreTimer, and the resulting output operates as expected.