SCP1000 barometric pressure & temperature sensor (SPI)

Here you can share completed projects or parts of projects that may be useful to others. You may post files relevant to ZBasic - source code, schematics, etc.
Post Reply
kranenborg
Posts: 57
Joined: 27 July 2009, 14:20 PM
Location: Groningen, The Netherlands
Contact:

SCP1000 barometric pressure & temperature sensor (SPI)

Post by kranenborg »

Dear forum members,

Here follows a functioning test program for the popular SCP1000 barometric pressure and temperature sensor. Most available breakout boards (like for example SparkFun's or Parallax board) implement only the SPI version (which is harder to code than the I2C variant), therefore the need for this test program.

The program is an adaptation of Don Kinzer's base code (in the discussion thread below) with the following items:
- OpenSPI flags register setting corrected (Clock-phase false, max 500 KHz bus)
- Implementation of SCP1000 initialization procedure, high-res, continuous measurement mode chosen
- Correction of Read_Direct_Access function for cnt=1 case (pressure msbyte reading: high - low byte positioning)
The corrections are documented in the code.

The program performed OK on a simple setup with a ZX-328L and an SCP1000 SPI breakout board (SparkFun). It prints out the barometric pressure (in Pa) and the temperature (in C) after each new measurement has become available (indicated by DRDY pin High).

See the discussion at http://www.zbasic.net/forum/about584.html

Best regards,
Jurjen
Attachments
SCP1000.zip
(1.46 KiB) Downloaded 2159 times
Post Reply