Quote Originally Posted by tumbleweed View Post
Also, you missed setting PORTC to digital mode (ANSELC), so any sound or serial functions for these pins will likely have issues.
I changed it after my post. It was not that. I found out that even if a peripheral is disabled I had to assign a dummy port to it. (xxxPPS registers)
For the SOUND FUNCTION (RC1) it was CCP2PPS (=0 now) same for the SERIN2/SEROUT2 FUNCTION (RB6 RB7) it was RX1PPS (=0 now) CK1PPS (=0 now)

Thank you !