Continue to Site

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.

  • 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.

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Status
Not open for further replies.
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:banghead:]
EDIT:The DATA sheet suggests use 'burst READ' How do I burst READ?
C.
 
Last edited:
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

C.
 
Last edited:
hi C,
According to the d/s, the Tempr registers are formatted in the same way as the Pressure regs' ie: 20Bit Binary [ which is left Shifted by 4]

You have to do Maths on the Binary value to get the Tempr in Cdeg.
E
A001.gif
 
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 C,
Could you post a working section of your problem code, It may help me understand the problem.
E.
 
Hi E,
Sorry just saw your first message.
I'm not using the SIM.
C.
 

Attachments

  • 18LF4520 8MHz X4 5110 GPS BMP280 170118 0900 PCB REG TEST.bas
    9.6 KB · Views: 196
Hi E,
Adding any new DIMs in the DIM section gives a different PRESS result on the 5110.
How do you check the memory etc usage?
C.
 
Hi,
I've converted to only read the TEMPERATURE, so that it is easier to test, as I can change the TEMP easier that ALT.

Here's the program:
C.
 

Attachments

  • 18LF4520 170118 1000 PCB TEMPERATURE only TEST.bas
    10.4 KB · Views: 177
Hi E,
I think I've found it. Some of the SPIs were commented out, sorry.
C.

hi C,
I am glad you posted that, as I could not see a problem other that you have Remmed lots out.o_O

I have downloaded your #351 basic
E
 
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.
 
Last edited:
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.
 

Attachments

  • 18LF4520 170118 1300 PCB TEMP PRESS TEST 1.bas
    10.6 KB · Views: 169
  • 18LF4520 170118 1330 PCB TEMP PRESS TEST 2.bas
    10.5 KB · Views: 173
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 E,
Yes, #2 has is where the 5110 shows:
TMP= 550733 (Changing,but not related to temperature)
ALT= 430087 (Not changing)

With #1 the 5110 shows 510XXX to 540XXX changes with temperature.

The SPICSOFF SPICSON didn't change anything:(
C.
 
Hi,
This looks promising! :
NOTE, TEMP PRESS config changes '####################
C.
 

Attachments

  • 18LF4520 180118 1000 PCB TEMP PRESS WORKING.bas
    11.6 KB · Views: 168
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
 

Attachments

  • 18LF4520 180118 1100 PCB TEMP PRESS.bas
    10.3 KB · Views: 163
Last edited:
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
 
hi C,
Comparing with what you have to do using Oshonsoft Basic to get accurate values for T and P, with a BMP280.cpp file, IMO it will take ages.

Added this CR LF's to this *.cpp, to *.txt so that you can view with a regular Editor.
E
 

Attachments

  • BMP280.txt
    10.9 KB · Views: 164
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top