周公您好: 目前买了贵公司的SC16IS752芯片,用LPC2368来控制,使用的控制总线为SPI。但是在初始化以后,发现读取的寄存器的值一为未0XFF,包括IIR和IER等寄存器,由于是参考贵公司的初始化程序代码,并且SPI控制经测试没有问题,找不到出错的原因,望指教!初始化程序如下: void SC16IS752_Init_ChB (void) // program channel B for SPI-IrDA { SPI_wr_752 (LCR, 0x80, 2); // 0x80 to access program baud rate SPI_wr_752 (DLL, 0x80, 2); // set IRDA to 2400 bps divider 0x0180 SPI_wr_752 (DLH, 0x01, 2); // program baud rate high byte SPI_wr_752 (LCR, 0XBF, 2); // access EFR SPI_wr_752 (EFR, 0X10, 2); // enable enhanced registers SPI_wr_752 (LCR, 0x03, 2); // 8 data bit, 1 stop bit, no parity SPI_wr_752 (FCR, 0x07, 2); // enable FIFO mode SPI_wr_752 (SPR, 'B', 2); // scratch pad = character B (0x42) //SPI_wr_752 (EFCR, 0x00, 2); // IrDA SIR 115.2 Kbps SPI_wr_752 (MCR, 0x00, 2); // enable IRDA mode SPI_wr_752 (IER, 0x01, 2); // enable receive interrupt } void SpiControl_Task(void *pdata) { BYTE IIRState; // SPIInit(); SSP0Init(); SC16IS752_Init_ChB(); while(1) { IIRState = SPI_rd_752(IIR,2); } } |