ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Четверг
18 июля
609633 Топик полностью
Nikolay801_ (16.07.2015 11:32, просмотров: 41) ответил Dingo на Есть версии, почему STM32F407 может GPIO дёргать так (по времени)? Надо прочитать 3 байта, CS в это время дёргать нельзя, его формирую дрыгногой. Запускаю, жду флага "принят байт", забираю первый, второй, третий, потом снимаю CS. На осциллограмме
у меня так  uint8_t sFLASH_SendByte(uint8_t byte) { /*!< Loop while DR register in not emplty */ while (SPI_I2S_GetFlagStatus(sFLASH_SPI, SPI_I2S_FLAG_TXE) == RESET); /*!< Send byte through the SPI1 peripheral */ SPI_I2S_SendData(sFLASH_SPI, byte); /*!< Wait to receive a byte */ while (SPI_I2S_GetFlagStatus(sFLASH_SPI, SPI_I2S_FLAG_RXNE) == RESET); /*!< Return the byte read from the SPI bus */ return SPI_I2S_ReceiveData(sFLASH_SPI); } void sFLASH_ReadBuffer(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) { /*!< Select the FLASH: Chip Select low */ sFLASH_CS_LOW(); /*!< Send "Read from Memory " instruction */ sFLASH_SendByte(sFLASH_CMD_READ); /*!< Send ReadAddr high nibble address byte to read from */ //sFLASH_SendByte((ReadAddr & 0xFF0000) >> 16); /*!< Send ReadAddr medium nibble address byte to read from */ sFLASH_SendByte((ReadAddr& 0xFF00) >> 8); /*!< Send ReadAddr low nibble address byte to read from */ sFLASH_SendByte(ReadAddr & 0xFF); while (NumByteToRead--) /*!< while there is data to be read */ { /*!< Read a byte from the FLASH */ *pBuffer = sFLASH_SendByte(sFLASH_DUMMY_BYTE); /*!< Point to the next location where the byte read will be saved */ pBuffer++; } /*!< Deselect the FLASH: Chip Select high */ sFLASH_CS_HIGH(); }
Будь ты проклят, Перри-Утконос!