CPLD译码编程的问题
我们公司出了一个DSP5509开发板,用CPLD扩展了好多IO口。其中蜂鸣器地址
把CPLD烧进去以后,贴片灯正常亮了。
我写蜂鸣器程序,
souraddr =(int *)0x83C000;
for(;;)
{
*souraddr=0xff;
delay();
delay();
*souraddr=0;
delay();
delay();
}
可是蜂鸣器不响。
请问高手,怎么解决?谢谢! 高手支招啊! 首先要配置好EMIF接口
EMIF_Config emiffig = {
0x221, //EGCR: the MEMFREQ = 00,the clock for the memory is equal to cpu frequence
// the WPE = 0 ,forbiden the writing posting when we debug the EMIF
// the MEMCEN = 1,the memory clock is reflected on the CLKMEM pin
// the NOHOLD = 1,HOLD requests are not recognized by the EMIF
0xFFFF, //EMI_RST: any write to this register resets the EMIF state machine
0x3FFF, //CE0_1:CE0 space control register 1
// MTYPE = 011,Synchronous DRAM(SDRAM),16-bit data bus width
0xFFFF, //CE0_2:CE0 space control register 2
0x00FF, //CE0_3:CE0 space control register 3
// TIMEOUT = 0xFF;
0x1FFF, //CE1_1:CE0 space control register 1
// Asynchronous, 16Bit
0xFFFF, //CE1_2:CE0 space control register 2
0x00FF, //CE1_3:CE0 space control register 3
0x1FFF, //CE2_1:CE0 space control register 1
// Asynchronous, 16Bit
0xFFFF, //CE2_2:CE0 space control register 2
0x00FF, //CE2_3:CE0 space control register 3
0x1FFF, //CE3_1:CE0 space control register 1
// Asynchronous, 16Bit
0xFFFF, //CE3_2:CE0 space control register 2
0x00FF, //CE3_3:CE0 space control register 3
0x2911, //SDC1: SDRAM control register 1
// TRC = 8
// SDSIZE = 0;SDWID = 0
// RFEN = 1
// TRCD = 2
// TRP= 2
0x0410, //SDPER : SDRAM period register
// 7ns *4096
0x07FF, //SDINIT: SDRAM initialization register
// any write to this register to init the all CE spaces,
// do it after hardware reset or power up the C55x device
0x0131 //SDC2: SDRAM control register 2
// SDACC = 0;
// TMRD = 01;
// TRAS = 0101;
// TACTV2ACTV = 0001;
};
EMIF_config(&emiffig);
如果EMIF接口配置好了
就考虑你的指针变量定义是否合适
Uint16*souraddr;有没有声明 int *souraddr,*deminaddr;
EMIF配置有什么需要注意的地方吗? 关于CSL的EMIF配置 还真没深入研究过
一直用的配置好的代码
页:
[1]