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.

F28035: Internal Oscillator 1 and Crystal operation

Hi,

I've enabled the crystal operation and turned off other clock inputs (internal oscillators 1 and 2 and external oscillator) for F28035. According to the document sprugl8b.pdf (Figure 18: Clocking Options) it is possible to turn on just the crystal operation (with setting other bits correctly). But I've found that the internal oscillator 1 has to be turned on as well, although it is not used for any switch. Timer 2 is not used and it is configured per default (using SYSCLKOUT). This is the code:

EALLOW;
SysCtrlRegs.CLKCTL.bit.INTOSC1OFF = 0;
SysCtrlRegs.CLKCTL.bit.INTOSC2OFF = 1;
SysCtrlRegs.CLKCTL.bit.XTALOSCOFF = 0;
SysCtrlRegs.CLKCTL.bit.OSCCLKSRCSEL = 1;
SysCtrlRegs.CLKCTL.bit.XCLKINOFF = 1;
SysCtrlRegs.CLKCTL.bit.OSCCLKSRC2SEL = 0;
SysCtrlRegs.CLKCTL.bit.WDCLKSRCSEL = 1;
EDIS;
 
Why is the internal oscillator 1 needed? Can it be turned off? (There is one part of the control running in the CLA unit. Could that be a reason?) Just to clarify - it is ok if it cannot be turned off. I want to understand why.
 
Thanks,
Slavica
  • Slavica

    can you confirm if you are switching the CPU clock source to another clock soource and then turning off the INTOSC1? not the otherway round?

    What is the symptom you are seeing by which you can say that the logic is not working as you expect it to be.

    Best Regards

    Santosh

  • Hi Santosh,

    The logic is not working because:

    - When running the application from the debugger and hit 'pause' button it does not stop at any point in the code;

    - There are debug messages that are supposed to come out from the SCIB port.  They are not showing when INTOSC1 is off.

    Originally, I was setting INTOSC1 to off then enabling the XTALOSC. I changed the order after your question, but that did not make difference.

    Thx,

    Slavica

  • Slavica,

    In F2803x_SysCtrl.c we provide a function to select the external crystal and turn off the other oscillators.  Please try using this function and let us know the results.

    void XtalOscSel (void) {
    EALLOW;
    SysCtrlRegs.CLKCTL.bit.XTALOSCOFF = 0; // Turn on XTALOSC
    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 = 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;
    }

    I believe the problem is you are turning off the oscillator you are using before switching to the external oscillator.  

    Kris

  • Slavica,

    The below doesn't tell that the device is still running the application after clock switch is done and INTOSC1 is off, are you scoping XCLKOUT signal to be sure?

    Slavica Golijanin said:

    The logic is not working because:

    - When running the application from the debugger and hit 'pause' button it does not stop at any point in the code;

    - There are debug messages that are supposed to come out from the SCIB port.  They are not showing when INTOSC1 is off.

    As Kris pointed out above, make sure that you turn off the clocks only after the clock switch is complete.

    Best Regards

    Santosh

  • Yes, that was it. Thank you both, Kris and Santosh.