I need to thank Martin K. for bringing to my attention an issue that appears to be affecting quite a few of the readers of my PIC32 book when they attempt to use one of the new MX7 PIMs on the Explorer 16 board.
On the PIC32MX7 models the VBUSON and FVBUSONIO, are multiplexed with RB5 where the Explorer 16 connects instead the potentiometer. That could in fact cause an issue if it was not for the fact that the PIM sockets are NOT a 1 to 1 match to the PIC pins!.
See the document that comes with the PIC32MX7 PIM:
and you will find that pin 20 on the Explorer16 (the pin actually connected to the potentiometer), is instead connected to pin 23 on the device, which corresponds to AN2.
So in the examples of Day 10, just read out AN2 instead (remember to adjust AD1PCFG and AD1CHS accordingly) and you will get a perfect representation of your potmeter’s position!