用TMS320F28069的X2 X2脚接20M外部晶振 总是跑不起来 有相关资料或者例程吗?
Forrest:
在28069例程包中的F2806x_SysCtrl.c中有这个例程:
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 = 0; // Clock Watchdog off of INTOSC1 always
SysCtrlRegs.CLKCTL.bit.INTOSC2OFF = 1; // Turn off INTOSC2
SysCtrlRegs.CLKCTL.bit.INTOSC1OFF = 0; // Leave INTOSC1 on
EDIS;
}
例程在controlsuite中:
www.ti.com/…/controlsuite
用TMS320F28069的X2 X2脚接20M外部晶振 总是跑不起来 有相关资料或者例程吗?
bluse:
回复 Forrest:
我的程序是用的C:\TI\controlSUITE\device_support\f2806x\v115\F2806x_examples\F2806xAdcRFFT里的例程,我已经在时钟配置里 把IntOsc1Sel();改成XtalOscSel();还是不行,我用示波器看了20M晶振波形是好的!还有什么原因导致程序跑不起来呢?
void InitSysCtrl(void)
{
// Disable the watchdog
DisableDog();
// *IMPORTANT*
// The Device_cal function, which copies the ADC & oscillator calibration values
// from TI reserved OTP into the appropriate trim registers, occurs automatically
// in the Boot ROM. If the boot ROM code is bypassed during the debug process, the
// following function MUST be called for the ADC and oscillators to function according
// to specification. The clocks to the ADC MUST be enabled before calling this
// function.
// See the device data manual and/or the ADC Reference
// Manual for more information.
EALLOW;
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 1; // Enable ADC peripheral clock
(*Device_cal)();
SysCtrlRegs.PCLKCR0.bit.ADCENCLK = 0; // Return ADC clock to original state
EDIS;
// Select Internal Oscillator 1 as Clock Source (default), and turn off all unused clocks to
// conserve power.
//IntOsc1Sel();
XtalOscSel();
// Initialize the PLL control: PLLCR and CLKINDIV
// DSP28_PLLCR and DSP28_CLKINDIV are defined in F2806x_Examples.h
InitPll(DSP28_PLLCR,DSP28_DIVSEL);//16 2
// Initialize the peripheral clocks
InitPeripheralClocks();
}