|
From: | Chris |
Subject: | Re: [Paparazzi-devel] Battery Measurement Problem |
Date: | Tue, 28 Jan 2014 14:26:27 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
If you have a stm32 board i think there is some errors in the
adc_arch.c file nb_adc1_channels = NB_ADC1_CHANNELS; #if USE_AD1 #ifdef AD1_1_CHANNEL adc_channel_map[AD1_1] = AD1_1_CHANNEL; #endif #ifdef AD1_2_CHANNEL adc_channel_map[AD1_2] = AD1_2_CHANNEL; #endif #ifdef AD1_3_CHANNEL adc_channel_map[AD1_3] = AD1_3_CHANNEL; #endif #ifdef AD1_4_CHANNEL adc_channel_map[AD1_4] = AD1_4_CHANNEL; #endif // initialize buffer pointers with 0 (not set). Buffer null pointers will be ignored in interrupt // handler, which is important as there are no buffers registered at the time the ADC trigger // interrupt is enabled. for (x = 0; x < 4; x++) { adc1_buffers[x] = NULL; } adc_init_single(ADC1, nb_adc1_channels, adc_channel_map); #endif // USE_AD1 Here is what i think but i may be wrong as my daughter want me to play with her now and i can't think straight :-) This will load the adc_channel_map the wrong way. Suppose we use 2 channels then the first channel (AD1_1) should be loaded in "adc_channel_map[2]" and the second channel (AD1_2) in adc_channel_map[3] but here adc_channel_map[0]=AD1_1 and adc_channel_map[1]= AD1_2. With this order those channels will not get converted because only adc_channel_map[2] and adc_channel_map[3] will be converted which contain the wrong adc input number. Chris On 01/28/2014 01:39 PM, Kadir ÇİMENCİ
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |