小的最近接触dsp,接触到一段TL16C754的初始化程序,程序如下图所示,因为我英语很差,看不懂手册,所以想请教一下大家这个754初始化到底是怎样的?因为本人无权发手册的地址,所以手册还得麻烦各位大牛自己下载啊!
希望大家帮帮我这个菜鸟啊,卡在这里好几天了!!!!
void ComInit(void)
{
//---------------------- COMA---------------------------------------------
*(unsigned char *)( COMA+3 ) = 0x80;
*(unsigned char *)( COMA ) = 0xf0; //波特率分频18.432M/4800/16=0xf0
*(unsigned char *)( COMA+1 ) = 0x00;
*(unsigned char *)( COMA+3 ) = 0x03;
*(unsigned char *)( COMA+2 ) = 0xc1; //FIFO
*(unsigned char *)( COMA+1 ) = 0x00;
//-----------------------COMB------------------------------------------------
*(unsigned char *)( COMB+3 ) = 0x80;
*(unsigned char *)( COMB ) = 0x0A; //波特率分频18.432M/9600/16=0x78
*(unsigned char *)( COMB+1 ) = 0x00;
*(unsigned char *)( COMB+3 ) = 0x03;
*(unsigned char *)( COMB+2 ) = 0xc1; //FIFO
*(unsigned char *)( COMB+1 ) = 0x01;//允许接收
//----------------------COMC------------------------------------------------
*(unsigned char *)( COMC+3 ) = 0xbf;
*(unsigned char *)( COMC+2 ) = 0x10; //FIFO
*(unsigned char *)( COMC+4 ) = 0x40; //FIFO
*(unsigned char *)( COMC+3 ) = 0x80;
*(unsigned char *)( COMC ) = 0x0a; //波特率分频18.432M/115200/16=10
*(unsigned char *)( COMC+1 ) = 0x00;
*(unsigned char *)( COMC+3 ) = 0x03;
*(unsigned char *)( COMC+2 ) = 0xf1; //FIFO
*(unsigned char *)( COMC+1 ) = 0x00;
//----------------------COMD------------------------------------------------
*(unsigned char *)( COMD+3 ) = 0xbf;
*(unsigned char *)( COMD+2 ) = 0x10; //FIFO
*(unsigned char *)( COMD+4 ) = 0x40; //FIFO
*(unsigned char *)( COMD+3 ) = 0x80;
*(unsigned char *)( COMD ) = 0x0A; //波特率分频18.432M/115200/16=0x0A
*(unsigned char *)( COMD+1 ) = 0x00;
*(unsigned char *)( COMD+3 ) = 0x03;
*(unsigned char *)( COMD+2 ) = 0xf1; //FIFO
*(unsigned char *)( COMD+1 ) = 0x03; //允许接收发送
}
|