This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
用TL16C554与DSP连接,实际使用7.3728M有源晶振,原理图如下
调试过程
1)配置如下
BaseAddress_TL16C554 = (Uchar *)(CS7_BASE);
//数据格式 ,LCR Bits 0 and 1:1 1= 8 Data bits;0 = 1 Stop Bit;0 = Parity Disabled;1 = Access Divisor Latches
*(BaseAddress_TL16C554 + Addr_LCR) = 0x80;
DELAY_US(5);
if((Chan == 0x0A)||(Chan == 0x0B))//陀螺
{
//波特率 460800=7.3728MHz/16/BAUD RATE ,BAUD RATE=1 , DLM:DLL= D15:D0
*(BaseAddress_TL16C554 + Addr_DLL) = 0x01;
*(BaseAddress_TL16C554 + Addr_DLM) = 0x00;
}
else if((Chan == 0x0C)||(Chan == 0x0D))//编码器
{
//波特率 115200=7.3728MHz/16/BAUD RATE ,BAUD RATE=4 ; 9600=16MHz/16/BAUD RATE ,BAUD RATE=104
*(BaseAddress_TL16C554 + Addr_DLL) = 0x04;
*(BaseAddress_TL16C554 + Addr_DLM) = 0x00;
}
DELAY_US(5);
// LCR Bits 0 and 1:1 1= 8 Data bits;0 = 1 Stop Bit;0 = Parity Disabled;0 = Access Receiver Buffer
*(BaseAddress_TL16C554 + Addr_LCR) = 0x03;
//FIFO深度 FCR0 :enables the transmit and receive FIFOs;Bits 7 and 6: 1 1 14BYTES FIFO
*(BaseAddress_TL16C554 + Addr_FCR) = 0x07;//清空FIFO
DELAY_US(5);
*(BaseAddress_TL16C554 + Addr_FCR) = 0x81;//使能FIFO
DELAY_US(5);
// 使能接收发送中断 IER0: the received data available interrupt and the timeout interrupts in the FIFO mode;
// IER1: the transmitter holding register empty interrupt ;IER2: receiver line status interrupt is enabled
*(BaseAddress_TL16C554 + Addr_IER) = 0x05;
DELAY_US(5);
//external serial channel interrupt Enabled
*(BaseAddress_TL16C554 + Addr_MCR) = 0x08; //运行之后INT由低电平升为高电平; //电平还是低电平,未变高
DELAY_US(5);
*(BaseAddress_TL16C554 + Addr_SCR) = 0xEE;//调试写数据
// DELAY_US(5);
// *(BaseAddress_TL16C554 + Addr_THR) = 0x32;
}
2)电路板上电后,各引脚电压均为3.3V,测得XTAL2波形如下
3)TL16C554配置,在CCS主程序调试读取如下
数组0-7依次对应以下地址的寄存器值
MCR和SCR读取数据和设置匹配
如果屏蔽掉*(BaseAddress_TL16C554 + Addr_LCR) = 0x03;
读取出来的是0xFF00,而不是0xFF80,为什么设置不了呢?
4)串口助手发送数据,间隔1ms ,10ms,100ms
示波器测得数据已经到TL16C554的RX引脚,但始终不能读到RBR的值,为0xFF00;
估计RBR的数据不能读取和LCR没有设置bit7位相关,请教各位是什么原因呢?