资源简介
TMS320C6713配置代码,适合初学者
代码片段和文件信息
/*
*FLASH测试程序
*程序包含FLASH芯片擦除和word编程子程序
*/
#include
#include
#include “reg6713.h“
#define FLASHWritebaseAddress0 0x090000000
#define FLASHReadbaseAddress0 0x090000000
#define FLASHWritebaseAddress1 0x090010000
#define FLASHReadbaseAddress1 0x090010000
#define FLASHWritebaseAddress2 0x090020000
#define FLASHReadbaseAddress2 0x090020000
#define FLASHWritebaseAddress3 0x090040000
#define FLASHReadbaseAddress3 0x090040000
#define FPGAWriteNum 16
#define FPGAReadNum 16
/*芯片擦除子程序*/
void FlashErase_39VF160(void);
/*word编程子程序*/
void FlashWrite_39VF160(int WritebaseAddressint DataArray[]int Num);
void main()
{
int i;
int *PFLASHFLASHReadNum=16FLASHWriteNum=16;
int FLASHReadArray0[16]FLASHReadArray1[16]FLASHReadArray2[16]FLASHReadArray3[16];
int FLASHWriteArray0[16]FLASHWriteArray1[16]FLASHWriteArray2[16]FLASHWriteArray3[16];
/*-------------EMIF global Registers Configration-------*/
*(int *)EMIF_GCTL = 0x00003060; /* EMIF global control register*/
*(int *)EMIF_CE1 = 0xFFFFFF23; /* CE1 - 32-bit operation to 16-bit FLASH asynch access */
*(int *)EMIF_CE0 = 0xFFFFFF30; /* CE0 - SDRAM */
*(int *)EMIF_CE2 = 0xFFFFFF30; /* CE2 - 32-bit asynch on daughterboard */
*(int *)EMIF_CE3 = 0xFFFFFF23; /* CE3 - 32-bit asynch on daughterboard */
*(int *)EMIF_SDRAMCTL = 0x57117000; /* SDRAM control register (100 MHz)*/
*(int *)EMIF_SDRAMTIMING = 0x0000061a; /* SDRAM Timing register */
/*----------------FLASH Write and Read operation---------*/
FlashErase_39VF160(); /* Flash Chip Erase */
/* Write Data initialize */
for(i=0;i {
FLASHWriteArray0[i]=i;
FLASHWriteArray1[i]=2*i;
FLASHWriteArray2[i]=3*i;
FLASHWriteArray3[i]=4*i;
}
/* Flash Write operation */
FlashWrite_39VF160(FLASHWritebaseAddress0FLASHWriteArray0FLASHWriteNum);
FlashWrite_39VF160(FLASHWritebaseAddress1FLASHWriteArray1FLASHWriteNum);
FlashWrite_39VF160(FLASHWritebaseAddress2FLASHWriteArray2FLASHWriteNum);
FlashWrite_39VF160(FLASHWritebaseAddress3FLASHWriteArray3FLASHWriteNum);
/* Flash Read operation */
for(i=0;i {
PFLASH=(int *)(FLASHReadbaseAddress0+4*i);
FLASHReadArray0[i]=* PFLASH;
}
for(i=0;i {
PFLASH=(int *)(FLASHReadbaseAddress1+4*i);
FLASHReadArray1[i]=* PFLASH;
}
for(i=0;i {
PFLASH=(int *)(FLASHReadbaseAddress2+4*i);
FLASHReadArray2[i]=* PFLASH;
}
for(i=0;i {
PFLASH=(int *)(FLASHReadbaseAddress3+4*i);
FLASHReadArray3[i]=* PFLASH;
}
while(1);
}
/*芯片擦除子程序*/
void FlashErase_39VF160(void)
{
int ij;
*(int *)0x90015554=0x00aa;
*(int *)0x9000AAA8=0x0055;
*(int *)0x90015554=0x0080;
*(int *)0x90015554=0x00aa;
*(int *)0x9000AAA8=0x0055;
*(int *)0x90015554=0x0010;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 795 2008-11-08 23:35 dsp\FLASH_test\cc_build_Debug.log
文件 64873 2007-04-15 10:30 dsp\FLASH_test\db\altsyncram_2qi2.tdf
文件 1554 2007-04-15 10:30 dsp\FLASH_test\db\cmpr_50i.tdf
文件 4970 2007-04-15 10:30 dsp\FLASH_test\db\cntr_3tf.tdf
文件 6332 2007-04-15 10:30 dsp\FLASH_test\db\cntr_4kg.tdf
文件 4981 2007-04-15 10:30 dsp\FLASH_test\db\cntr_7jf.tdf
文件 4706 2007-04-15 10:30 dsp\FLASH_test\db\cntr_7qe.tdf
文件 5217 2007-04-15 10:30 dsp\FLASH_test\db\cntr_hph.tdf
文件 3466 2007-04-15 10:30 dsp\FLASH_test\db\decode_cpi.tdf
文件 700 2007-04-15 10:36 dsp\FLASH_test\db\FPGA.(0).cnf.cdb
文件 597 2007-04-15 10:36 dsp\FLASH_test\db\FPGA.(0).cnf.hdb
文件 14223 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(1).cnf.cdb
文件 6097 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(1).cnf.hdb
文件 1371 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(10).cnf.cdb
文件 600 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(10).cnf.hdb
文件 1197 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(11).cnf.cdb
文件 636 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(11).cnf.hdb
文件 1446 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(12).cnf.cdb
文件 682 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(12).cnf.hdb
文件 1141 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(13).cnf.cdb
文件 587 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(13).cnf.hdb
文件 4110 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(14).cnf.cdb
文件 1144 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(14).cnf.hdb
文件 2172 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(15).cnf.cdb
文件 829 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(15).cnf.hdb
文件 1158 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(16).cnf.cdb
文件 590 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(16).cnf.hdb
文件 3170 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(17).cnf.cdb
文件 964 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(17).cnf.hdb
文件 996 2007-04-15 10:30 dsp\FLASH_test\db\FPGA.(18).cnf.cdb
............此处省略1194个文件信息
评论
共有 条评论