刚测试了几行代码,只是想看下程序是否运行,但是一直没有成功,求帮组。附件为整个工程包文件。求救
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.
非常感谢您的答复, 但是我用那你的外设CMD文件,编译出错呢。似乎外设分配的地址空间用问题呢
Severity and Description Path Resource Location Creation Time Id
errors encountered during linking; "SPY37.out" not built SPY37 line 0 1449476595605 5794
creating output section "AdcResultFile" without a SECTIONS specification SPY37 line 0 1449476595599 5765
run placement fails for object "AdcRegsFile", size 0x50 (page 1). Available ranges: ADC size: 0x20 unused: 0x20 max hole: 0x20 SPY37 line 0 1449476595603 5786
run placement fails for object "EPwm1RegsFile", size 0x40 (page 1). Available ranges: EPWM1 size: 0x22 unused: 0x22 max hole: 0x22 SPY37 line 0 1449476595604 5787
run placement fails for object "EPwm2RegsFile", size 0x40 (page 1). Available ranges: EPWM2 size: 0x22 unused: 0x22 max hole: 0x22 SPY37 line 0 1449476595604 5788
run placement fails for object "EPwm3RegsFile", size 0x40 (page 1). Available ranges: EPWM3 size: 0x22 unused: 0x22 max hole: 0x22 SPY37 line 0 1449476595604 5789
run placement fails for object "EPwm4RegsFile", size 0x40 (page 1). Available ranges: EPWM4 size: 0x22 unused: 0x22 max hole: 0x22 SPY37 line 0 1449476595604 5790
run placement fails for object "EPwm5RegsFile", size 0x40 (page 1). Available ranges: EPWM5 size: 0x22 unused: 0x22 max hole: 0x22 SPY37 line 0 1449476595604 5791
run placement fails for object "EPwm6RegsFile", size 0x40 (page 1). Available ranges: EPWM6 size: 0x22 unused: 0x22 max hole: 0x22 SPY37 line 0 1449476595604 5792
run placement fails for object "SysCtrlRegsFile", size 0x30 (page 1). Available ranges: SYSTEM size: 0x20 unused: 0x20 max hole: 0x20 SPY37 line 0 1449476595605 5793
creating output section "Cla1RegsFile" without a SECTIONS specification SPY37 line 0 1449476595600 5766
creating output section "Comp1RegsFile" without a SECTIONS specification SPY37 line 0 1449476595600 5767
creating output section "Comp2RegsFile" without a SECTIONS specification SPY37 line 0 1449476595600 5768
creating output section "Comp3RegsFile" without a SECTIONS specification SPY37 line 0 1449476595600 5769
creating output section "DmaRegsFile" without a SECTIONS specification SPY37 line 0 1449476595600 5770
creating output section "EmuBModeVar" without a SECTIONS specification SPY37 line 0 1449476595601 5773
creating output section "EmuKeyVar" without a SECTIONS specification SPY37 line 0 1449476595601 5774
creating output section "EPwm7RegsFile" without a SECTIONS specification SPY37 line 0 1449476595601 5771
creating output section "EPwm8RegsFile" without a SECTIONS specification SPY37 line 0 1449476595601 5772
creating output section "FlashCallbackVar" without a SECTIONS specification SPY37 line 0 1449476595601 5775
creating output section "FlashScalingVar" without a SECTIONS specification SPY37 line 0 1449476595602 5776
creating output section "HRCap1RegsFile" without a SECTIONS specification SPY37 line 0 1449476595602 5777
creating output section "HRCap2RegsFile" without a SECTIONS specification SPY37 line 0 1449476595602 5778
creating output section "HRCap3RegsFile" without a SECTIONS specification SPY37 line 0 1449476595602 5779
creating output section "HRCap4RegsFile" without a SECTIONS specification SPY37 line 0 1449476595602 5780
creating output section "McbspaRegsFile" without a SECTIONS specification SPY37 line 0 1449476595603 5781
creating output section "NmiIntruptRegsFile" without a SECTIONS specification SPY37 line 0 1449476595603 5782
creating output section "PartIdRegsFile" without a SECTIONS specification SPY37 line 0 1449476595603 5783
creating output section "SysPwrCtrlRegsFile" without a SECTIONS specification SPY37 line 0 1449476595603 5784
creating output section "Usb0RegsFile" without a SECTIONS specification SPY37 line 0 1449476595603 5785
试着能输出高低电平测试,但是有个疑问,系统时钟怎么去配置的,看那个初始化系统InitSysCtrl();
void InitSysCtrl(void)
{
// Disable the watchdog
DisableDog();
// Initialize the PLL control: PLLCR and CLKINDIV
// DSP28_PLLCR and DSP28_CLKINDIV are defined in DSP280x_Examples.h
InitPll(DSP28_PLLCR,DSP28_CLKINDIV);
// Initialize the peripheral clocks
InitPeripheralClocks();
}
这个函数,里面似乎没有看是用CLKIN引脚输入的还是 X1,X2引脚输入的时钟。我按照例子中的_CPU_TIMER去执行,发现定时器没有运行。目前我的板子实际是用X1 X2 20M的晶振。想配置成100M,配置
/*-----------------------------------------------------------------------------
Specify the PLL control register (PLLCR) and clock in divide (CLKINDIV) value.
if CLKINDIV = 0: SYSCLKOUT = (OSCCLK * PLLCR)/2
if CLKINDIV = 1: SYSCLKOUT = (OSCCLK * PLLCR)
-----------------------------------------------------------------------------*/
#define DSP28_CLKINDIV 0 //
#define DSP28_PLLCR 10
定时器初始化函数
void InitSystemTimer0()
{
unsigned char i;
//SystemTimeTick=0;
for(i=0;i<DELAY_TIMER_COUNT;i++)
{
DelayTimerParam[i]=0xff;
}
InitCpuTimer0();
ConfigCpuTimer(&CpuTimer0, 100, 1000);//cpu 100M 100us period
CpuTimer0Regs.TCR.all = 0x4001; // Use write-only instruction to set TSS bit = 0
StartCpuTimer0();
IER |= M_INT1; // Enable CPU int1 which is connected to CPU-Timer 0
PieCtrlRegs.PIEIER1.bit.INTx7 = 1; // Enable TINT0 in the PIE: Group 1 interrupt 7
/****************************定时器配置***************************/
}