|
From: | Michal Podhradsky |
Subject: | Re: [Paparazzi-devel] Battery Measurement Problem |
Date: | Tue, 28 Jan 2014 10:15:00 -0800 |
Forget about my answer i was wrong the order has changed to a more logical one so the code is looking fine.
Chris
On 01/28/2014 04:14 PM, Kadir ÇİMENCİ wrote:
KadirThanks again..Hi Chris,Thanks for the answers, as i see from the source code i m only using the ADC14/PC4 on STM32F105 for battery measurement. After your answer i tried to bind this channel as hard coded, at the end of the map like, but no change still reading wrong ADC values from MCU. I guess i am missing something about this ADC mapping..
#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[3] = AD1_4_CHANNEL; // --> change in here
#endif
2014-01-28 Chris <address@hidden>
I haven't checked (but if this is the case then i stand corrected, you are right.
Chris
On 01/28/2014 02:31 PM, Gautier Hattenberger wrote:
Hi Chris,
Do you have any issue while reading the ADC channels ? Because with the update version of libopencm3 the initialization order have been changed: https://github.com/libopencm3/libopencm3/commit/6570f6e
Gautier
Le 28/01/2014 13:26, Chris a écrit :
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:
Frame : QuadrotorVersion : masterBoard : Lisa mv2.0ThanksAnyone who have encountered with this problem?which also the default value for Lisa m v2.0Hello everyoneToday i have noticed that there is a problem with battery indicator at the GCS. I have fed a regulated 5v to the V_batt pin and i see the indicator shows 9.4 V. It is working regularly at the v5.0.3 release, but when i try to use master there is a problem with battery state like this. I don't change the voltage divider resistors (10k and 2.2k) and i have also tried to define the line
<define name="VoltageOfAdc(adc)" value ="(0.0045 * adc)"/>
Kadir
_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel
[Prev in Thread] | Current Thread | [Next in Thread] |