paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] BMP085 sensor


From: Gautier Hattenberger
Subject: Re: [Paparazzi-devel] BMP085 sensor
Date: Wed, 03 Aug 2011 12:30:58 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10

Hi,

i7 is a prescaler mechanism that calls a function (here baro_bmp_periodic) with the correct frequency (specified in the xml file) based on the main loop frequency (60Hz for fixed wing, 512Hz for rotorcraft). You can specify any frequency lower or equal to the main loop, but if it's not a divider of it, the module's periodic function will not be called with the exact frequency.
The event functions are polled continuously when the periodic functions are not called (here, probably much more than 8 times as often as the baro_bmp_periodic...).

Gautier

On 03/08/2011 10:37, Helge Walle wrote:

Hi,

I have studied baro_bmp.c trying to find the reason why readings from the BMP085 sensor seems to wander in steps of up to +/- 0.5 hPa around “center”. This amounts to approx +/- 4m at sea level. No luck so far, however.

The program selects a high resolution setting of the sensor. As far as the BMP085 datasheet goes I would expect values in the SENSOR_SYNC_SEND message to have a higher resolution. I want to look more at this, but a few questions arise.

In .../var/<my_aircraft>/generated/modules.h there is this code:

…..
static inline void modules_init(void) {
   baro_bmp_init();
}
static inline void modules_periodic_task(void) {
   static uint8_t i7; i7++; if (i7>=7) i7=0;
   if (i7 == 0) {
      baro_bmp_periodic();
   }
}
static inline void modules_event_task(void) {
   baro_bmp_event();
}
…..

I suppose this code is based on .../conf/modules/baro_bmp.xml. But what is the effect of i7 and how/where is it generated?
It looks to me as if baro_bmp_event() is run 8 times as often as baro_bmp_periodic(). Is this correct?

Could someone please explain a little about this?

Thanks for any help,

Helge.




_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]