大家好、我最近使用 TMDSCNCD28379D 控制卡开发了一个新项目
根据我之前开发 F28069的经验、我知道我必须首先进行一些设置
1.使用外部振荡器并确保其 PLL 设置正确
2.要使用获取模式(独立于闪存),SW1必须设置为1,1
3.将一些时间关键的程序移至 RAM
首先、我在 F2837xD_SYSCTRL.c 中发现
#ifdef _LAUNCHXL_F28379D InitSysPll(XTAL_OSC,IMULT_40,FMULT_0,PLLCLK_BY_2); #else InitSysPll(XTAL_OSC, IMULT_20, FMULT_0, PLLCLK_BY_2); #endif // _LAUNCHXL_F28379D
我想由于我正在使用控制卡、它将运行代码的其他部分
计算后、PLLSYSCLK =(XTAL_OSC)*(IMULT + FMULT)/(PLLSYSCLKDIV)=20MHz * 20/2=200MHz
如果我误解了任何内容、请告诉我。
此外、如何确保不会在哪个文件中显示#define _LAUNCHXL_F28379D?
其次、我已将 SW1调整为正确的设置、还确保了"构建配置"设置为"闪存构建"(链接至2837xD_FLASH_lnk_cpu1.cmd 和 F2837xD_Heads_nonBIOS_cpu1.cmd)
是否需要其他设置?
第三、也在 F2837xD_SYSCTRL.c 中找到以下代码
#ifdef _FLASH // // Copy time critical code and Flash setup code to RAM. This includes the // following functions: InitFlash() // // The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart // symbols are created by the linker. Refer to the device .cmd file. // memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize); // // Call Flash Initialization to setup flash waitstates. This function must // reside in RAM. // InitFlash(); #endif #ifndef _FLASH // // Call Device_cal function when run using debugger // This function is called as part of the Boot code. The function is called // in the InitSysCtrl function since during debug time resets, the boot code // will not be executed and the gel script will reinitialize all the // registers and the calibrated values will be lost. // Device_cal(); #endif
我还想知道如何确保已定义_FLASH、以及它将显示在哪个文件中
此外、当使用 F28069时、我必须定义哪些程序 需要 移入 RAM、如下所示
#pragma CODE_SECTION(cpu_timer0_isr, "ramfuncs"); #pragma CODE_SECTION(cpu_timer1_isr, "ramfuncs"); #pragma CODE_SECTION(adc_isr, "ramfuncs"); #pragma CODE_SECTION(ecap_isr,"ramfuncs"); #pragma CODE_SECTION(InitAdc, "ramfuncs"); #pragma CODE_SECTION(AdcConversion,"ramfuncs");
我是否需要将其添加到 F28379D 的程序中? 我在 F2837xD_SYSCTRL.c 中找到的代码最相似
#ifndef __cplusplus #ifdef __TI_COMPILER_VERSION__ #if __TI_COMPILER_VERSION__ >= 15009000 #pragma CODE_SECTION(InitFlash, ".TI.ramfunc"); #pragma CODE_SECTION(FlashOff, ".TI.ramfunc"); #else #pragma CODE_SECTION(InitFlash, "ramfuncs"); #pragma CODE_SECTION(FlashOff, "ramfuncs"); #endif #endif #endif
如果有人可以帮助我澄清这将是一个很大的帮助,谢谢