S3C2440 SPI接收问题请教, 程序代码如下所示. 我通过示波器能够抓到MISO,MOSI的正确波形,说明数据发送和接收都是正确的,可就是2440寄存器SPRDAT0没有数值,始终是0.
各位大侠估计什么原因?ARM MISO管脚显示信号都是正确的,相应接收寄存器却没有数值?
SPI_CtrlBlk.pSPIReg->SPTDAT0 = 0xaa;
RETAILMSG(1, (TEXT("SPI_Read send = 0x%x \r\n"), SPI_CtrlBlk.pSPIReg->SPTDAT0));
DWORD dwRet = WaitForSingleObject(SPI_CtrlBlk.hSPIEvent, SPI_RX_DELAY);
InterruptDone(SPI_CtrlBlk.SPI_Intr);
if (dwRet == WAIT_TIMEOUT)
{
RETAILMSG (1, (TEXT("- ")TEXT(__FUNCTION__)TEXT(" WAIT_TIMEOUT %d \r\n"), GetLastError() ));
return 0;
}
recv = SPI_CtrlBlk.pSPIReg->SPRDAT0;
RETAILMSG(1, (TEXT("SPI_Read recv = 0x%x \r\n"), recv));
时钟信号由谁发生??
回答了这个问题你就知道问题所在了