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.

Trouble using external clock on F28069



I was trying to configure external clock (XCLKIN) on F28069 on GPIO19 (Pin 52 on 80-pin PN package; GPIO19 multiplexed with XCLKIN). I'm using F28069 USB controlSTICK. The schematic shows that X2 has been left open, while X1 is grounded. GPIO19 is brought out on pin 25 on J1 header. I've tested the external 12MHz resonator (getting power from pin 32-Ground and pin 4-3V3). The resonator output is ok. The intent is to disable and bypass PLL, and directly use external clock. Unfortunately, I haven't had any success so far in configuring XCLKIN as the system clock.

Has anyone tried that? Maybe I'm doing something wrong, so it would be nice for someone to share system clock configuration with me. Even though this device is not a part of any of my current projects, it will block me from considering it for any of my future projects. My preference will be to use GPIO19 rather than GPIO38 (Pin 54 on 80-pin device) for external clock.  

Thanks

-Ahmad

  • Hello,

    I successfully use pin GPIO19 as external clock source on the same controlSTICK. Do you have modified the source code in order to use that pin?

    Raffaele

  • Rafaele,

    I tried modifying the SysCtrl.c file, but seems like I'm missing something. I did that for F28335 (used XCLKIN for clock) successfully, but was not able to do that for F28069. Do you remember what changes you had to make? Would it be possible for you to share the code? As I mentioned before, I am trying to disable and bypass the PLL altogether. I'll post the clock module configuration code that I used later.

    Thanks

    -Ahmad

  • Ahmad,

    based on SysCtrl.c and the function InitSysCtrl()  you can find in SineFIRFFT32 example, you have to call the function ExtOscSel() instead of IntOsc1Sel().

    Here's the code:

    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;

    }

    Best regards,

    Raffaele

  • Raffaele,

    Thanks a lot. That worked perfectly. I'm not sure what I was doing wrong, but this subroutine works just fine. I was also able to turn PLL off.

    Thanks again

    -Ahmad