高中生
最后登录1970-1-1
在线时间 小时
注册时间2015-12-29
|
有人用过AT45DB161D的Flash片子没? 我读取的ID号是全FF 正确的应该是0x1F260000 求助啊 纠结好久了~~~
FlashID = SPI_FLASH_ReadID();
u32 SPI_FLASH_ReadID(void)
{
u32 Temp = 0, Temp0 = 0, Temp1 = 0, Temp2 = 0, Temp3 = 0;
/* Select the FLASH: Chip Select low */
SPI_FLASH_CS_LOW();
/* Send "RDID " instruction */
SPI_FLASH_SendByte(0x9F); //Manufacturer and Device Read Datasheet P44
/* Read a byte from the FLASH */
Temp0 = SPI_FLASH_SendByte(Dummy_Byte);
//printf("Temp0 =0x%X\n",Temp0);
/* Read a byte from the FLASH */
Temp1 = SPI_FLASH_SendByte(Dummy_Byte);
// printf("Temp1 =0x%X\n",Temp1);
/* Read a byte from the FLASH */
Temp2 = SPI_FLASH_SendByte(Dummy_Byte);
// printf("Temp2 =0x%X\n",Temp2);
/* Read a byte from the FLASH */
Temp3 = SPI_FLASH_SendByte(Dummy_Byte);
// printf("Temp3 =0x%X\n",Temp3);
/* Deselect the FLASH: Chip Select high */
SPI_FLASH_CS_HIGH();
Temp = (Temp0 << 24) | (Temp1 << 16) | (Temp2<<8) | Temp3;
return Temp;
}
|
|