打印
[DSP编程]

CPLD译码编程的问题

[复制链接]
1062|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
我们公司出了一个DSP5509开发板,用CPLD扩展了好多IO口。
其中蜂鸣器地址


把CPLD烧进去以后,贴片灯正常亮了。
我写蜂鸣器程序,
souraddr =  (int *)0x83C000;
    for(;;)
    {
     *souraddr=0xff;
  delay();
  delay();
  *souraddr=0;
  delay();
  delay();
    }
可是蜂鸣器不响。
请问高手,怎么解决?谢谢!

相关帖子

沙发
wangch_sh|  楼主 | 2014-9-20 14:10 | 只看该作者
高手支招啊!

使用特权

评论回复
板凳
zhangmangui| | 2014-9-20 23:22 | 只看该作者
首先要配置好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);

使用特权

评论回复
地板
zhangmangui| | 2014-9-20 23:25 | 只看该作者
如果EMIF接口配置好了  
就考虑你的指针变量定义是否合适
Uint16  *souraddr;有没有声明

使用特权

评论回复
5
wangch_sh|  楼主 | 2014-9-21 11:28 | 只看该作者
int *souraddr,*deminaddr;
EMIF配置有什么需要注意的地方吗?

使用特权

评论回复
6
zhangmangui| | 2014-9-22 23:26 | 只看该作者
关于CSL的EMIF配置 还真没深入研究过
一直用的配置好的代码   

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:为江山踏坏了乌骓马,为社稷拉断了宝雕弓。

318

主题

2817

帖子

5

粉丝