Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PPS Peripheral Pin Select
18-12-2013, 03:19 PM, (This post was last modified: 18-12-2013, 03:21 PM by zoulou.)
PPS Peripheral Pin Select
I've look through this thread and as it is old I am starting a new one regarding using PPS as it seems to be unanswered.

So has someone been able to reprogram PPS with Pinguino ?
(I am using PIC32MX220)

Reading the doc I found that " In the default (unprogrammed) state, IOL1WAY is set,restricting users to one write session."

It looks like nor the bootloader, nor the generic code touch at the IOL1WAY parameter so as the doc says it is by default set.

As the IOLOCK is set and unset in the io.c invoked at startup, I understand that IOLOCK can not be unlocked any more in the user custom code part.

I'll try to add
in io.c at the beginning of IOsetRemap() to see if that can allow any further unlock.

Thanks to share your knowledge about this issue
19-12-2013, 11:43 AM,
RE: PPS Peripheral Pin Select
You need to perform a system unlock sequence first with System.unlock() / System.lock() but also a configuration unlock (sorry not yet any Pinguino function for that) with :
CFGCONbits.IOLOCK=0; // unlock configuration
and :
CFGCONbits.IOLOCK=1; // relock configuration

Please take a look at p32/include//pinguino/core/io.c, function IOsetRemap() to see how you can do it.
It is easier to complain than it is to do, but it is better to do than it is to complain.
19-12-2013, 03:04 PM,
RE: PPS Peripheral Pin Select
I think he's saying the Pinguino libs already do that. Also, that it can only be done once. So he cannot do it.

But that the config bit would allow to change this.

Yet the bootloader has the bit set in the wrong (default) manner to allow the above.

I had a read of the data sheet and I think he's right.

05-01-2014, 01:04 AM, (This post was last modified: 05-01-2014, 01:05 AM by zoulou.)
RE: PPS Peripheral Pin Select
I received my board yesterday so I started some test / try with it.

I tried to unset IOL1WAY in ioseremap before the first unlock but that crashed my program.
I then realized reading the datasheet that IOL1WAY is "programmable" and not "writable". That subtle difference means I need a real programmer as it must be a kind of fuse lock and this cannot be touched with code loaded with the bootloader.

As I do not have any programmer, I guess the idea is to do any necessary PPS setting directly tweaking the io.c file in the iosetremap function.

I did that but I am still trying to get external interrupt working. If anybody has a working code with external interrupt that would be welcome.
05-01-2014, 09:42 PM,
RE: PPS Peripheral Pin Select
Look for words like interrupt or ISR in the C files. Also, in forum posts (Search feature).

20-03-2019, 11:53 AM,
RE: PPS Peripheral Pin Select
The intervention for the fur is followed for the passages for the comfort of the students. The ray of the hope of the forum and is marked for the individuals. The net is used for the full improvement of the goals for the citizens in this ambit.

Forum Jump:

Users browsing this thread: 1 Guest(s)