
一个已完成的硬件方案,重新用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的DCode bus是连接到bus matrix的吗?参考手册描述和图片是不符吗?
stm32ide怎么正确的导出项目
STM32F105RBT6 2025年 ROSH REACH 报告
STM32CubeMX 使用"FW_F1 V1.8.6"生成FreeRTOS代码缺少"freertos_mpool.h"?
你好,我的setting里面设置都没有问题。但是显示failed download cortexm3
STM32F103C8出現找不到'STM32100B_EVAL/stm32100b_eval.h' file not found
stm32f407无法配置定时器2为全部dma
STM32F103TBU6 封装是VFQFPN36 将PD0和PD1配置成CAN不成功是什么原因
串口DMA + 空闲中断收发 ?
F103RCT6芯片对AFIO->MAPR寄存器写入时出错