一个已完成的硬件方案,重新用CUBE重新配置,功能是用SPI接口驱动一片ADC SPI能够接收16位数据即可,PA5 (SCK) PA6(MISO)接ADC 的 SCK MOSI,ADC需要一个周期的矩型波控制启动转换 PA7接到ADC的CONV引脚上 硬件与配置 PA5 PA6 PA7 IO配置 PA5 ALT_PP (SPI_SCK) PA6 INPUT_PP (SPI_MISO) PA7 ALT_PP (TIM3_CH2) 用PWM方式产生脉冲 结果发现无论怎么配置TIM3 PA7死活得不到PWM脉冲,结果发现 CUBE给的代码中将SPI1 CR1的RXONLY为1,而原来的SPI1 CR1的RXONLY 为0 RXONLY改成0脉冲就有了 这个是TIM3_CH2有输出的SPI配置 只要点上RXONLY脉冲就没了 查找数据手册 1 clock and 1 unidirectional data wire (BIDIMODE=0) In this mode, the application can use the SPI either in transmit-only mode or in receive-only mode. ● Transmit-only mode is similar to full-duplex mode (BIDIMODE=0, RXONLY=0): the data are transmitted on the transmit pin (MOSI in master mode or MISO in slave mode) and the receive pin (MISO in master mode or MOSI in slave mode) can be used as a general-purpose IO. In this case, the application just needs to ignore the Rx buffer (if the data register is read, it does not contain the received value). ● In receive-only mode, the application can disable the SPI output function by setting the RXONLY bit in the SPI_CR2 register. In this case, it frees the transmit IO pin (MOSI in master mode or MISO in slave mode), so it can be used for other purposes. 按这个描述 正确做法是 设置RXONLY位 主模式的PA7就被释放出来,可做它用 而事实确是相反 不知道是那里弄错了,还是有别的什么问题 |
æè¾åºçSPIé ç½®
stm32进入stop模式被莫名其妙唤醒(应该是systick)但是无法被WKUP引脚唤醒。
头文件找不到
软件为keil5,头文件未找到
通过FATFS文件系统读写SD卡创建文件可以了,但加入MSC,一直显示一个没有格式化的U盘盘符,也不能格式化,这是什么问题导致的
stm32f103汇编求助
cubemx 生成的freertos代码 在keil ac6下不能编译,有什么解决的方法吗
报错Could not determine GDB version using command: arm-none-eabi-gdb --version
stm32f107vct6配RTL8201例程
STM32F103VGT6 能代替 STM32F103VFT6 吗?
STM32 读取DHT20,跑的官方的例程一直读取失败,初学者,各位大佬能指点一下不