Re: Harmony 3 DDR not working. PIC32MZ1025DAG169-I/6J crashes when DDR_Initialize() called
I just made one major breakthrough,
Harmony 3 configuration does not enable the MPLL voltage regulator
So this was causing the chip reset crash.
I recommend calling this code before calling DDR_Initialize();
CFGMPLLbits.INTVREFCON = 0x00; // use the external DDRVRef voltage(must be 0.9 volts)
CFGMPLLbits.MPLLVREGDIS = 0; // turn on the MPLL voltage regulator, or chip resets when ddr enabled
while (CFGMPLLbits.MPLLVREGRDY == 0); // wait for MPLL voltage regulator to be ready
while (CFGMPLLbits.MPLLRDY == 0); // wait for MPLL clock to be ready
It no longer crashes, BUT, when it calls this function
the SCLEN = 1 seems to fail, the debugger always shows this register as zero.
Any ideas why I cannot set this bit in the DDRSCLSTART register????
static void DDR_PHY_Calib(void)
DDRSCLSTARTbits.SCLEN = 1;
DDRSCLSTARTbits.SCLSTART = 1;
while (!((DDRSCLSTARTbits.SCLLBPASS & DDRSCLSTARTbits.SCLUBPASS) == 0x01));