用示波器测的ARM向字库芯片发送数据时SCLOCK和MOSI信号正确,但是接收时SCLOCK和MISO没信号,请问是什么问题?<br /> GPIO_Config(GPIO0, 0x0077, GPIO_AF_PP); //Configure GPI00 on mode Alternate function Push Pull<br /> GPIO_Config(GPIO2, 0x8000,GPIO_OUT_PP);<br /> GPIO_BitWrite(GPIO2, 15,1);<br /> BSPI_BSPI0Conf(ENABLE); //Enable the BSPI0 interface<br /><br />//-------------------------------------------<br />//Configure BSPI0 as a Master<br />//-------------------------------------------<br /><br /> BSPI_Init(BSPI0); //Initialize BSPI0<br /> BSPI_ClockDividerConfig(BSPI0, 6); //Configure Baud rate Frequency: ---> APB1/6<br /> BSPI_Enable(BSPI0, ENABLE); //Enable BSPI0<br /> BSPI_MasterEnable(BSPI0, ENABLE); //Configure BSPI0 as a Master<br /> BSPI_ClkActiveHigh(BSPI0, ENABLE); //Configure the clock to be active high<br /> BSPI_ClkFEdge(BSPI0, DISABLE); //Enable capturing the first Data sample on the first edge of SCK<br /> BSPI_8bLEn(BSPI0, ENABLE); //Set the word length to 16 bit<br /> BSPI_TrFifoDepth(BSPI0, 7); //Configure the depth of transmit to 7 words<br /> pTxBuffer = bArray; //Point on the word to transit<br /><br />//-------------------------------------------<br />//Configue BSPI1 as a Slave<br />//-------------------------------------------<br /><br /> BSPI_Init(BSPI1); //Initialize BSPI1<br /> BSPI_ClockDividerConfig(BSPI1, 8); //Configure Baud rate Frequency :-->APB1/8<br /> BSPI_Enable(BSPI1, ENABLE); //Enable BSPI1<br /> BSPI_MasterEnable(BSPI1, DISABLE); //Configure BSPI0 as a Slave<br /> BSPI_ClkActiveHigh(BSPI1, ENABLE); //Configure the clock to be active high<br /> BSPI_ClkFEdge(BSPI1, DISABLE); //Enable capturing the first Data sample on the first edge of SCK<br /> BSPI_8bLEn(BSPI1, ENABLE); //Set the word length to 16 bit<br /> BSPI_RcFifoDepth(BSPI1, 5); //Configure the depth of receive to 5 word<br /><br />//---------------------------------------------<br />//Send five words of buffer ---> BSPI0<br />//---------------------------------------------<br /><br /> get_zm();<br /> //BSPI_BufferSend(BSPI0, pTxBuffer, 5);<br /><br /> while(1)<br />{ GPIO_BitWrite(GPIO2, 15,0);<br /> BSPI_BufferSend(BSPI0,ZiKu_Command, 5); //5<br /> //BSPI_MasterEnable(BSPI0, DISABLE);<br /> BSPI_BufferReceive(BSPI0, pRxBuffer, 8); //8<br /> GPIO_BitWrite(GPIO2, 15,1);<br /> //BSPI_MasterEnable(BSPI0, ENABLE);<br /> for(k=0;k<8000;k++);<br />// for(i=0;i<8;i++)<br />// test=*pRxBuffer++;<br />} |
|