-
HK32F030MF4P6 PC3-TIM1_CH3 PWM 没输出
voidTIM1_WindPwm_Config(void)//16KTIM1_CH3{GPIO_InitTypeDefGPIO_InitStructure;TIM_TimeBaseInitTypeDefTIM_TimeBaseStructure;TIM_OCInitTypeDefTIM_OCInitStructure;RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC,ENABLE);RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1,ENABLE);//使能IOMUX时钟RCC_APB1PeriphClockCmd(RCC_APB1Periph_IOMUX,ENABLE);GPIO_IOMUX_PinAFConfig(GPIOC,GPIO_PinSource3,IOMUX_PC3_TIM1CH3);GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF;GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;GPIO_InitStructure.GPIO_Pin=GPIO_Pin_3;GPIO_InitStructure.GPIO_PuPd=GPIO_PuPd_NOPULL;//GPIO_PuPd_DOWN;GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;GPIO_Init(GPIOC,&GPIO_InitStructure);GPIO_PinAFConfig(GPIOC,GPIO_PinSource3,GPIO_AF_3);/*TimeBaseconfiguration*/TIM_TimeBaseStructure.TIM_Prescaler=0;TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up;TIM_TimeBaseStructure.TIM_Period=TIM1_PERIOD-1;TIM_TimeBaseStructure.TIM_ClockDivision=0;TIM_TimeBaseStructure.TIM_RepetitionCounter=0;TIM_TimeBaseInit(TIM1,&TIM_TimeBaseStructure);/*Channel1,2,3and4ConfigurationinPWMmode*/TIM_OCInitStructure.TIM_OCMode=TIM_OCMode_PWM2;TIM_OCInitStructure.TIM_OutputState=TIM_OutputState_Enable;TIM_OCInitStructure.TIM_OutputNState=TIM_OutputNState_Disable;//TIM_OutputNState_Enable;TIM_OCInitStructure.TIM_Pulse=1000;TIM_OCInitStructure.TIM_OCPolarity=TIM_OCPolarity_Low;//TIM_OCInitStructure.TIM_OCNPolarity=TIM_OCNPolarity_Low;TIM_OCInitStructure.TIM_OCIdleState=TIM_OCIdleState_Set;//TIM_OCInitStructure.TIM_OCNIdleState=TIM_OCIdleState_Reset;TIM_OC3Init(TIM1,&TIM_OCInitStructure);/*TIM1counterenable*/TIM_Cmd(TIM1,ENABLE);/*TI
2021-03-25 2 -
N76E003AT20 & MS51FB91E DID 问题
N76E003AT20DID:0x3650MS51FB91EDID:0x3650(手册),实际:0x4B21(Bu-Link->Debug->Setting获得),哪个是正确的(详见截图)?实际我想通过读取DID来判断是N76E003AT20还是MS51FB91E,这个方法可行吗(同一型号的芯片DID是一直不变的吗?)?求解答。@奔跑的牛@clyu@Risn
2021-01-28 7