Hi,
I am calling xtaloscsel from f2806x_sysctrl.c. I don't get a waveform on the scope (gpio18 was set to xclk). I get CLKCTL register value of 0x6000 which does not reflect the values written to the register in the code.
void XtalOscSel (void) {
EALLOW;
SysCtrlRegs.CLKCTL.bit.XTALOSCOFF = 1; // Turn on XTALOSC
DELAY_US(1000); // Wait for 1ms while XTAL starts up
SysCtrlRegs.CLKCTL.bit.XCLKINOFF = 1; // Turn off XCLKIN
SysCtrlRegs.CLKCTL.bit.OSCCLKSRC2SEL = 0; // Switch to external clock
SysCtrlRegs.CLKCTL.bit.OSCCLKSRCSEL = 1; // Switch from INTOSC1 to INTOSC2/ext clk
SysCtrlRegs.CLKCTL.bit.WDCLKSRCSEL = 0; // Clock Watchdog off of INTOSC1 always
SysCtrlRegs.CLKCTL.bit.INTOSC2OFF = 1; // Turn off INTOSC2
SysCtrlRegs.CLKCTL.bit.INTOSC1OFF = 0; // Leave INTOSC1 on
EDIS;
}
right now only XTALOSCOFF XCLKINOFF are at 1 values. If I set XCLKINOFF to 0 then INTOSC2OFF will set to 1 but I still don't get a waveform. I also notice that other registers (GPAMUX2) do not hold appropriate values as if those functions are no longer called if this function is called instead of intosc1sel.
Can anyone explain this behavior? Thanks.