Closed flyerink closed 4 years ago
// Don't update
uint32_t refclkConOld = REFO1CON;
REFO1CON = refclkConOld & 0x0000000F; // Clear OE and ON, but keep rosel field
while (REFO1CON & (1<<8)); // wait for Active bit to be 0
REFO1CON = (rodivInt<<16) | 0x200; // replace with new value
REFO1TRIM = rotrimInt << 23;
REFO1CONSET = 0x00001000 | 0x00008000; // On bit, OE and Divswen = 1
while (!(REFO1CON & (1<<8))); // wait for Active bit to be 1
// End
Recommend fix the temperature file
In plib_i2s1.c function I2S1_RefClockSet.
Correct code start line 190 should be: // Don't update REFO1CON = REFO1CON & 0x0000000F; // Clear OE and ON, but keep rosel field while (REFO1CON & (1<<8)); // wait for Active bit to be 0