Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
Hi,
I've got moving numbers at last. for some starnge reason, I have the TEMP switched OFF and this is what I was reading. [Don't ask] EDIT:The DATA sheet suggests use 'burst READ' How do I burst READ?
C.
hi C,
A burst read is one where all the 3 registers are read one after the other, I am not sure if Oshonsoft can do this.??
I would try, see what you read, Oshonsoft may auto inc the Address counter.???
'use your CS line
SPICSOn
SPISend 0xf7
SPIReceive data1
SPIReceive data2
SPIReceive data3
SPICSOff
Hi E,
I don't think Oshonsoft can do 'burst read'
I used CS lines before and after. the whole block.
I'm adding TEMP to the PRESS settings, but adding these commented out lines into the program, changes the result. There are no other references to 'say' t_xlsb anywhere alse.
'Dim t_xlsb As Byte 'BMP280 least sig byte TEMP
'Dim t_lsb As Byte 'BMP280 mid sig byte TEMP
'Dim t_msb As Byte 'BMP280 most sig byte TEMP
Dim t_lsbnxlsb As Word 'BMP280 least and mid sig bytes TEMP
Dim t_msbnlsbnxlsb As Long 'BMP280 least and mid and most sig bytes TEMP
Hi E,
Thanks for the equasion, I understand that for meaningful results in the real world, equasions need to be added in, but all I'm trying to do is 'see' the readings from the TEMP and PRESS addresses first.
Adding any DIM just before the 'Dim p_xlsb As Byte ' line changes the result of the Pressure reading. I tried 'DIM banana as byte' and this changes the result. Instead of 794624 I get 39983. (These change a little of course)
C.
Hi,
The reason for remming out those lines, was the odd readings I'm getting.
I've tried lots of tests using the BMP280 in circuit. With the TEMP not running, and only checking the p_xlsb I got a changing number, that changed with TEMP (fingers on the module).
I also tried changing round the order in the SPI section, so MSB, then LSB then xlsb, and got a different number, I pressume it's a timing thing. (I've seen filters and corrective things in the D/S) EDIT: Using the TEM program, I am now getting a range of 510XXX to 540XXX, so it appears it is working. I'll now add the PRESS back in.
Hi,
Sorry to bombard you with programs, but here's two.
Marked with
1/ shows TEMP on 5110 which changes with change of temperature.
2/ Shows both TEMP and ALT, but one is fixed and the other doesn't relate to anything.
C.
hi C,
I am assuming that #2 is one that's fixed.?? If so it maybe due to needing a SPICSOff/On, try and let me know.
E
SPICSOn
SPISend r_t_xlsb 'READ ADDR TEMP xlsb from BMP280
SPIReceive t_xlsb 'Least sig Byte
SPISend r_t_lsb 'READ ADDR TEMP lsb from BMP280 MID
SPIReceive t_lsb 'mid sig Byte
SPISend r_t_msb 'READ ADDR TEMP msb from BMP280 MOST
SPIReceive t_msb 'Most sig BYTE SPICSOff
SPICSOn
SPISend r_p_xlsb 'READ ADDR PRESSURE xlsb from BMP280
SPIReceive p_xlsb 'Least sig Byte
SPISend r_p_lsb 'READ ADDR PRESSURE lsb from BMP280 MID
SPIReceive p_lsb 'mid sig Byte
SPISend r_p_msb 'READ ADDR PRESSURE msb from BMP280 MOST
SPIReceive p_msb 'Most sig BYTE
SPICSOff
Hi,
Here's the same program tidied up a bit.
The TEMP is working, but the PRESS isn't. (I tried it in a food container, and pressed on it) The reading for TEMP is always around 442XXX to 444XXX
Here, I have the TEMP turned off, while I test PRESS. EDIT: For TEMP reading this should be 503XXX to 520XXX indoors.
For ALT reading this should be 442XXX to 444XXX all approx.
C
hi C,
Which is correct.?
get_alt:
'Gosub get_neo 'Reads NMEA DATA<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
PORTD.4 = 1 'CHIP SELECT 5110 OFF
WaitMs 10 'Does CS need time to switch? [SHORTEN OR REMOVE THIS LINE]
PORTD.5 = 0 'CHIP SELECT PRESS ON
SPICSOn SPISend 0x74 'WRITE 0xF4 Control reg addr
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.