There is a bug in MCC generated code related to EEPROM access PIC16F18875
MCC version: v4.26
MPLAB X version: v5.00
OS: Windows 10
Area: Generated Code
The MCC generates incorrect code for EEPROM access. The bit NVMCON1bits.NVMREGS should be "1" for EEPROM access but MCC sets it to "0" for both READ access and WRITE access. Took me about a week to find this bug but once set correctly EEPROM reads and writes work fine.
NVMCON1bits.NVMREGS = 0; (both read and write)
NVMCON1bits.NVMREGS = 1;