IC库存(8958万) PDF资料(329万) IC价格 IC求购 资讯 技术资料
电子元器件搜索:
维库电子市场网是知名的电子元器件交易网站,为电子生产企业提供IC库存和技术资料查询服务。
有没有使用上海三意公司EVM5402的啊
新闻出处:21ic 发布时间:2007-08-16
goodGstudy 发布于 2007-8-16 11:33:00
有使用此款EVM542的,我想请问你对板子上的AD50芯片是怎么初始化的?我的怎么初始化中出现二次通信请求发出后,AD50没有读走这个请求数据0x0001,致使对AD50控制寄存器的控制字不能写入。我的QQ:42929823,如果愿意请加我来共同讨论一下。


wowow 发布于 2007-8-16 17:41:00
通信麻烦,价格贵,还是单声道的。自己做板子的话推荐AIC23。TI的5402DSK上用的1571和AD50用起来都不好用。TI卖的开发板其它一般也是第三方做的,其它很多EVM板很多照抄它的,然后我们又参考前两者,再来误导下一代。。。

给个原来参考代码,不要问我,我也忘得差不多了:-)
*************************************************
*本程序通用于合众达5402 DSK板和恒科5402教学实验箱
*少量修改也可用于其它用C54xx+AD50的目标板
*支持Software/Hardware Quest Secondary Communication
*************************************************
        .def CodeStart
        .mmregs

        .data
DATA_DP:
TEMP    .word 0    

        .text
CodeStart:    
        SSBX    INTM                    ; disable global interrupt
        SSBX    XF           
        .copy "../SP_DP_IPTR.asm"        ;初始化SP/DP/IPTR
        call AD50Init
    call codec
END:    B END

***************************************************
*子程序
***************************************************
*寄存器、宏定义
***************************************************
IfDSK    .set     0            ;0: not DSK, 1: for DSK
SoftHardQuest .set 1        ;0: soft , 1: hard

;McBSP寄存器地址
        .if IfDSK=1            ;McBSP1
SPSAx    .set    48h        ; McBSPx sub-address
SPSDx    .set       49h        ; Write for McBSPx sub-addressed regs
DRR1x    .set    41h        ; Data receive of McBSPx
DXR1x    .set    43h        ; Data transmit of McBSPx
        .else                 ;McBSP0
SPSAx    .set    38h        ; McBSP0 sub-address
SPSDx    .set       39h        ; Write for McBSP0 sub-addressed regs
DRR1x    .set    21h        ; Data receive of McBSP0
DXR1x    .set    23h        ; Data transmit of McBSP0
        .endif
        
;AD50寄存器设置        
        .if SoftHardQuest=1        ;Hardware Request
CR1        .set     0101H            ;16bit
CR2        .set     0201H
        .else                     ;Software Request
CR1        .set     0100H            ;15+1
CR2        .set     0200H
        .endif                
CR3        .set     0300H            ;default, no slave
CR4        .set    0490H            ;0490 fs=16k,0400 fs=8k

;Quest Secondary Commuication for AD50
        .if SoftHardQuest=1        ;Hardware Request
Quest2stCOM .macro
        SetFC                   ; set FC=1
        .endm    
        .else                     ;Software Request
Quest2stCOM .macro
        STM        #0000H,DXR1x
        CALL    XSR_RDY         ; wait till McBSPx transmit ok
        STM        #0001H,DXR1x
        CALL    XSR_RDY         ; wait till McBSPx transmit ok
        .endm
        .endif

;设置/清除FC        
        .if IfDSK=0
SetFC    .macro
        SSBX XF
        .endm
ClrFC    .macro
        RSBX XF
        .endm        
        .else
SetFC    .macro
        PORTW   *AR2, 04h
        .endm
ClrFC    .macro
        PORTW   *AR1, 04h
        .endm                
        .endif
                
        .text
***************************************************
*初始化AD50
***************************************************
AD50Init:
** McBSP串口初始化
        STM     #00h, SPSAx      ; SPCR11
        STM     #4000h, SPSDx    ; Put McBSPx receive in reset
        
        STM     #01h, SPSAx      ; SPCR21
        STM     #0100h, SPSDx    ; Soft mode, Put McBSPx transmit in reset

        STM     #02h, SPSAx      ; RCR11
        STM     #0040h, SPSDx    ; 1 word per frame, 16-bit word

        STM     #03h, SPSAx      ; RCR21
        STM     #0000h, SPSDx    ; Frame sync for each word, 0-bit delay

        STM     #04h, SPSAx      ; XCR11
        STM     #0040h, SPSDx    ; 1 word per frame, 16-bit word

        STM     #05h, SPSAx      ; XCR21
        STM     #0000h, SPSDx    ; Frame sync for each word, 0-bit delay          

        STM     #0Eh, SPSAx      ; PCR1
        STM     #000Ch, SPSDx    ; Low active frame syncs

;** McBSPx transmit out of reset, prepare initializing codec AD50

        STM     #00h, SPSAx      ; SPCR11
        STM     #4001h, SPSDx    ; serial port receiver enabled
        STM     #01h, SPSAx      ; SPCR21
        STM     #0101h, SPSDx    ; XRST=1, enable transmit, soft mode


;for DSK Only
FC_set  .int    0008h            ; set FC bit  
FC_clr  .int    0000h            ; clear FC bit
        STM     #FC_clr, AR1
        STM     #FC_set, AR2  
        
;初始化AD50
        rpt        #8000            ;wait 150us after reset(Hardware Reset)
        NOP

        CALL    XSR_RDY          ; wait till McBSPx transmit ok
        Quest2stCOM
        STM     #(CR1|0080H), DXR1x   ;SoftReset
        CALL    XSR_RDY          ; wait till McBSPx transmit ok
        NOP

         Quest2stCOM
        STM     #CR1, DXR1x       ;out of Reset
        CALL    XSR_RDY
        
        rpt        #8000            ;wait 150us after reset(Software Reset)
        NOP

        Quest2stCOM
        STM     #CR2, DXR1x     ; CR2,
        CALL    XSR_RDY

        Quest2stCOM
        STM     #CR3, DXR1x     ; CR3,
        CALL    XSR_RDY

        Quest2stCOM
        stm     #CR4,DXR1x    
        CALL    XSR_RDY
        
        rpt #0FFFFH      ;PLL等待至少18个frame syncs才稳定
        nop

        RET                                             
        
**************************    
** XSR_RDY Test         **
**************************    
XSR_RDY:
        STM     #01h, SPSAx             ; SPCR21
        LDM        SPSDx,A
        AND        #2H,A
        BC      XSR_RDY, AEQ            ; branch to XSR_RDY if TC=0, else return
        .if SoftHardQuest=1                ;hard
        ClrFC
        .endif
        RET
**************************    
** RSR_RDY Test         **
**************************    
RSR_RDY:                
        STM     #00h, SPSAx             ; SPCR21
        LDM        SPSDx,A
        AND        #2H,A
        BC      RSR_RDY, AEQ            ; branch to XSR_RDY if TC=0, else return
        .if SoftHardQuest=1                ;hard
        ClrFC
        .endif        
        RET
        
********************
* codec
********************
codec:
oo:    
        call RSR_RDY        ;检查接收完毕
        ldm DRR1x, b        ;读入收到的
        and #0fffeh,b        ;这句在31+1数据格式时才有用
        call XSR_RDY        ;
        stlm b,DXR1x        ;
        b oo                ;简单起见用了无限循环
        ret
    

        .end




关闭】 【打印
 
相关专题
友情链接:
© 2007 电测仪器网 网站地图