-
MM32F031K6T的ADC转换速率好像达不到1Msps
我使用库例程,时钟使用HSI,72MHz,APB2不分频;ADC_PRESCARE设置为12;设置采样通道2个,通道采样时间在55.5周期以上,符合数据手册。但如果采样时间设置为13.5周期,却达不到111ksps,任何低于55.5周期的设置,都只能达到65ksps左右;或者ADC_PRESCARE设置为11及以下,提高ADC时钟,也都只能达到65ksps左右;请问瓶颈在哪儿?下面是ADC配置和时钟配置//ADC配置,2个采样通道voidADCMultiChannelInit(){GPIO_Config_AIN(GPIOA,GPIO_Pin_1);GPIO_Config_AIN(GPIOA,GPIO_Pin_3);ADC_InitTypeDefADC_InitStructure;ADC_StructInit(&ADC_InitStructure);//InitializePA1toanaloginputmodeRCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1,ENABLE);//EnableADCclockADC_InitStructure.ADC_Resolution=ADC_Resolution_12b;ADC_InitStructure.ADC_PRESCARE=ADC_PCLK2_PRESCARE_12;//ADCprescalefactorADC_InitStructure.ADC_Mode=ADC_Mode_Continuous_Scan;//SetADCmodetocontinuousconversionmodeADC_InitStructure.ADC_DataAlign=ADC_DataAlign_Right;//ADdataright-justifiedADC_InitStructure.ADC_ExternalTrigConv=ADC_ExternalTrigConv_T1_CC1;ADC_Init(ADC1,&ADC_InitStructure);ADC_RegularChannelConfig(ADC,ADC_Channel_DisableAll,0,ADC_SampleTime_13_5Cycles);//BlockallchannelsADC_RegularChannelConfig(ADC1,ADCch1,0,ADC_SampleTime_13_5Cycles);//EnablethechannelADC_RegularChannelConfig(ADC1,ADCch2,0,ADC_SampleTime_13_5Cycles);//Enablethechannel#ifdefADC_USE_DMAADC_DMACmd(ADC1,ENABLE);//EnableADCDMA#elseADC_ITConfig(ADC1,ADC_IT_EOC,ENABLE);//DMAinterruptinitializationNVIC_InitTypeDefNVIC_InitStruct;NVIC_InitStruct.NVIC_IRQChannel=ADC_COMP_IRQn;NVIC_InitStruct.NVIC_IRQChannelPriority=0;NVIC_InitStruct.NVIC_IRQChannelCmd=ENABLE;NVIC_Init(&NVIC_InitStruct);#endifADC_Cmd(ADC
2022-02-26 16 -
华大HC32L136 LPUART0异常
采用hc32l13x_ddl_Rev1.9.1Lite里面example目录下的lpuart示例,将串口IO适配成自己硬件板子,板子TX\RX接线到PC端;1.发送时钟引用PCLK,与PC端通信正常;2.发送时钟用内部RCL(38.4K),数据发送不出来,并且PC端给硬件发送数据,也无中断触发;stcCfg.enStopBit=LPUart1bit;///
2021-02-27 8