中级会员
 
- 积分
- 414
- 金钱
- 414
- 注册时间
- 2017-6-30
- 在线时间
- 41 小时
|
5金钱
void Erase_Chip(void)
{
//06h 片选
GPIO_WriteBit(NorFlash_SSN_PORT, NorFlash_SSN_PIN,RESET); //cs low
GPIO_WriteBit(NorFlash_SSN_PORT, NorFlash_SSN_PIN,RESET); //cs low
SPI_SendData(SPI1,0x06);
while(SPI_GetFlagStatus(SPI1, SPI_FLAG_BSY) ==RESET);
SPI_ReceiveData(SPI1);
GPIO_WriteBit(NorFlash_SSN_PORT, NorFlash_SSN_PIN,SET); //cs high
//60h
GPIO_WriteBit(NorFlash_SSN_PORT, NorFlash_SSN_PIN,RESET); //cs low
GPIO_WriteBit(NorFlash_SSN_PORT, NorFlash_SSN_PIN,RESET); //cs low
SPI_SendData(SPI1,0x60);
while(SPI_GetFlagStatus(SPI1, SPI_FLAG_BSY) == RESET);
SPI_ReceiveData(SPI1);
GPIO_WriteBit(NorFlash_SSN_PORT, NorFlash_SSN_PIN,SET); //cs high
WaitWipReset();
}
程序卡在 while(SPI_GetFlagStatus(SPI1, SPI_FLAG_BSY) ==RESET); 这句话。
|
|