Released BMP180 module Raspberry test code

Released BMP180 module Raspberry test code

formatting link
for this module:
formatting link

test run:

Seems to match my other instruments. ut = uncompensated temperature, and up uncompensated pressure.

The module is connected to the Raspi GPIO port,

3 pins are used, connections are shown in the source code. So after fixing a typo, and I had the calibration registers the wrong way around, this works. Tried both fixed and floating point math, same results. Oversampling 0 works too, that is really just a 16 bit ADC read. Code released under the GPL.
Reply to
Jan Panteltje
Loading thread data ...

So, C compiler, but that one needs MS windows, so I'd rather walk on my hands (see summary).

formatting link
wrote the code in PIC18F (or what passes for that) asm.

It outputs data from 4 BMP180 sensors, front right rear and left, compensated data that is:

Here only the left sensor output is shown (only one connected, but I can swap sensors, made sockets).

Normally nmea mode is selected and the output looks like this (4800 Bd serial):

$PPP,2,A0FCBE04,000000EC,000000EC,00018C61,X*14

If you are good in hex you will notice that the last field says 101473 Pa, or 1014.73 mBar or 1014.73 hPa or whatever. The PIC with 4 sensors will go in the mast, but of course I have to wire things up and test if it actually works to measure wind speed differential this way. The 'X' indicates an error (you can activate test mode in the menu via RS32 and it will tell you all about it) in this case the error is that the first 3 sensors are not connected, normally 'X' is 'A" of 'valid data'.

The assembler gpasm turned out to be OK, I made 2 errors in the iic code that caused wild strange things to happen. Funny, one of those code errors has been in there for years, but somehow never showed up. Now let's see what's flying around? ;-)

mm 6700 lines of asm code not bad, but lost of empty lines of course. The math is interesting, (fun starts at line 5410) I only have signed 32 bit, and sure ran out of bits. Cheated (see code) and get same results as C.

Reply to
Jan Panteltje

It is light very long today, longest day in the year, so I connected the second sensor.

Pressure tracking seems good, temperature is off by at least a degree, some sensors more:

Output wind_bmp180.asm in test mode (see menu):

sensor 0 wrong chip ID 0

Reply to
Jan Panteltje

Da Pante:

hahaha, was already in code at some other place, but no sda pullup is equivalent to ack ... so flag not set. Added setting error flag to the chip ID compare, that should work, but it's late, testing some other time.

Reply to
Jan Panteltje

Da pante:

Could not resist sensor 0 wrong chip ID 0 sensor 2 wrong chip ID 0

$PPP,2,000000EC,00018BBB,000000EC,00018BE1,X*5A < fixed

Temperature tracing is getting better, .1 degee C, maybe it is just a thermal gradient from handling, seems to take minutes before it cools of after even touching it.

Is Programming Addictive?

could be

Reply to
Jan Panteltje

Da Pante:

A Part from that, I sink normal humming beans do not ever check for a sjip idea

Reply to
Jan Panteltje

Me:

Added some stuff, most important added moving average over 10 measurements wind_bmp180-0.3.asm

It is pretty straight forward code (moving average at the end of the source). Limited in number of data values (4 bytes per value and 4 sensors and 10 data points per sensor) by RAM. But still a RAM section free. Just thought of some more improvements.

So if you like PIC 18F asm... This Panteltje's Proprietary Protocol Version 3, main difference it sends all temperature values too. Raspi can read them all ;-)

Reply to
Jan Panteltje

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.