| Electronic Components Datasheet Search |
|
AN3422 Datasheet(PDF) 48 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3422 Datasheet(HTML) 48 Page - STMicroelectronics |
|
48 / 52 page ![]() Firmware migration using the library AN3422 48/52 Doc ID 018976 Rev 2 /* Enable ADC1 clock */ RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE); /* Common configuration *****************************************************/ /* ADCCLK = HSI/1 */ ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div1; ADC_CommonInit(&ADC_CommonInitStructure); /* ADC1 configuration */ ADC_InitStructure.ADC_ScanConvMode = ENABLE; ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConvEdge_None; ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; ADC_InitStructure.ADC_NbrOfConversion = 1; ADC_Init(ADC1, &ADC_InitStructure); /* ADC1 regular channel14 configuration */ ADC_RegularChannelConfig(ADC1, ADC_Channel_14, 1, ADC_SampleTime_4Cycles); /* Enable the request after last transfer for DMA Circular mode */ ADC_DMARequestAfterLastTransferCmd(ADC1, ENABLE); /* Enable ADC1 DMA */ ADC_DMACmd(ADC1, ENABLE); /* Enable ADC1 */ ADC_Cmd(ADC1, ENABLE); /* Wait until the ADC1 is ready */ while(ADC_GetFlagStatus(ADC1, ADC_FLAG_ADONS) == RESET) { } /* Start ADC1 Software Conversion */ ADC_SoftwareStartConv(ADC1); ... The main changes in the source code/procedure in L1 series vs. F1 are described below: 1. ADC configuration is made through two functions ADC_CommonInit() and ADC_Init(): ADC_CommonInit() function is used to configure the ADC analog clock prescaler. 2. To enable the generation of DMA requests continuously at the end of the last DMA transfer, the ADC_DMARequestAfterLastTransferCmd() function should be used. 3. No calibration is needed 5.7 PWR The table below presents the PWR driver API correspondence between STM32F10x and STM32L1xx Libraries. You can easily update your application code by replacing STM32F10x functions by the corresponding function in STM32L1xx Library. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |