shi562142022 发表于 2012-9-28 21:12:46

TMS320VC5509A 上AD值 读不到

最近在用这款DSP做个小设计,AD部分代码是按照demo例程来的,但是在我的工程里面,AD就是读不到就读一个256,然后就不在变了,不知道是怎么回事??各位大神 有遇到过同样的问题的吗??求教!
AD部分代码如下:
         EnableAPLL();
        for ( i=0;i<256;i++ )
                {
                        ADCCTL=0x8000;        // 启动AD转换,通道0,将ADCSTART置位1
                        do
                        {
                                uWork=ADCDATA;
                        } while ( uWork&0x8000 );//判断BUZY位是否为1,为1不跳出,为0跳出

                        nADC0=uWork&0x0fff;   //将ADCDATA的10为AD值赋给nADC0
                }
                asm( " nop");                // break point
        }

其中EnableAPLL()如下:我对这个EnableAPLL()不是很理解

void EnableAPLL( )
{
    /* Enusre DPLL is running */
    *( ioport volatile unsigned short* )0x1f00 = 4;

    wait( 25 );

    *( ioport volatile unsigned short* )0x1f00 = 0;

    // MULITPLY
    *( ioport volatile unsigned short* )0x1f00 = 0x3000;

    // COUNT
    *( ioport volatile unsigned short* )0x1f00 |= 0x4F8;

    wait( 25 );

    //*( ioport volatile unsigned short* )0x1f00 |= 0x800

    // MODE
    *( ioport volatile unsigned short* )0x1f00 |= 2;

    wait( 30000 );

    // APLL Select
    *( ioport volatile unsigned short* )0x1e80 = 1;

    // DELAY
    wait( 60000 );
}
页: [1]
查看完整版本: TMS320VC5509A 上AD值 读不到