資源簡介
DSP28335片內FLASH程序搬運到RAM中運行的方法,目的為了加快指令運算速度,兩種不同的方法,一是將所有代碼均搬運到RAM中運行,適合小工程項目,不必考慮各個函數功能;二是將必要的部分代碼或函數搬運至RAM運行,適合代碼量大的工程,兩種方法均都詳細介紹,DSP編程者必須掌握的技術!
代碼片段和文件信息
//?TI?File?$Revision:?/main/6?$
//?Checkin?$Date:?July?30?2007???14:16:01?$
//###########################################################################
//
//?FILE:???DSP2833x_SysCtrl.c
//
//?title:??DSP2833x?Device?System?Control?Initialization?&?Support?Functions.
//
//?DEscriptION:
//
//?????????Example?initialization?of?system?resources.
//
//###########################################################################
//?$TI?Release:?DSP2833x?Header?Files?V1.00?$
//?$Release?Date:?September?7?2007?$
//###########################################################################
#include?“DSP2833x_Device.h“?????//?Headerfile?Include?File
#include?“DSP2833x_Examples.h“???//?Examples?Include?File
//?Functions?that?will?be?run?from?RAM?need?to?be?assigned?to
//?a?different?section.??This?section?will?then?be?mapped?to?a?load?and
//?run?address?using?the?linker?cmd?file.
//#pragma?CODE_SECTION(InitFlash?“ramfuncs“);
//---------------------------------------------------------------------------
//?InitSysCtrl:
//---------------------------------------------------------------------------
//?This?function?initializes?the?System?Control?registers?to?a?known?state.
//?-?Disables?the?watchdog
//?-?Set?the?PLLCR?for?proper?SYSCLKOUT?frequency
//?-?Set?the?pre-scaler?for?the?high?and?low?frequency?peripheral?clocks
//?-?Enable?the?clocks?to?the?peripherals
void?InitSysCtrl(void)
{
???//?Disable?the?watchdog
???DisableDog();
???//?Initialize?the?PLL?control:?PLLCR?and?DIVSEL
???//?DSP28_PLLCR?and?DSP28_DIVSEL?are?defined?in?DSP2833x_Examples.h
???InitPll(DSP28_PLLCRDSP28_DIVSEL);
???//?Initialize?the?peripheral?clocks
???InitPeripheralClocks();
}
//---------------------------------------------------------------------------
//?Example:?InitFlash:
//---------------------------------------------------------------------------
//?This?function?initializes?the?Flash?Control?registers
//???????????????????CAUTION
//?This?function?MUST?be?executed?out?of?RAM.?Executing?it
//?out?of?OTP/Flash?will?yield?unpredictable?results
void?InitFlash(void)
{
???EALLOW;
???//Enable?Flash?Pipeline?mode?to?improve?performance
???//of?code?executed?from?Flash.
???FlashRegs.FOPT.bit.ENPIPE?=?1;
???//????????????????CAUTION
???//Minimum?waitstates?required?for?the?flash?operating
???//at?a?given?CPU?rate?must?be?characterized?by?TI.
???//Refer?to?the?datasheet?for?the?latest?information.
???//Set?the?Paged?Waitstate?for?the?Flash
???FlashRegs.FBANKWAIT.bit.PAGEWAIT?=?3;
???//Set?the?Random?Waitstate?for?the?Flash
???FlashRegs.FBANKWAIT.bit.RANDWAIT?=?3;
???//Set?the?Waitstate?for?the?OTP
???FlashRegs.FOTPWAIT.bit.OTPWAIT?=?5;
???//????????????????CAUTION
???//ONLY?THE?DEFAULT?VALUE?FOR?THESE?2?REGISTERS?SHOULD?BE?USED
???FlashRegs.FSTDBYWAIT.bit.STDBYWAIT?=?0x01FF;
???FlashRegs.FACTIVEWAIT.bit.ACTIVEWAIT?=?0x01FF;
???EDIS;
???//Force?a?pipeline?flush?to?ensure?that?the?write?t
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????28160??2011-12-19?09:15??DSP28335片內FLASH程序搬運到RAM中運行方法.doc
?????文件??????11882??2008-01-10?16:41??替換文件2011_12_18\DSP2833xxx_SysCtrl.c
?????文件???????2711??2008-01-10?16:41??替換文件2011_12_18\DSP2833xxx_usDelay.asm
?????文件???????3448??2008-03-05?14:19??替換文件2011_12_18\DSP28xxx_CodeStartBranch.asm
?????文件???????7121??2008-03-05?14:20??替換文件2011_12_18\DSP28xxx_Section
?????文件???????3323??2008-03-05?14:20??替換文件2011_12_18\DSP28xxx_Section
?????文件???????7187??2008-03-05?14:21??替換文件2011_12_18\F2833x_nonBIOS_flash.cmd
?????目錄??????????0??2011-12-19?09:12??替換文件2011_12_18
-----------?---------??----------?-----??----
????????????????63832????????????????????8
- 上一篇:光立方制作(原理圖 源程序 LED搭接方法
- 下一篇:基于52單片機的直流電壓測量
評論
共有 條評論