这是利用固件库点亮LED修改的用STM32F103指南者驱动28BYJ-24步进电机的驱动程序,是根据LN2003的用户手册自己写的,接口是OU1 1234依次对应PA 4567,写得有点糙不过动起来是可以的了~
2019-12-21 21:41:59 5.62MB 步进电机 指南者 STM32F1
1
STM32F1系列是意法半导体(STMicroelectronics)推出的基于ARM Cortex-M3内核的微控制器,其中STM32F103C8T6型号是常用的入门级芯片,具有丰富的外设接口,包括多个串行通信接口(UART)。在实际应用中,我们常常需要进行串口数据的收发,以便于设备之间的通信。本教程重点讲解如何在STM32F103C8T6上实现串口1(USART1)的DMA(Direct Memory Access)收发和串口2(USART2)的普通模式收发。 一、串口基础知识 串口通信是一种异步通信方式,通常用于低速、长距离的数据传输。常见的串口标准有RS-232、UART和USART等。STM32的USART支持全双工通信,可实现数据同时发送和接收。 二、串口配置 1. 波特率配置:根据通信需求设置串口的波特率,例如9600、115200等。 2. 数据位:通常设置为8位。 3. 奇偶校验:可选无校验、奇校验、偶校验。 4. 停止位:通常为1位,也可选择2位。 5. 同步/异步模式:STM32的USART默认为异步模式。 三、串口收发模式 1. DMA收发:DMA可以减轻CPU负担,自动处理串口的收发数据。在STM32中,USART1支持DMA收发,需要配置DMA通道,并关联到USART的TX/RX管脚。 2. 普通模式收发:CPU直接读写串口寄存器完成数据的收发,适用于数据量小或者波特率较低的情况。 四、串口1(USART1)DMA收发 1. DMA初始化:配置DMA控制器,选择合适的通道(如DMA1 Channel2 for TX,DMA1 Channel3 for RX),并设置传输方向、数据宽度、内存地址和外设地址。 2. USART1配置:开启USART1时钟,设置波特率、数据格式等参数,并启用DMA功能。 3. DMA请求设置:使能USART1的DMA发送/接收请求,当数据准备好或接收到数据时,DMA会自动启动传输。 4. 中断处理:设置DMA中断,当DMA传输完成时,通过中断服务程序处理数据。 五、串口2(USART2)普通模式收发 1. USART2配置:同USART1,但不开启DMA功能。 2. 发送数据:将待发送的数据写入USART2的DR寄存器,数据发送完成后,TXE标志位会被置位,可以通过轮询或中断方式处理。 3. 接收数据:当RXNE标志位被置位时,表示接收缓冲区中有新数据,读取DR寄存器获取数据。 六、不定长数据处理 在实际应用中,收发的数据长度可能不固定。对于DMA模式,可以预先分配足够大的缓冲区,然后在DMA中断服务程序中判断数据的结束条件,如特定的结束符或预设的帧长度。对于普通模式,同样需要在接收中断或轮询中判断数据的完整性。 七、注意事项 1. DMA和USART的时钟需要开启。 2. DMA和USART的中断要正确配置,防止数据丢失。 3. DMA传输过程中,避免同时访问发送/接收的内存区域,以防数据冲突。 通过以上步骤,可以在STM32F103C8T6上实现串口1的DMA收发和串口2的普通模式收发,满足不同场景下的通信需求。在实际项目中,结合具体应用进行优化和调试,确保串口通信的稳定性和效率。
2019-12-21 21:39:42 5.97MB 串口收发
1
基于stm32f103开发板和L298N驱动器进行直流电机调速,通过控制输出PWM波,并且调节占空比来调节直流电机的速度。
2019-12-21 21:38:50 6.62MB stm32 l298n 电机
1
这是正点原子的STM32的F1的精英版寄存器的开发指南。
2019-12-21 21:35:15 27.72MB STM32F1 正点原精英版 寄存器版本
1
内部包含2个压缩包 一个为已经移植好的STM32F103_uCOS-II的Demo,还有一个为STM32F103裸机Demo、uCOS-II源码、STM32F107的uCOS-II官方Demo
2019-12-21 21:33:48 19.55MB uCOS-II
1
Component List STM32F100C4T6B, STM32F100C4T7B, STM32F100C6T6B, STM32F100C6T6BTR, STM32F100C6T7B, STM32F100C8T6B, STM32F100C8T6BTR, STM32F100CBT6B, STM32F100CBT7B, STM32F100R4H6B, STM32F100R4T6B, STM32F100R4T6BTR, STM32F100R6H6B, STM32F100R6T6, STM32F100R6T6B, STM32F100R6T6BTR, STM32F100R8H6B, STM32F100R8T6B, STM32F100R8T6BTR, STM32F100RBH6B, STM32F100RBH6BTR, STM32F100RBT6B, STM32F100RBT6BTR, STM32F100RCT6B, STM32F100RDT6, STM32F100RDT6B, STM32F100RET6, STM32F100RET6B, STM32F100RET6BTR, STM32F100RET7B, STM32F100V8T6B, STM32F100V8T7B, STM32F100VBT6B, STM32F100VBT6BTR, STM32F100VCT6, STM32F100VCT6B, STM32F100VCT6BTR, STM32F100VDT6, STM32F100VDT6B, STM32F100VDT6BTR, STM32F100VDT7B, STM32F100VET6, STM32F100VET6B, STM32F100VET7B, STM32F100ZCT6B, STM32F100ZDT6B, STM32F100ZET6B, STM32F100ZET7B, STM32F101C4T6A, STM32F101C6T6A, STM32F101C6T6ATR, STM32F101C8T6, STM32F101C8T6TR, STM32F101C8U6, STM32F101C8U6TR, STM32F101CBT6, STM32F101CBT6TR, STM32F101R4T6A, STM32F101R6T6A, STM32F101R6T6ATR, STM32F101R8T6, STM32F101R8T6TR, STM32F101RBT6, STM32F101RBT6TR, STM32F101RCT6, STM32F101RCT6TR, STM32F101RDT6, STM32F101RDT6TR, STM32F101RET6, STM32F101RFT6, STM32F101T4U6A, STM32F101T6U6A, STM32F101T6U6ATR, STM32F101T8U6, STM32F101T8U6TR, STM32F101TBU6, STM32F101V8T6, STM32F101V8T6TR, STM32F101VBT6, STM32F101VBT6TR, STM32F101VCT6, STM32F101VCT6TR, STM32F101VDT6, STM32F101VDT6TR, STM32F101VET6, STM32F101VFT6, STM32F101VFT6TR, STM32F101VGT6, STM32F101ZCT6, STM32F101ZDT6, STM32F101ZET6, STM32F102C4T6A, STM32F102C4T6ATR, STM32F102C6T6A, STM32F102C6T6ATR, STM32F102C8T6, STM32F102C8T6TR, STM32F102CBT6, STM32F102CBT6TR, STM32F102R4T6A, STM32F102R6T6A, STM32F102R8T6, STM32F102RBT6, STM32F103C4T6A, STM32F103C6T6A, STM32F103C6T6ATR, STM32F103C6T7A, STM32F103C6T7ATR, STM32F103C6U6A, STM32F103C8T6, STM32F103C8T6TR, STM32F103C8T7, STM32F103CBT6, STM32F103CBT6TR, STM32F103CBT7, STM32F103CBT7TR, STM32F103CBU6, STM32F103R4H6A, STM32F103R4T6A, STM32F103R6H6A, STM32F103R6T6A, STM32F103R6T7A, STM32F103R8H6, STM32F103R8H7, STM32F103R8T6, STM32F103R8T6TR, STM32F103R8T7, STM32F103RBH6, STM32F103RBT6, STM32F103RBT6TR, STM32F103RBT7, STM32F103RBT7TR, STM32F103RCT6, STM32F103RCT6TR, STM32F103RCT7, STM32F103RCY6TR, STM32F103RDT6, STM32F103RDT6TR, STM32F103RDY6TR, STM32F103RET6, STM32F103RET6TR, STM32F103RET7, STM32F103REY6TR, STM32F103RFT6, STM32F103RGT6, STM32F103T4U6A, STM32F103T6U6, STM32F103T6U6A, STM32F103T6U7A, STM32F103T8U6, STM32F103T8U6TR, STM32F103T8U7, STM32F103TBU6, STM32F103TBU7, STM32F103V8H6, STM32F103V8T6, STM32F103V8T6TR, STM32F103VBH6, STM32F103VBH7, STM32F103VBT6, STM32F103VBT6TR, STM32F103VBT7, STM32F103VBT7TR, STM32F103VCH6, STM32F103VCT6, STM32F103VCT6TR, STM32F103VDH6, STM32F103VDH6TR, STM32F103VDT6, STM32F103VEH6, STM32F103VEH7, STM32F103VET6, STM32F103VET6TR, STM32F103VET7, STM32F103VET7TR, STM32F103VFT6, STM32F103VGT6, STM32F103VGT7, STM32F103ZCH6, STM32F103ZCT6, STM32F103ZCT7, STM32F103ZDH6, STM32F103ZDT6, STM32F103ZEH6, STM32F103ZEH6TR, STM32F103ZEH7, STM32F103ZET6, STM32F103ZET6TR, STM32F103ZET7, STM32F103ZFH6, STM32F103ZFT6, STM32F103ZGH6, STM32F103ZGT6, STM32F105R8T6, STM32F105RBT6, STM32F105RBT6TR, STM32F105RCT6, STM32F105RCT7, STM32F105V8T6, STM32F105VBH6, STM32F105VBT6, STM32F105VCT6, STM32F105VCT7, STM32F107RBT6, STM32F107RCT6, STM32F107RCT6TR, STM32F107VBT6, STM32F107VCH6, STM32F107VCT6
2019-12-21 21:32:02 102KB STM32 集成库
1
max4409光照检测stm32作为主控,只需将本代码代替原子iic程序即可
2019-12-21 21:28:18 3KB STM32F1 MAX44009
1
STM32F1开发指南-库函数版本_V3.0 STM32F1开发指南-库函数版本_V3.0 STM32F1开发指南-库函数版本_V3.0
2019-12-21 21:15:52 30.11MB STM32F1
1
stm32F1+gprs的IAP远程升级,app的adc数据采集GPS数据
2019-12-21 21:15:20 8.07MB stm32 gprs IAP adc
1
stm32f1 测量频率 脉冲参量测试仪 只能测频率 占空比没写出来
2019-12-21 21:14:57 5.64MB 测频
1