在线时间0 小时
UID199977
ST金币0
蝴蝶豆0
注册时间2010-7-14
新手上路
- 最后登录
- 1970-1-1
|
a0a.1 0b0c
程序如下:
TIM_DeInit(TIM3);
TIM3_TimeBaseStructure.TIM_Prescaler = 0x0;
TIM3_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
TIM3_TimeBaseStructure.TIM_Period = 0xFFFF;
TIM3_TimeBaseStructure.TIM_ClockDivision = 0x0;
TIM3_TimeBaseStructure.TIM_RepetitionCounter = 0x0;
TIM_TimeBaseInit(TIM3,&TIM3_TimeBaseStructure);
TIM3_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM3_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM3_OCInitStructure.TIM_Pulse = CCR1_Val;
TIM3_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low;
TIM_OC1Init(TIM3,&TIM3_OCInitStructure);
TIM_Cmd(TIM3,ENABLE);
TIM_CtrlPWMOutputs(TIM3,ENABLE);
把TIM3换成TIM1就可以 蒙了我。。。。 |
|