From: Michael P. <mp...@pl...> - 2021-06-18 22:53:26
|
Hello Erich, I've dusted off an MSP430 board I have here and might have to load it with noforth just to get an idea of what his code is doing with the BME280. He uses some sort of defining word called 'value', that I need to look up with the MSP430. There are a lot of others that will jump out as I pour over this listing, I'm sure. Getting ready for our Field Day weekend, which starts tomorrow at 11:00 local time and runs through Sunday 11:00. This will be the last year we work under COVID rules, meaning I work from home and log via the internet. We normally head out for a camping weekend on some Forest Service land that we obtain a permit to use. It's located at around 6500 feet and gives us nice coverage. Have you tried experimenting with the MSP430? As I remember, I picked up a few of these boards back when they first were introduced. I bought a few of them (called Launchpads) and played with one for a while, but wanted to more than it was capable of at the time. So many parts ... so little time ... !! :) Kind regards, Michael k6MLE On 6/17/2021 2:38 AM, Erich Wälde wrote: > Hello Michael, > > Michael Picco <mp...@pl...> writes: > >> Hello! >> >> I finally have figured out how to efficiently interact with Amforth on my >> mega2560 and have installed much of the I2C stuff on it. > Good! > >> Question: >> >> Has anyone worked out how to talk to the BME280 sensor using Amforth? Wading >> through the spec sheet tells me it's going to be a challenge. It would be >> nice not to reinvent the 'wheel', if someone has already done the >> heavy-lifting! > I have, much to my dismay, spent more than 20 hours on this. Not > once in my life have I seen such an awkward interface. > Unbelievable. > > The C code on > https://github.com/BoschSensortec/BME280_driver/blob/master/bme280.c > is working. It is just not meaningfully documented. Code using > this can be found here > https://github.com/adafruit/Adafruit_BME280_Library > > You have to very carefully study the datasheet and obey the > "signed" vs. "unsigned" song and dance. I have written C code to > see, whether my intermediate calculations were correct. I have > managed to calculate temperature and humidity. The humidity > values were significantly too low (I do have more sensors). And > on pressure values I gave up after wading through about halfway. > > That being said: I was pointed to a working implementation for > noForth on MSP430, published in "Vierte Dimension" 2020-01 > https://forth-ev.de/wiki/vd-archiv > > > As I said, working the sensor with C is ok, since the adafruit > library is written and working. Working the sensor in Forth is > kind of horrible, because you need to reverse engineer the > calculation. WHY not spending the silicon to do the calculation > "on board" and produce linear, compensated readings is beyond my > imagination. > > I pulled the one BME280 sensor out, I will happily give it away. > And I ordered a handful of expensive Sensirion SHT85 sensors for > temperature, humidity and a mpx6115 sensor for pressure (needs > an ADC). The sensirion sensors worked for me after a couple > hours. I did not figure out, how to check the crc that comes > with the data --- but that is left for another time. > > I can send my code re. BME289 your way, if you are interested. > But do not spend countless hours on a misdesigned interface ... > > > Cheers, > Erich > |