Question
Fastest way to scan single adc channel
Posted on May 12, 2015 at 07:39
I am using STM32F205RBT6. System Freq = 120Mhz. APB2 freq = 60Mhz. ADCCLK = 30Mhz.
1. I have a input pulse of 300Khz.2. Need to scan single an adc channel on each rising edge of pulse.3. Have to store 21600 samples of 12 bit adc data i.e 43200 bytes of data.4. Current requirement is 300Khz. But I think max freq may go upto 360Khz. But this is not current requirement.What would be fastest way to store data in SRAM. Currently i am doing like this:void main(){ configure_all_peripherals(); confiure_adc_channel_3(); /* Tconv = 15 cycles = 0.5us */ configure_edge_int(); while(1) { data_cnt = 0; while(data_cnt < 21600); stop(); process_data(); } }void EXTI1_IRQHandler(){ clear_isr_flag(); ADC1->CR2 |= ADC_CR2_SWSTART; while( !(ADC1->SR & ADC_FLAG_EOC) ); adc_data[data_cnt++] = (u16_t)(ADC1->DR & 0x00000FFFU);}