Menu

GLCD recommendation

2020-08-31
2020-11-07
<< < 1 2 3 (Page 3 of 3)
  • Anobium

    Anobium - 2020-09-18

    I think you need the 'vis' object in the Nextion screen. So, that needs to be there via the Nextion IDE.

     
    • stan cartwright

      stan cartwright - 2020-09-19

      I'm learning the ide from web example use. If I make the effort to figure it out the nextion could be a cool display.
      Thanks for making nextion driver.
      I notice that ili displays have an sd card but it's not supported in gcb.
      I suppose it holds images so could make it look like nextion.

       
  • stan cartwright

    stan cartwright - 2020-09-19

    I bet Nick aka macgman2000 is finding the 7 inch nextion more than he bargained for.
    The ide seems universally difficult to learn...but with effort ? so many commands.
    The nextion has a much more powerful processor than a 328p.
    It works with gcb glcd but can do lots more so spending time learning nextion.
    It was discussed years ago on the forum and I got nowhere but more info now.
    As with most gcb things I can not find a permanent use for a nextion unlike Nick
    who has plan and seeks a solution for his radio project.
    Thanks again Anobium for nextion and all glcd gcb support.
    gcb would not be so good if we had to write all the devices it supports ourselves....
    most of us couldn't.

     
  • stan cartwright

    stan cartwright - 2020-09-21

    Anobium. An ili9481 same as in Macgman2000 originally used arrived today.
    It just plugs into a uno and uses all it's ports.
    I tried the mega328p simple glcd demo which worked but the screen is reversed.
    When the demo starts it prints glcd print in 2 sizes ok then reversed numbers then the final screen.
    Please can you explain this? Would it be pins connections don't match code definitions?
    cheers.

     

    Last edit: stan cartwright 2020-09-21
  • Anobium

    Anobium - 2020-09-21

    What is reversed? turn the GLCD around. Does this resolve it? Or, look from the other side of the table.

    A picture may help.

    I can already explain. Every GLCD may look the same, they may even have the same controller, they are however different. Each clone maker clone the controller, connect differerent etc etc.

     

    Last edit: Anobium 2020-09-21
  • stan cartwright

    stan cartwright - 2020-09-21

    Everything is a mirror image..see photo above. All wiring matches gcb demo.
    I tried this code and only got text in same position for landscape and landscape_rev but looks ok.
    portrait and portrait_rev both give mirror image text in same position.
    and as the glcd demo loops in portrait it is a mirror image.

    do
    GLCDRotate ( Landscape_rev )     ' optionally you can rotate the screen.
    GLCDCLS
    GLCDPrint ( 2, 12, "GLCDPrint String" )
    wait 3 s
    GLCDRotate ( PORTRAIT_REV )
    GLCDCLS
    GLCDPrint ( 2, 12, "GLCDPrint String" )
    wait 3 s
    GLCDRotate ( Landscape )
    GLCDCLS
    GLCDPrint ( 2, 12, "GLCDPrint String" )
    wait 3 s
    GLCDRotate ( Portrait )
    GLCDCLS
    GLCDPrint ( 2, 12, "GLCDPrint String" )
    wait 3 s
    loop
    
     

    Last edit: stan cartwright 2020-09-21
  • stan cartwright

    stan cartwright - 2020-09-21

    this is the include orientation code

    Sub GLCDRotate_ili9481( in ILI9481AddressType as byte )
    
      set ILI9481_GLCD_CS OFF
      select case ILI9481AddressType
            case PORTRAIT  '0 degree
    
                  SendCommand_ILI9481(0x36)
                  SendData_ILI9481(0x0E)
                  GLCDDeviceHeight = GLCD_HEIGHT - 1
                  GLCDDeviceWidth  = GLCD_WIDTH - 1
    
            case LANDSCAPE
    
                  SendCommand_ILI9481(0x36)
                  SendData_ILI9481(0x2b)
                  GLCDDeviceHeight = GLCD_WIDTH - 1
                  GLCDDeviceWidth  = GLCD_HEIGHT - 1
    
    
            case PORTRAIT_REV
    
                  SendCommand_ILI9481(0x36)
                  SendData_ILI9481(0x0D)
                  GLCDDeviceHeight = GLCD_HEIGHT - 1
                  GLCDDeviceWidth  = GLCD_WIDTH - 1
    
    
            case LANDSCAPE_REV
    
                  SendCommand_ILI9481(0x36)
                  SendData_ILI9481(0x2c)
                  GLCDDeviceHeight = GLCD_WIDTH - 1
                  GLCDDeviceWidth  = GLCD_HEIGHT - 1
    
            case else
                  SendCommand_ILI9481(0x36)
                  SendData_ILI9481(0x0E)
                  GLCDDeviceHeight = GLCD_HEIGHT - 1
                  GLCDDeviceWidth  = GLCD_WIDTH - 1
    
    
      end select
      set ILI9481_GLCD_CS On
    
    end sub
    
     

    Last edit: stan cartwright 2020-09-21
  • Anobium

    Anobium - 2020-09-21

    No Stan.

    Do not be changing the library.

    The phyical connections on the GLCD are wrong. Send it back. Or, the geometry in the library is correct. So, the LCD is fitted incorrectly, or, the controller is not correct.

    So, this is not 'mirror image' this is a rotation error?

     
  • Anobium

    Anobium - 2020-09-21

    Hold on.... the photos.

    Is one the existing working one?
    And, the other is the new one?

     
  • Anobium

    Anobium - 2020-09-21

    Have had a scan of the datasheet. There is control for the direction of display update. This is called called MADCTL typically register 0x36, page 78 of the datasheet.

    So, in the init we use

          SendCommand_ILI9481(0x36)
          SendData_ILI9481(0x0E)
    

    In you main code, try changing the high nibble.

          SendCommand_ILI9481(0x36)
          SendData_ILI9481(0x00..0x1E.. 0x2E..0x3E..0x4E..0x5E..0x6E..0x7E.. )
    

    Bits 5, 6 and 7 control the update direction.

    See page 79 of the datasheet. The Great Cow BASIC default is 000.

    So, work through the seven options using ONLY one at a time like 0x1E then 0x2E

     

    Last edit: Anobium 2020-09-21
  • stan cartwright

    stan cartwright - 2020-09-21

    The photos are the code I posted above showing screen rotation effect.
    The problem is rotation...on this mcufriend diplay.
    landscape and landscape_rev print text and graphics ok but the screen does not rotate.
    portrait and portrait_rev mirror the display and don't rotate the screen.

    Mirroring using this display is a popular subject on arduino sites when I searched.
    https://www.google.com/search?client=opera&q=ili9486+mirror+image&sourceid=opera&ie=UTF-8&oe=UTF-8

     
  • stan cartwright

    stan cartwright - 2020-09-21

    I downloaded a 312 page pdf ili9846 data sheet and can't find MADCTL.
    I don't know what "so ,in the init we use" etc.
    this is the init in the demo

        #define GLCD_TYPE GLCD_TYPE_ILI9481
    
        'Pin mappings for SPI - this GLCD driver supports Hardware SPI and Software SPI
        #define GLCD_RD       ANALOG_0          ' read command line
        #define GLCD_WR       ANALOG_1          ' write command line
        #define GLCD_RS       ANALOG_2          ' Command/Data line
        #define GLCD_CS       ANALOG_3          ' Chip select line
        #define GLCD_RST      ANALOG_4          ' Reset line
    
        #define GLCD_DB0       DIGITAL_8
        #define GLCD_DB1       DIGITAL_9
        #define GLCD_DB2       DIGITAL_2
        #define GLCD_DB3       DIGITAL_3
        #define GLCD_DB4       DIGITAL_4
        #define GLCD_DB5       DIGITAL_5
        #define GLCD_DB6       DIGITAL_6
        #define GLCD_DB7       DIGITAL_7
    
        #define deviceSpecific_ILI9481_GLCD_HEIGHT 476
    

    If I change the simple glcd to landscape it works but is designed for portrait
    and like lots of gcb glcd, it does not show an error if like in the photo stuff is off screen.

     
  • stan cartwright

    stan cartwright - 2020-09-21

    Anobium. Looking back over this thread I saw you refer to
    ..GreatCowBasic\demos\glcd_solutions\glcd_simple_demonstration_solutions\glcd_simple_demonstation_unoshield_mega328p_for_ili9486@16.gcb (7)

    I tried it and it works! shock horror!
    so what's the difference in the simple glcd demos except uno shield?

    #define UNO_8bit_Shield
    

    This has been a waste of your time. I'm sorry....but a simple explanation please.
    there's

        DSTB_ILI9486L ( off )
        wait 2 s
        'Turn display on
        DSTB_ILI9486L ( on )
    

    which is not in the demo I used.
    Now to get touch working.
    cheers

    edit ps this is a fast display!

     

    Last edit: stan cartwright 2020-09-21
  • stan cartwright

    stan cartwright - 2020-09-21

    This is the display I am using,came with a touch stylus pen.
    I can not see a way of using touch with gcb demos and the display pins.
    dunno if you can see the pin labels.
    it is a nice display. getting touch to work would make it nicer...
    as the thread creator said, it's not a simple demo for this display.
    I would rather try to get an ili touch to work than a nextion.

     
    • Anobium

      Anobium - 2020-09-22

      Try the calculator demos. It has touch.

       
      • stan cartwright

        stan cartwright - 2020-09-22

        looking at the photo of the board above post, I find nothing out of the touch types that is compatable with this display using gcb.
        The calculator is not compatable nor the glcd touch demos.
        It isn't supported so macgman2000 gave up.

         

        Last edit: stan cartwright 2020-09-22
  • stan cartwright

    stan cartwright - 2020-09-21

    Another question.I found a mega2560 board. If I wired this dispay to it
    using the mega 328 and define uno shield would it work?
    it doesn't match mega2560 pinout so is it worth wiring ie with wires?
    if I wire it pin for pin with 2560 would uno code work?
    I'm not going to try tonight.

     
  • stan cartwright

    stan cartwright - 2020-09-22

    I don't know how many people have used this display with gcb but...
    GLCDRotate Landscape_Rev
    Box (0,0,479,319,TFT_YELLOW) and only 3 sides of box...no top
    needs Box (0,1,479,319,TFT_YELLOW) to get a box.

     
  • Anobium

    Anobium - 2020-09-22

    Send me an email. Looks like we need to tweak the library.

     
  • stan cartwright

    stan cartwright - 2020-09-23

    nextion displays..what does the image mean?..from gcb/nextion google
    how to get x,y touched from whole screen as default.

     
  • stan cartwright

    stan cartwright - 2020-09-23

    As this post was originally recomended glcd for gcb..again what is?
    I tried a ssd1306...great but same size as a stamp and monochrome.
    Then a colour version but mine had a permanent white line and not sending back to China.
    Then ili9346. Fast display and not many wires but 3.3V logic so hassle.
    also touch never worked on 3 devices.
    Then nextion which work with gcb but using gcb glcd are very slow
    and using the ide is like learning a graphics app. but only 2 wires.
    I recently tried a ili9486 which needs more ports than you can wave a stick at
    ie it fits a uno but uses all a-d ports...but it's a fast display.
    again I can't sort touch screen to work.

    So what colour display works with gcb touch at 5V logic? spi,i2c preferred.

     
  • stan cartwright

    stan cartwright - 2020-09-24

    There's a ADS7843 touch demo and

        #define XPT2046_DI       DIGITAL_12          ' Data in | MISO
        #define XPT2046_DO       DIGITAL_11          ' Data out | MOSI
        #define XPT2046_SCK      DIGITAL_13          ' Clock Line
        #define XPT2046_CS       DIGITAL_2           ' Chip select line
        #define XPT2046_IRQ      ANALOG_5
        #define XPT2046_HardwareSPI
    

    demo but all I get using a 328p nano is touch the screen and red square flashes and led on the nano flashes but no screen info.

    the logic to the diplay is dropped to 3.3V.
    the above shared

        #define XPT2046_DI       DIGITAL_12          ' Data in | MISO
        #define XPT2046_DO       DIGITAL_11          ' Data out | MOSI
        #define XPT2046_SCK      DIGITAL_13          ' Clock Line
    

    are joined after the leveller ie 3.3V logic and XPT2046_CS DIGITAL_2 is sent through
    the leveller so at 3.3Vlogic.
    the XPT2046_IRQ ANALOG_5 is wired strait to an5 but tried it through the level converter.
    Tried 3 Ili9341 but no touch.

     
  • Anobium

    Anobium - 2020-10-02

    I have had a look at the ILI9486 GLCD with respect to support.

    At with all things there ILI9486 GLCDs and there are ILI9486 GLCDs.


    There is a specfiic ILI9486 GLCD for the Raspberry. This device comes a XPT Touch sensor. This works as expected with teh XPT library. And, there are demos for this.


    There a lot more ILI9486 GLCDs with resistive Touch interface. This is a mess of touch solution and these The ILI9486 GLCDs can be spotted by the lack of the XPT chip on the bottom.

    See later in this post.


    But, beware even if the advert says 'Touch' .. you need to ensure the ILI9486 GLCD comes with the XPT chip.


    So, how to make the resistive Touch interface. Port this library
    https://github.com/adafruit/Adafruit_TouchScreen/blob/master/TouchScreen.cpp

    Here is a start but this does work completely - I will leave this to someone who has a need to resolve.

    The code sets up the GLCD, and then toggles port power across the resistive Touch interface then you read. then you need to toggles port power and read again etc.

    This is a prototype based on the URL above. It shows some values on the terminal.

        'Chip Settings.
        #chip mega328p, 16
        #option explicit
    
          #include <glcd.h>
          #include <uno_mega328p.h >
    
          #define GLCD_TYPE GLCD_TYPE_ILI9486
          #define UNO_8bit_Shield
    
          'Pin mappings for SPI - this GLCD driver supports Hardware SPI and Software SPI
          #define GLCD_RD       ANALOG_0          ' read command line
          #define GLCD_WR       ANALOG_1          ' write command line
          #define GLCD_DC       ANALOG_2          ' Command/Data line.
          #define GLCD_CS       ANALOG_3          ' Chip select line
          #define GLCD_RST      ANALOG_4          ' Reset line
    
          #define GLCD_DB0       DIGITAL_8
          #define GLCD_DB1       DIGITAL_9
          #define GLCD_DB2       DIGITAL_2
          #define GLCD_DB3       DIGITAL_3
          #define GLCD_DB4       DIGITAL_4
          #define GLCD_DB5       DIGITAL_5
          #define GLCD_DB6       DIGITAL_6
          #define GLCD_DB7       DIGITAL_7
    
    
    
          #Define _xp  DIGITAL_7
          #Define _ym  DIGITAL_6
    
          #Define _xm  ANALOG_2
          #define ADPORT_xm AN2
    
          #Define _yp  ANALOG_1
          #define ADPORT_yp AN1
    
    
    
        GLCDBackground = ILI9486L_BLUE
        GLCDCLS
    
        GLCDPrint 0,0, "Touch"
    
    
      #define AD_Delay 20 10us
    
    
    
        Do
            Dir _yp in
            Dir _ym in
            dir _xp out: _xp = 1
            Dir _xm out: _xm = 0
            HSerPrint ReadAD10 (1)
            HSerSend 9
    
            dir _xp in
            Dir _xm in
            Dir _yp out: _yp = 1
            Dir _ym out: _ym = 0
    
            HSerPrint ReadAD10 (2)
            HSerSend 9
    
            HSerPrintCRLF
            wait 100 ms
        Loop
    

    Enjoy

     
<< < 1 2 3 (Page 3 of 3)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.