1. 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.
    Dismiss Notice

PIC plus-5110 LCD-GPS-BMP280-HMC5983

Discussion in 'Oshonsoft' started by camerart, Mar 12, 2017.

  1. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
  2. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    I didn't change anything, apart from removing the LED toggles that I always use to indicated a LOOP is running.
    With it removed, the digits flash ON/OFF very fast so are blurred.

    I'm not sure how the SPICS and the 5110 CS ON/OFF affects the 5110. Is there a way to clear the 5110 before re-writing screen changes?
    EDITED.
    C
     
    Last edited: Feb 7, 2018
  3. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    This line give an 'unused compiler warning': Dim row As Byte 'lcd row pointer
    Is it necessary?
    C
     
    Last edited: Feb 7, 2018
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  5. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    I cleared the screen artifact using this, perhaps not elegant, way.

    print:
    msg1 = "TEMP= " + strtp
    Call wr_msg(0, 0, msg1)
    msg1 = "PRES=" + strpr
    Call wr_msg(0, 1, msg1)
    msg1 = " "
    Call wr_msg(0, 2, msg1)
    msg1 = " "
    Call wr_msg(0, 3, msg1)
    msg1 = " "
    Call wr_msg(0, 4, msg1)
    msg1 = " "
    Call wr_msg(0, 5, msg1)
    strtp = ""
    strpr = ""
    Return

    EDIT: There are 14 spaces between the ,msg1= "14" in 2,3,4,5. Not seen because of page formatting (whatever that is?)

    C.
     
    Last edited: Feb 7, 2018
  6. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    I can't see the 'ram usage' choice in 'options' see: image #510
    C.
     
  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    I changed it to '000' = 0.5 ms
    Thanks.
    C.
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10
  9. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    Image #510 is from PIC18 Ide
    From Ide open Basic Compiler and there options menu-> Ram usage
     
  10. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    Found it thanks.
    Compile program first.
    C
     

    Attached Files:

  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Here's the latest 184520-5110-BMP280 program tidied up a little:
    The 18lf4520-5110-GPS program is at #532
    Any changes to the 18LF4520-5110-BMP280 program, I'll correct here.
    Thanks.
    C
     

    Attached Files:

    Last edited: Feb 8, 2018
  12. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    The transmitter (which I'll be holding) will be sending the LOCation including ALT, which will add/subtract any changes in PRESS on the ground, before sending.
    C.
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,354
    Likes:
    650
    Location:
    Ex Yorks' Hants UK
    ONLINE
    hi C.
    Perhaps I am missing a point.
    If the Base station that you are holding has say a GPS NEO module, that will have the Base Altitude value.??
    Also why are you sending the Base Alt to a Remote point/station.?

    E
     
  14. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    Would you mind asking the question again here please?: https://www.electro-tech-online.com/threads/radio-control-by-location.152926/
    so that anyone looking at the project will see what I'm trying to do.

    On this thread I'm now trying to combine the last BMP280 program with the earlier GPS part. Can you recall an earlier program where the GPS shows on the 5110? I've tried the one at #301, but while the 'hardware UART' shows the inputted NMEA sentence it doesn't show on the 5110.
    I'll carry on looking and let you know if I find a suitable one.

    EDIT: Found one here:
    C
     

    Attached Files:

    Last edited: Feb 8, 2018
  15. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi,
    Here's the combined program so far:
    The GPS is working ok and showing on the 5110.
    The BMP280 shows on the 5110, but the READing is incorrect, and not updating, I recognise those READings from previous tests. I'll have another try tomorrow.
    If anyone can spot any obvious errors, please let me know.

    EDIT: Programs 050118 1400 and 080218 0900 are the two WORKING programs I'm trying to combine. (Including the two INCLUDES fontsml and get_neo.)
    C
     

    Attached Files:

    Last edited: Feb 9, 2018
  16. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    You have changed the data to control and config registers from working version.
    Try with old values.
    Also the reset address is wrong.
     
    Last edited: Feb 8, 2018
  17. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    Could you make some editing to make the program easier to read.
    Add empty lines between blocks of code and between procedures.

    I am not sure, but it seems that the program goes once through the bmp280 calculation and is then looping in the get_neo
     
  18. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    I can't see the errors, can you let me know which lines are incorrect please?

    From PRESS-TEMP 080218 0900 Program
    SPICSOn
    PORTD.5 = 0 'CHIP SELECT BMP280 ON
    SPISend 0x60 'WRITE 0xe0 RESET ADDR [Is this needed?]
    SPISend 0xb6 '%10110110 RESET TO 0x00
    PORTD.5 = 1 'CHIP SELECT BMP280 OFF
    PORTD.5 = 0 'CHIP SELECT BMP280 ON
    SPISend 0x74 'WRITE 0xF4 Control CTRL_MEAS reg addr
    SPISend 0xff '%11111111 T/ON P/ON 't_x2 px16 Normal Mode
    PORTD.5 = 1 'CHIP SELECT BMP280 OFF
    PORTD.5 = 0 'CHIP SELECT BMP280 ON
    SPISend 0x75 'WRITE 0xF5 Control CONFIG reg addr
    SPISend 0x1c '%00011100 osrs_t 0.5ms Table 11-11R filter x16 table 6
    PORTD.5 = 1 'CHIP SELECT BMP280 OFF
    SPICSOff

    From COMBINED 080218 1600 Program
    SPICSOn
    PORTD.5 = 0 'CHIP SELECT BMP280 ON
    SPISend 0x60 'WRITE 0xe0 RESET ADDR [Is this needed?]
    SPISend 0xb6 '%10110110 RESET TO 0x00
    PORTD.5 = 1 'CHIP SELECT BMP280 OFF
    PORTD.5 = 0 'CHIP SELECT BMP280 ON
    SPISend 0x74 'WRITE 0xF4 Control CTRL_MEAS reg addr
    SPISend 0xff '%11111111 T/ON P/ON 't_x2 px16 Normal Mode
    PORTD.5 = 1 'CHIP SELECT BMP280 OFF
    PORTD.5 = 0 'CHIP SELECT BMP280 ON
    SPISend 0x75 'WRITE 0xF5 Control CONFIG reg addr
    SPISend 0x1c '%00011100 osrs_t 0.5ms Table 11-11R filter x16 table 6
    PORTD.5 = 1 'CHIP SELECT BMP280 OFF
    SPICSOff

    Here's what I'm following regarding RESET, can you point out what's wrong please?

    I'll update a more open program in #533
    C
     

    Attached Files:

  19. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    Spisend 0x60 should be Spisend 0xE0

    You changed the values of control register and config register.
    I don't know if they are wrong now.

    Seems that there is no return from get_neo ?
     
  20. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    This was control register in the last .version

    ' BMP280
    SPISend 0x74 'WRITE to 0xF4 Control CTRL_MEAS reg addr
    SPISend 0x5f '%01011111 T/ON P/ON 't_x2 px16 Normal Mode

    The reset was there also wrong.
    Maybe it is not needed.
     
  21. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,821
    Likes:
    11
    Location:
    Dorset UK.
    Hi J,
    I've changed the 0x5f settings.

    I use the Reset with MSB switched to '0' for WRITE, so E0 = 60 Is this incorrect?

    I've posted the two programs 050118 1400 and 080218 0900, that I'm combining in #533 they both work individually ok.

    EDIT: I've changed the get_neo! I think what happens is, in the MAIN LOOP there is a 'get_neo' LOOP which has a 'get_val' GOSUB which RETURNS to inside the 'get_neo' LOOP. I've removed the 'GUSUB
    Having said that it's the BMP280 that is not updating on the 5110, and the GPS is working ok.

    C.
     
    Last edited: Feb 9, 2018
  22. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    389
    Likes:
    18
    Location:
    Helsinki, Finland
    Is the Yled toggling in the combined program?
     
    Last edited: Feb 9, 2018

Share This Page

  1. 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.
    Dismiss Notice