This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于28069的XCLKIN选择



各位大侠:

    我使用28069外接有源晶振代码如下:

void ExtOscSel (void)  {

     EALLOW;

     SysCtrlRegs.XCLK.bit.XCLKINSEL = 1;       // 1-GPIO19 = XCLKIN, 0-GPIO38 = XCLKIN

     SysCtrlRegs.CLKCTL.bit.XTALOSCOFF = 1;    // Turn on XTALOSC

     SysCtrlRegs.CLKCTL.bit.XCLKINOFF = 0;     // Turn on 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 = 1;   // Switch Watchdog Clk Src to external clock

     SysCtrlRegs.CLKCTL.bit.INTOSC2OFF = 1;    // Turn off INTOSC2

     SysCtrlRegs.CLKCTL.bit.INTOSC1OFF = 1;    // Turn off INTOSC1

     EDIS;

}

晶振接在GPIO38可以运行正常,但是不管如何修改SysCtrlRegs.XCLK.bit.XCLKINSEL = 0/1;

晶振接GPIO19都不行,好像是 SysCtrlRegs.XCLK.bit.XCLKINSEL = 0/1;  没有生效。

GPIO19未作任何软件设置,也没有上拉下拉。

请各位尽快回复,不胜感谢! 

  • See GPIO19 and GPIO38. External oscillator input. Pin source for the clock is
    controlled by the XCLKINSEL bit in the XCLK register, GPIO38 is the default selection

    那个SysCtrlRegs.XCLK.bit.XCLKINSEL = 0/1; 更改的时候前后加上EALLOW了吗?

    This pin feeds a clock from an external 3.3-V oscillator. In this case, the X1 pin, if
    available, must be tied to GND and the on-chip crystal oscillator must be disabled via
    bit 14 in the CLKCTL register.

    X1接地了么? CLKCTL 寄存器设置了么?