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 with 5110 48x84 LCD screen

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

  1. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,369
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    The font is nice and clear. I can do any tedious stuff font wise if you want.
    Did you notice the GPS module I ordered has RX TX for normal connections? As mentioned, I'm sure it could be wired differently for SPI.
    C.
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK
    Why would you want to wire it for SPI?, and why would you imagine it has that capability - it's far easier to use simple serial with it.

    Just to 'cast a spanner' in the works, have you considered the small colour display - which claims to be a 5110 'replacement', but that's only in the connections, the software is entirely different. I've got these running nicely from a 24F.

    https://www.banggood.com/1_44-Inch-...dule-Instead-Of-Nokia-5110-LCD-p-1116867.html
     
  3. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,369
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    The font is nice and clear. I can do any tedious stuff font wise if you want.
    Did you notice the GPS module I ordered has RX TX for normal connections? As mentioned, I'm sure it could be wired differently for SPI.
    C.
    Hi N,
    I had to choose a standard for all modules. I have another project that could be attached to this one from another thread which only has SPI, so this is why I chose it. I have been looking onto it, and it appears that SPI is faster than i2c, apart from that, this project has gone too far to start again with a different protocol.

    The module chosen is 5 times cheaper than the one you posted, and it's working fine :)
    C.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK

    Why cripple your projects? - use whatever is best at the time.

    Who mentioned I2C?, I2C can be slower than SPI, but it has many advantages over it as well - and for running a small low resolution mono display either is more than fast enough, in fact I've taken to using the slow software SPI on my 5510's because there's no advantage using the far faster hardware.

    GPS modules are simply serial ports, and you connect it to the PIC serial port (or any I/O if you use software serial) - it's hardly a 'protocol' :D

    The one I posted is in colour though, and has greater resolution - just in case you had greater ambitions.
     
  6. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,220
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi C,
    This is the latest font , as per the last image posted.
    Place the this font1.bas [ which has the normal and big fonts] in the same folder as this Cam5110_V4.
    You see the N and E as shown in the last image.
    E
     

    Attached Files:

  7. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,369
    Likes:
    11
    Location:
    Dorset UK.
    Hi N,
    I sometimes us the incorrect words i,e, protocol.
    So far all of the modules can be communicated with by SPI. (Barometer, GPS, compass and SX1278 from another project) Some also have serial as well, but at the moment the program Eric is writing is neat and for me not too difficult to read. For some of us not so expert programmers a short tidy program can be followed and even used a learning lesson. I bow to Eric's skills whether he chooses to use different addressing methods.

    I try not to be too ambitious e,g, using better LCDs, but for simple text output the 5110 is looking fine. Of course if anyone writes an Oshonsoft program using better LCDs with graphics, I would be over the moon.
    C.
     
  8. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,369
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    N and E now showing, well squashed.
    E.
     
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,220
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi C,
    You should see 4 unused pixels on the right hand side of the LCD, if needed you could expand the NESW big fonts at the ends of the row.

    My 3 off 5110 LCD's have just arrived, one of the 3 does not work.!
    Also the pin out is different and the lite is a pull up to 3.3v.

    I have noticed before when ordering a small quantity of an item online, from overseas, one or more are faulty.
    I suppose its one way of keeping their prices down.!!!

    E

    Let me know if you have further problems on this project, I will try to help.
     
  10. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,369
    Likes:
    11
    Location:
    Dorset UK.
    Hi E,
    I see the missing pixels. I'm looking forward to playing with the fonts once I get chance.

    I've seen where the rubber screen connections need pressing, try that first. Also they prefer 3.3V. I think they work with 5V, but may 'tire' easily. I've also got some on order, and they have white screens. I bought them on Ebay, with good reviews. In the past I've had new replacements sent, but that's unusual.

    I'm ordering modules and components, and designing a new surface mount circuit, that I will etch, so a little time before I get to play. I'm experimenting with the image transfer process for making PCBs, which is two plates lined with silicon, where the PCB is sandwiched between the plates, then heated for the transfer, then etched.
    Thanks for your efforts, I'm sure it will be popular.
    C.
     
  11. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK
    As I mentioned earlier in this thread, there are at least two different types, with different pic connections, and different LED 'polarity'. The 'pullup to 3.3V' one that you've got is the 'best', as it's pin compatible with the ST7735 colour modules (128x128 and 128x160) and also the IL1934x series of modules.

    As Camerart suggested, make sure the LCD is correctly aligned with the rubber connections, they seem rather flimsy - I soldered the metal mountings on some of mine as they tended to slide off the PCB.
     
  12. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    I found, that Oshonsoft actually can do binary to ascii conversion, so the program can be simplified a little bit.

    An example:

    Dim i As Word
    Dim j As Single
    Dim a As String
    Dim b As String
    Dim e As String
    Define SINGLE_DECIMAL_PLACES = 2

    i = 987
    a = #i
    j = 12345.87
    b = #j
    e = "AD0=" + #i +" mV"
    End

    From Watch variables window in simulator:

    i (0x056) = 987
    j (0x058) = 12345.870
    a (0x06D) = "987"
    b (0x0A0) = "12345.87"
    e (0x05C) = "AD0=987 mV"
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,220
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    Morning Nigel,
    I have no practical application for the 5110 at this time, I was just helping out camerart with his project.
    I agree the 5110 has a very limited specification, I would not use it on any new projects, considering the lowish prices of a colour displays.

    Already ordered some colour displays for testing.
    The colour displays are for interest and mental stimulation only, as they say 'use it or lose it';)

    Eric
     

    Attached Files:

    • A02.gif
      A02.gif
      File size:
      55.9 KB
      Views:
      16
  14. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,220
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi jjw,
    Could use please explain how the program in post #141 can be used in a practical program to carry out Binary to ASCII conversions.

    Eric
     
  15. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    For example in the demo counter:
    _____

    b2aval = tot
    Gosub bin2asc
    msg1 = ""
    msg1 = Chr(ascbfr4) + Chr(ascbfr3) + Chr(ascbfr2) + Chr(ascbfr1) + Chr(ascbfr0)
    Call wr_msg_big(0, 4, msg1)
    -------
    Change to:

    msg1 = #tot
    Call wr_msg_big(0,4,msg1)
     
  16. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,220
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi jjw,
    I see what you are saying regarding a simple unformatted number/value, by using the inbuilt '#' prefix, but the advantage of the bin2asc subr is that enables the programmer to insert decimal points, or any other ASCII characters into the Ascbfr(array] string, prior to outputting the ASCII string.

    E
     
  17. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    Ok.
    Anyway decimal point can be handled easily by using floating point numbers and any string can be added before and after #some number.
    For example:
    msg1= " Voltage= " + #advalue + " V"
     
  18. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,220
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    Problem with that, is the Oshonsoft FP is an optional add on which has to be paid for, many Oshonsoft users still do not have the FP option.

    The bin2asc subr was written about 10 years ago, before Oshonsoft had FP.

    I know that a msg can have ASCII characters added before and after, but without the FP option is it not easy to insert ASCII chars into a string.
     
  19. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,295
    Likes:
    647
    Location:
    Derbyshire, UK
    Just to let you know, I've got the 5110 working again with my 16F1827 - I 'cheated' and used software SPI instead of hardware :D

    To be fair, it doesn't really matter on the 5110, as it's a slow device and doesn't need much data transferring - but I now need to find out what I've done wrong with the hardware settings.

    As I don't use Oshonsoft I've not been looking at the code posted here, but are you using a screen buffer and writing to that, then copying the buffer to the screen?. This is the preferred method, as it allows you to draw lines etc. something difficult otherwise with a read only display.
     
  20. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,220
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi Nigel,
    Not using a screen image/buffer, it is a character by character write to the screen,
    The write procedure gets each character in turn from a string message, writes that to the screen then gets the next character in the string message.
    The procedure uses two leading parameters that prefix the string , Row and Column numbers.

    It sounds slow but writing a full screen of the normal or big characters, appears almost instantaneous. PIC internal clock at 8MHz

    'examples of messages
    msg1 = menu1 'assign menu string to msg1 string
    Call wr_msg(0, 0, msg1) ' row=0 col =0

    'writes the msg To the lcd at xp [column] And yp [row]
    Proc wr_msg(xp As Byte, yp As Byte, msg1 As String)

    lcd_mode = 0 'command
    xp = xp * 6
    xp = 0x80 Or xp
    yp = 0x40 Or yp
    SPICSOn
    SPISend xp
    SPISend yp
    SPICSOff

    lcd_mode = 1 'data
    y = Len(msg1)
    For x = 1 To y
    ascval = MidStr(msg1, x, 1)
    Gosub chr2lcd 'in font1.bas
    Next x

    End Proc

    E
     
  21. jjw

    jjw Member

    Joined:
    Apr 16, 2012
    Messages:
    266
    Likes:
    15
    Location:
    Helsinki, Finland
    Is it slow?
    From its controllers PCD8544 spec:
    Max dataspeed is 4Mbits/s
    Max framerate 67Hz.
     

Share This Page