Tuesday, January 22, 2019

Basic and Fortran programs to read temperature and pressure from the BMP driver on the PiDP-11/70

    In my last entry, I wrote about a program to read the BMP180 temperature and pressure sensor connected to a PiDP-11/70, and running the BM device driver.

  That example was written in Macro-11. I understand that not every RSX enthusiast is proficient in that language, so I coded  examples in BASIC-Plus 2 and Fortran 77.

  They do the usual - assign a LUN, and do a QIOW (via WTQIO). The results are formatted and printed out - what could be easier? The conversion of the data was a lot easier in BP2 and F77  than it was in Macro, that's for certain. It did actually take me a few hours to write this - I've written thousands of lines of BP2, but that was circa 1982 - the language has changed quite a bit in the ensuing decades. And, I thought I had written my last FORMAT statement decades ago, but, here one is in the F77 example.


  Here they are....

getoneb.b2s

getonef.ftn

  To use them, compile and link like any other BP2 or F77 program. They will return the temperature and pressure in Celsius, Fahrenheit, Bars and Inches of mercury.

>run getoneb
Temp C 22.60, Temp F 72.68, Press B 1.0171,Press Hg 30.03

>run getonef
Temp C 22.60 Temp F 72.68 Press B 1.0171 Press Hg 30.03

2 comments:

  1. Lee,
    Thanks for your recent work on the RSX11M+ BMP180 driver. I hope to have that working shortly on my PiDP-11/70. I'd like to have a Simh with both BMP180 and RSX TCP/IP and at the present it seems I can only get one or the other.

    What I really wanted to say was that thanks to the simple, elegant BMDRV.MAC example, I was able to modify it to work on my ADV11 and bring in A/D readings via a QIO. I used part of the ADDRV.MAC from RSX11M and stuck it in the template you created. The ADDRV.MAC takes advantage of the quick conversions (<30uSec) to avoid the complication of using interrupts.

    Also, the link to your Fortran getonef.ftn above seems to be broke. I look forward to seeing more on your RSX software projects in the future.

    Thanks again and Best Regards,
    Mark

    ReplyDelete
  2. Heck, two typos in just a few days - thanks for pointing this one and the previous one out. I'll have to go over future posts more carefully.

    Glad the BM: driver was useful as a template. I pared out as much as I could to keep it simple enough for a blog posting.

    Also, thanks for your work preparing an RSX11 support distro for PiDP11 - lots of good stuff on the two disk images you produced - good to have all of that in one (well two) places. I probably never would have gotten around to getting all of those layered products installed on my PiDP11 system.

    ReplyDelete

Comments?