资源简介
基于STM32RCT6的电机速度闭环控制代码,利用编码器进行测速后再通过PID公式实现电机速度闭环。
代码片段和文件信息
/**************************************************************************//**
* @file core_cm3.c
* @brief CMSIS Cortex-M3 Core Peripheral Access layer Source File
* @version V1.30
* @date 30. October 2009
*
* @note
* Copyright (C) 2009 ARM Limited. All rights reserved.
*
* @par
* ARM Limited (ARM) is supplying this software for use with Cortex-M
* processor based microcontrollers. This file can be freely distributed
* within development tools that are supporting such ARM based processors.
*
* @par
* THIS SOFTWARE IS PROVIDED “AS IS“. NO WARRANTIES WHETHER EXPRESS IMPLIED
* OR STATUTORY INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
* ARM SHALL NOT IN ANY CIRCUMSTANCES BE LIABLE FOR SPECIAL INCIDENTAL OR
* CONSEQUENTIAL DAMAGES FOR ANY REASON WHATSOEVER.
*
******************************************************************************/
#include
/* define compiler specific symbols */
#if defined ( __CC_ARM )
#define __ASM __asm /*!< asm keyword for ARM Compiler */
#define __INLINE __inline /*!< inline keyword for ARM Compiler */
#elif defined ( __ICCARM__ )
#define __ASM __asm /*!< asm keyword for IAR Compiler */
#define __INLINE inline /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */
#elif defined ( __GNUC__ )
#define __ASM __asm /*!< asm keyword for GNU Compiler */
#define __INLINE inline /*!< inline keyword for GNU Compiler */
#elif defined ( __TASKING__ )
#define __ASM __asm /*!< asm keyword for TASKING Compiler */
#define __INLINE inline /*!< inline keyword for TASKING Compiler */
#endif
/* ################### Compiler specific Intrinsics ########################### */
#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
/* ARM armcc specific functions */
/**
* @brief Return the Process Stack Pointer
*
* @return ProcessStackPointer
*
* Return the actual process stack pointer
*/
__ASM uint32_t __get_PSP(void)
{
mrs r0 psp
bx lr
}
/**
* @brief Set the Process Stack Pointer
*
* @param topOfProcStack Process Stack Pointer
*
* Assign the value ProcessStackPointer to the MSP
* (process stack pointer) Cortex processor register
*/
__ASM void __set_PSP(uint32_t topOfProcStack)
{
msr psp r0
bx lr
}
/**
* @brief Return the Main Stack Pointer
*
* @return Main Stack Pointer
*
* Return the curren
相关资源
- 基于STM32的1MHz、1KHz和1Hz同步方波产生
- STM32库函数DS1302驱动文件
- STM32 DS1302驱动
- STM32 DS18b20
- 基于STM32F103C8T6的手持MP3完整PCB工程文
- STM32L4超低功耗特性概述
- STM32智能家居完整项目代码
- 用STM32的内置Flash做一个超小U盘
- stm32基于轮询方式的串口收发程序
- STM32F030C8T6串口例程
- RFID RC522 stm32f103c8t6 读写demo
- STM32 单位时间内输入方波个数统计函
- 可控硅调节220光程序和原理图.zip
- STM32_ad7705程序
- stm32 控制语音芯片 ISD1760
- STM32F103VCT6设计
- stm32f103c+电机驱动和测速+can+rs485等原
- stm32 uart1 发送接收数据
- 完美解决proteus仿真stm32
- 基于STM32的示波器原理图
- 基于STM32F103的指纹识别程序
- STM32_TCS34725数字颜色传感器
- 基于STM32的MP3播放器设计与实现(提供
- ADS131代码
- STM32F103C8T6脚位分布
- 基于STM32 控制电机程序
- 正点原子STM32F103+MPU6050实现计步器源码
- STM32矩阵键盘HAL库实现,轮询方式,方
- stm32F103的GRBL移植
- stm32f767的cadence的原理图库和pcb库
评论
共有 条评论