新手入门
- 积分
- 14
- 金钱
- 14
- 注册时间
- 2017-9-6
- 在线时间
- 23 小时
|
发表于 2017-9-19 21:26:26
|
显示全部楼层
[mw_shl_code=c,true] TIM_TimeBaseStructure.TIM_Prescaler = 0;
TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_CenterAligned1 ;
TIM_TimeBaseStructure.TIM_Period = 36000/fz;//fz=25
TIM_TimeBaseStructure.TIM_ClockDivision = 0;
TIM_TimeBaseStructure.TIM_RepetitionCounter = 0;
TIM_ARRPreloadConfig(TIM1, ENABLE);
TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure);
void TIM5_UPDATE(void)
{
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
TIM_TimeBaseStructure.TIM_Prescaler= 0;
TIM_TimeBaseStructure.TIM_CounterMode= TIM_CounterMode_Up;
TIM_TimeBaseStructure.TIM_Period= (400000/fqc);//fqc=50
TIM_TimeBaseStructure.TIM_ClockDivision= 0;
TIM_TimeBaseInit( TIM5, &TIM_TimeBaseStructure );
TIM_ITConfig( TIM5, TIM_IT_Update, ENABLE );
TIM_Cmd( TIM5, ENABLE );[/mw_shl_code] |
|