From: Tristan W. <ho...@tj...> - 2021-06-04 09:40:00
|
Hi Michael, Glad it is working. I use amforth-shell.py which is in the tools directory. It needs python3 and pySerial to be installed to work. A basic command line looks like this amforth-shell.py --port DEVICE --speed 38400 FILE_TO_UPLOAD but there are many other options and commands (such as the directive #include). The documentation is in the python3 source. Best wishes, Tristan On 03Jun21 21:43, Michael Picco wrote: > Hi Tristan, > > I've got it up and running; even adding 'marker'. > You have probably mentioned it before, but what is the best interface to use > that will allow me to upload source files? > > Thank you for your patience! > > Kind regards, > > Michael > > On 6/2/2021 8:36 AM, Tristan Williams wrote: > > Hi Michael, > > > > I used > > > > FUSE : -U lfuse:w:0xff:m -U hfuse:w:0x99:m -U efuse:w:0xff:m > > > > Best wishes, > > Tristan > > > > On 02Jun21 07:14, Placerville.me wrote: > > > Hello Tristan, > > > Thank you for this! I will give it a try later today. What fuse settings did you use? > > > > > > Kind regards, > > > > > > Michael > > > > > > Sent from my iPhone > > > > > > > On Jun 2, 2021, at 01:18, Tristan Williams <ho...@tj...> wrote: > > > > > > > > Hi Michael, > > > > > > > > I hope you got AmForth to build successfully under windows for the > > > > atmega2560, but if not, I have built it for my Arduino MEGA using the > > > > most recent source (r2457). > > > > > > > > https://sourceforge.net/p/amforth/code/HEAD/tree/trunk/ > > > > > > > > I have uploaded the resulting hex files to > > > > > > > > https://tjnw.co.uk/amforth-bin/ > > > > > > > > I also loaded marker.frt onto the Arduino MEGA and checked that it > > > > does what it should do (see [1]). > > > > > > > > Best wishes, > > > > Tristan > > > > > > > > [1] http://amforth.sourceforge.net/TG/recipes/Forget.html > > > > > > > > > On 24May21 17:57, Michael Picco wrote: > > > > > Hello Martin, > > > > > Thank you for responding! > > > > > In my work directory, which is aptly named 'amforth-6.9', I don't see a copy > > > > > of the template.asm file with "amforth-low.asm" mentioned. The > > > > > amforth-low.asm file is referenced in the avr8 subdirectory. Is there > > > > > something I am missing? > > > > > > > > > > Kind regards, > > > > > Michael > > > > > > > > > > > > > > > > > > > > > > > > > > On 5/24/2021 10:19 AM, Martin Nicholas via Amforth-devel wrote: > > > > > > The crucial file to include for an ATmega is the confusingly named: > > > > > > "amforth-low.asm" which needs to be un-commented in template.asm. > > > > > > > > > > > > All the code is then in low flash memory apart from the flash burning > > > > > > routine which should be found at NRWW_START_ADDR (0x01f000). > > > > > > > > > > > > Often, with a new device, you need to burn the fuses "make write-fuse", > > > > > > before flashing (and burning fuses for a second time) with "make > > > > > > install". > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > > Amforth-devel mailing list for http://amforth.sf.net/ > > > > > Amf...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > > > > > > _______________________________________________ > > > > Amforth-devel mailing list for http://amforth.sf.net/ > > > > Amf...@li... > > > > https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > > > > > > > _______________________________________________ > > > Amforth-devel mailing list for http://amforth.sf.net/ > > > Amf...@li... > > > https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > > _______________________________________________ > > Amforth-devel mailing list for http://amforth.sf.net/ > > Amf...@li... > > https://lists.sourceforge.net/lists/listinfo/amforth-devel > > > |
From: Erich W. <ew....@na...> - 2021-06-17 09:39:00
|
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 -- May the Forth be with you ... |
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 > |