I use MPLab 8.92 which is older. I suspect you use MPLab X or something newer.
The header has a tab for "Configuration" . A dropdown allows you to select the device. Another dropdown allows you to set the Configuration Bits. My 8.92 version does not show the 18(L)F66K40 or 18F66K40. If I look at 18(L)F46K22, it shows:
If one disables the LVP here, you need to also uncheck the box at the top; otherwise, it defaults to what is in the code.
Now, if your device is actually an 18F66K40 and not the 18(L)F66K40, it may not have that option shown. I assumed earlier, that it was the LF version and cannot find a datasheet for the non-(L)F version. To make matters even more confusing, the 18(L)F66K80 that MPLab8.92 does show, does not show an LVP option in the dropdown.
If your IDE does not show an LVP option, I would write my configuration words out and clear (inactivate) the LVP bit. If you do that with a chip that is not LVP capable, you may get an error, but I have no way to test that. It seems more likely that since the LVP bit is the MSB that word, there will be no error created.
The header has a tab for "Configuration" . A dropdown allows you to select the device. Another dropdown allows you to set the Configuration Bits. My 8.92 version does not show the 18(L)F66K40 or 18F66K40. If I look at 18(L)F46K22, it shows:
If one disables the LVP here, you need to also uncheck the box at the top; otherwise, it defaults to what is in the code.
Now, if your device is actually an 18F66K40 and not the 18(L)F66K40, it may not have that option shown. I assumed earlier, that it was the LF version and cannot find a datasheet for the non-(L)F version. To make matters even more confusing, the 18(L)F66K80 that MPLab8.92 does show, does not show an LVP option in the dropdown.
If your IDE does not show an LVP option, I would write my configuration words out and clear (inactivate) the LVP bit. If you do that with a chip that is not LVP capable, you may get an error, but I have no way to test that. It seems more likely that since the LVP bit is the MSB that word, there will be no error created.