Can't find IOL1WAY in Def file for 24FJ128GA310

General discussion on mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Rubbotron
Posts: 11
Joined: 17 Feb 2016 19:40

Can't find IOL1WAY in Def file for 24FJ128GA310

#1 Post by Rubbotron » 13 Sep 2016 17:51

I need to clear bit 4 (IOL1WAY) in the CW2: Flash Configuration Word 2 register for the 24FJ128GA310. I looked in the Def file, P24FJ128GA310.mbas, and found just about every SFR but the one I need to change. Is it called something different in the Def file?

Rubbotron
Posts: 11
Joined: 17 Feb 2016 19:40

Re: Can't find IOL1WAY in Def file for 24FJ128GA310

#2 Post by Rubbotron » 13 Sep 2016 18:21

I just answered my own question. I did not realize that IOL1WAY (IO Lock One Way) was a setting in the Project! All I needed to do is go to Project, Edit Project, and then Disable the IOLOCK One-Way Set. I hope this is of assistance to anyone else who may have bumped into this.

For those who might not know what the IOL1WAY bit does, when enabled (set to 1) it only allows the IOLOCK bit to be set once for Peripheral Pin Select (PPS) registers to be written to. This means you can only change your PPS configuration once, the first time you write to it. If the IOL1WAY bit is disabled or cleared (set to 0), it allows the IOLOCK bit to be set and cleared as needed, meaning that you can write the PPS registers multiple times (as long as you go through the proper unlock and lock sequence).

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 General”