Hello, I have a similar problem. Im trying to convert the ADCs with DMA but Im having no DMA interrupt. Not sure if the ADC is working. I also posted in the forum:
. I also sent a technical question to ST as I still did not have a reply from the forum. If a get a technical answer from ST, I will send it to you. Thanks Johann
i am trying to get ADC reading in interrupt.i have kept adc in continuous conversion mode, with EOC interrupt enabled.
i assumed that i should get interrupt after each EOC from where i can then collect the ADC reading. but i have been unable to get any interrupt from ADC. i checked the ADC by polling, where i get correct the reading. i am using RIDE 7 with GCC. and ST library functions. NVIC CONFIGURATION NVIC_InitStructure.NVIC_IRQChannel = ADC1_2_IRQChannel; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;//0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); ADC_ITConfig(ADC1, ADC_IT_EOC, ENABLE); ADC CONFIGURATION GPIO_InitTypeDef GPIO_InitStructure; ADC_InitTypeDef ADC_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_Init(GPIOC, &GPIO_InitStructure); ADC_InitStructure.ADC_Mode = ADC_Mode_Independent; ADC_InitStructure.ADC_ScanConvMode = DISABLE; ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None; ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; ADC_InitStructure.ADC_NbrOfChannel = 1; ADC_Init(ADC1, &ADC_InitStructure); ADC_RegularChannelConfig(ADC1, ADC_Channel_14, 1,ADC_SampleTime_239Cycles5); ADC_Cmd(ADC1, ENABLE); ADC_ResetCalibration(ADC1); while(ADC_GetResetCalibrationStatus(ADC1)!= RESET); ADC_StartCalibration(ADC1); while(ADC_GetCalibrationStatus(ADC1) != RESET); interrupt handler void ADC1_2_IRQHandler(void) { if(ADC_GetITStatus(ADC1, ADC_IT_EOC) != RESET) { ADC_TEMP1 = ADC_GetConversionValue(ADC1)&0x0FFF; } } i trigger ADC using ADC_SoftwareStartConvCmd(ADC1, ENABLE); after this i assume i should get interrupt on each conversion. i guess i am missing something. but dont know what. thanks in advance. pavan k [ This message was edited by: pavan.karmakar on 28-01-2009 06:38 ]
Hello, I have a similar problem. Im trying to convert the ADCs with DMA but Im having no DMA interrupt. Not sure if the ADC is working. I also posted in the forum:
. I also sent a technical question to ST as I still did not have a reply from the forum. If a get a technical answer from ST, I will send it to you. Thanks Johann
Hello. I still have no answer from St technical support. In the meantime Im working to fix the line. I will notify you. thanks. To tell you the truth, I ran out of ideas, as followed examples. Im feeling in the corner :)
Hello. Thanks for the code. Unluckily the DMA did not occur in mine. Please, was the ADC1_DR_Address set as ((u32)0x40012444C)?. Please how was ADCConvertedValue decalred? Thanks Johann
Sorry I missed some declaration in my code: #define ADC1_DR_Address ((u32)0x4001244C) #define NumberOfSample 50 u16 ADCConvertedValue[NumberOfSample]; B.R. M3allem