I have established SPI communication with the device with a micro. I am reading what looks like good temperature data but the pressure data doesn’t look right. The readings move around a LOT and look bogus to me. Pressure certainly would not be useful as it now stands.
ringram2077:
I have established SPI communication with the device with a micro. I am reading what looks like good temperature data but the pressure data doesn’t look right. The readings move around a LOT and look bogus to me. Pressure certainly would not be useful as it now stands.
Are you basing your code off the sample code sparkfun listed on the product page? That code is buggy – they read the temperature correctly from register 0x21, but they’ve got the pressure part wrong. The pressure is in registers 0x1F and 0x20, but they’re reading it from 0x1F:0x21 (combining the MSB of the pressure with the temperature reading). I think that can make it look like the reading is jumping around.
When reading it correctly, the pressure will still vary slightly, but consecutive readings would usually be within a foot or three of each other.
I have the same problem with my SCP1000 sensor. Temp is arount 50 when it should be 20C, N pressure is not changing at any height.I am using PIC16F88 processor which is the same they r using, but no luck so far, any help if u got right readings?
Rashi:
I have the same problem with my SCP1000 sensor. Temp is arount 50 when it should be 20C, N pressure is not changing at any height.I am using PIC16F88 processor which is the same they r using, but no luck so far, any help if u got right readings?
I used the 18F PICs so my code is a little different, but I got good results with the same basic sequence of reads/writes as the example code uses.
Try running the self-test to make sure the sensor thinks it’s ok (poll the LSB of the OPSTATUS register to tell when the test is done, it doesn’t hold DRDY low).
Also, check STATUS after you read the temp & pressure to make sure none of the error bits are set.
Hi,emf: I tried it but I’m still getting 42.4C n Pressure which is not changing. Temp starts with 32C n starts to increase quickly. Pressure reading also change with changing Temperature. In few seconds Temp becomes 50C but pressure doesn’t change with height. Is it possible for u to send .hex file of ur PIC? I’ll program one 18Fxx n compare signals with my 16F88.
Rashi:
Is it possible for u to send .hex file of ur PIC? I’ll program one 18Fxx n compare signals with my 16F88.
Sure. PM me your email address and I’ll send it to you. I’ve been using an 18LF4550, but you can recompile it to run on just about any of the 18Fs with a few changes.
they read the temperature correctly from register 0x21, but they’ve got the pressure part wrong. The pressure is in registers 0x1F and 0x20, but they’re reading it from 0x1F:0x21 (combining the MSB of the pressure with the temperature reading). I think that can make it look like the reading is jumping around.
As emf said earlier the example code is wrong… the correct second register in the pressure sequence is 0x20, not 0x21 (temp register).
Also, I think you can totally ignore the code segment
write_register(0x02, 0x2D);
write_register(0x01, 0x03);
write_register(0x03, 0x02);
It appears to issue an indirect write to address 0x2D which is not even implemented? (User accessible EEPROM seems to stop at 0x2C).
I left it out of my code, made the correction to 0x20 for the lower 16 of pressure and it’s all good.
Cannibal:
Also, I think you can totally ignore the code segment
write_register(0x02, 0x2D);
write_register(0x01, 0x03);
write_register(0x03, 0x02);
That probably depends on the version of the sensor you have. It’s listed in the initialization flow chart as phase 3 of startup in the 0.06 version of the manual – it’s supposed to do “low noise configuration”, although the manual doesn’t elaborate on what that is or why you’d want a high noise configuration instead. In the 0.07 revision, it seems to be gone. I’m not really sure if it does anything in the old versions either, but it doesn’t seem to do any harm.