芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密

飞芯科技提供芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密逆向服务

芯片复制STM32单片机对正交编码器的驱动

芯片复制STM32正交编码器驱动,引入(突变)带进位的位置环和速度环


#include “stm32f10x.h”

#include “stm32f10x_encoder.h”

#include “sys.h”

#include “usart.h”

#include “led.h”

#define COUNTER_RESET(u16)0

#define ICx_FILTER(u8) 0 // 6《-》 670nsec

#define TIMx_PRE_EMPTION_PRIORITY 1

#define TIMx_SUB_PRIORITY 0

//#define MAX_COUNT ENCODER_TIM_PERIOD/2

volatile s16 Right_hEncoder_Timer_Overflow; //编码器计数值溢出标志

volatile s16 Right_hEncoder_Timer_Overflow_High;//编码器计数值溢出标志高位

volatile s16 Right_hRot_Speed;//当前的速度

volatile s16 Right_hRot_Acceleration;//当前的加速度

s32 Right_CurrentCount = 0;//编码器当前的总计数值

s32 Right_CurrentCount_high = 0;//编码器当前的总计数值高位计算公式,注意结果可能超过32位的表示范围Left_CurrentCount_high*S32_MAX+Left_CurrentCount

volatile s16 Left_hEncoder_Timer_Overflow;

volatile s16 Left_hEncoder_Timer_Overflow_High;

volatile s16 Left_hRot_Speed;

volatile s16 Left_hRot_Acceleration;

s32 Left_CurrentCount = 0;

芯片复制s32 Left_CurrentCount_high = 0;



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.taihedz.cn
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信