Board logo

标题: BF538SPORT口的问题,求教 [打印本页]

作者: yyc7090    时间: 2012-12-16 10:40     标题: BF538SPORT口的问题,求教

当写入pSPORT1_TFSDIV的时候,TX和RX会同时发生改变,但是中断中再写入TX的时候,就写不进去了。代码如下,求大神指点迷津
void Init_BF538(void)
{
*pSIC_IWR |= 0x1;
*pPLL_CTL = SET_MSEL(20);
idle();
*pPLL_DIV = SET_SSEL(4);
ssync();
*pVR_CTL = 0x00DB;
ssync();
*pEBIU_AMBCTL0 = 0xFFC2FFC2;
*pEBIU_AMBCTL1 = 0xFFC2FFC2;
*pEBIU_AMGCTL = 0x00ff;
ssync();
*pEBIU_SDRRC = 0x074A; //0x03A3;
*pEBIU_SDBCTL = 0x0013; //0x0025;
*pEBIU_SDGCTL = 0x8091998d;//0x998D0491;
ssync();

}
void Init_SPORT1(void)
{
*pSIC_IAR0 = 0xffffffff;
*pSIC_IAR1 = 0xfff2ffff;
*pSIC_IAR2 = 0xffffffff;
register_handler(ik_ivg9, SPORT1TX_ISR);

*pSIC_IMASK = 0x00001000;
*pSPORT1_TCR1 |=IRFS|RFSR|IRCLK;
*pSPORT1_TCR2 = 31;
*pSPORT1_TCLKDIV = 7;
*pSPORT1_TFSDIV = 9;
}
EX_INTERRUPT_HANDLER(SPORT1TX_ISR)
{
if( *pSPORT1_STAT & TXHRE )
{
*pSPORT1_TX =0x7865;
}
}
main()
{
Init_BF538();
Init_SPORT1();
*pSPORT1_TCR1 = (*pSPORT1_TCR1|TSPEN);
while(1);
}
作者: TLP291    时间: 2013-2-28 16:04


深圳潮光光耦網——光耦(隔離器)應用服務商
原裝、正品、現貨




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0