如题,遇到这种情况会是什么原因造成的,麻烦各位前辈帮忙解答。附上我抓到的波形还有程序。
uint8_t MAX31865_SB_Read(uint8_t addr)//SPI Single-Byte Read
{
uint8_t read = 0;
uint8_t i = 0;
NCS_L;
SPI_Delay(0x1F);
for( i = 0; i < 8; i++)
{
SCLK_H;
if (addr & 0x80)
{
SDI_H;
}
else
{
SDI_L;
}
SPI_Delay(0x1F);
SCLK_L;
addr <<= 1;
SPI_Delay(0x1F);
}
SPI_Delay(0x1F);
for (i = 0; i < 8; i++)
{
SCLK_H;
read = read<<1;
SPI_Delay(0x1F);
if(SDO)
{
read++;
}
SCLK_L;
SPI_Delay(0x1F);
}
NCS_H;
return read;
}
|