/** * @brief Configure TIM19 channel 2 to trigger the SDADC conversion * @param None * @retval None */ static void TIM_Config(void) { TIM_OCInitTypeDef TIM_OCInitStructure; TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; /* Enable TIM19 clock */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM19, ENABLE); /* TIM19 Configuration */ TIM_DeInit(TIM19); /* Fills each TIM_TimeBaseInitStruct member with its default value */ TIM_TimeBaseStructInit(&TIM_TimeBaseStructure); /* Time base configuration: MPX2102_SDADC will be triggered each sysclk/Period = 72MHz/10000 = 7.2 KHz */ TIM_TimeBaseStructure.TIM_Period = 10000; TIM_TimeBaseStructure.TIM_Prescaler = 0; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(TIM19, &TIM_TimeBaseStructure); /* PWM1 Mode configuration: Channel2 (OC2) */ TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_Pulse = 10000/2; TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High; TIM_OC2Init(TIM19, &TIM_OCInitStructure); /* Enable TIM19 counter */ TIM_Cmd(TIM19, ENABLE); } 这是下载的一个关于用TIM19的2通道作为触发源来触发 SDADC1采集的,但这个TIM19的初始化配置在哪里写出来是用TIM19的2通道呢?我看得不是很明白 因为现在我要改成SDADC3来采集,但SDADC3的触发源是TIM19的4通道,如果要上面的程序改成4通道,要怎么修改呢?谢谢。 |
STM32F3 硬件I2C 驱动OLED 求助!!
STM32F303使用定时器触发双ADC常规同步采样模式
哪位大哥传下STM32F334 Nucleo的工程模板给我下
STM32F334 不能串口下载
关于STM32F334的HRTIM分辨率问题
STM32F303+LCD1602程序问题,不只为什么点不亮?
STM32F334的ADC使用问题
STM32F334 HRTIM形成移相全桥波形问题
有用过STM32F373VC的板子么 iic 例程不好使
STM32F3 ADC外部触发采样达不到7.2MSPS
RE:请问有谁用过STM32F373 SDADC3功能的?有些疑问
现在是不是用库用的太多了,都不习惯看寄存器手册了吧
RE:请问有谁用过STM32F373 SDADC3功能的?有些疑问
你要改用4通道,只需要更改这段代码便是
/* PWM1 Mode configuration: Channel2 (OC2) */
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM_OCInitStructure.TIM_Pulse = 10000/2;
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
TIM_OC2Init(TIM19, &TIM_OCInitStructure);
改为: TIM_OC4Init(TIM19, &TIM_OCInitStructure);
模式用PWM2也行的
回复:请问有谁用过STM32F373 SDADC3功能的?有些疑问
楼主贴出来的程序已经全有了
你要改用4通道,只需要更改这段代码便是
/* PWM1 Mode configuration: Channel2 (OC2) */
TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
TIM_OCInitStructure.TIM_Pulse = 10000/2;
TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
TIM_OC2Init(TIM19, &TIM_OCInitStructure);
改为: TIM_OC4Init(TIM19, &TIM_OCInitStructure);
模式用PWM2也行的
===================================
太感谢了。我太大意,我以为是在后面的参数设置的,谢谢,有反应了
RE:请问有谁用过STM32F373 SDADC3功能的?有些疑问