Menu

ssd1289 and ili9341 no SPI

Dirk
2017-10-31
2017-10-31
1 2 > >> (Page 1 of 2)
  • Dirk

    Dirk - 2017-10-31

    Hi everybody,
    I received two displays from a chinese supplier.
    They look like twins, but one is a SSD1289 and the other one is a ili9341 that does not support SPI.
    Both displays have similar pins.
    The SSD1289 works perfect.
    I messed around with some glcd header files, but the ili9341 is not working.

    I am stuck, please help

     
  • stan cartwright

    stan cartwright - 2017-10-31

    The spi ili9341's I have use 3.3V logic. They power on 5V supply though, you can see the regulator.
    A 1.5KR in series to clk,mosi etc with 2k7 to ground works for me.
    The original ili9341 include recommended a ca4050 buffer run from 3.3V but it's gone now.

     

    Last edit: stan cartwright 2017-10-31
  • Dirk

    Dirk - 2017-10-31

    Hi Stan,

    the logic voltage is not an issue, I´m using a LM2575 step down regulator.
    Here comes a copy of my working ssd1289 config.
    I think we have to modify the ili9341.h

     
    • Anobium

      Anobium - 2017-10-31

      What version of Great Cow BASIC? This is important as we have upadted the library.

       
  • Dirk

    Dirk - 2017-10-31

    0.98.00 2017-09-23

    and latest includes from trunk

     
    • Anobium

      Anobium - 2017-10-31

      Advice. Dont update from trunk. The builds are the consistent and we issue patches - I cannot promise that code from trunk works with the release as we are constantly revising.

      So, back to question.

      Voltages are critical on ILI9341. Meter the voltages - I have one ILI9341 that will only operate at 3.4v.
      Also, which chip ? hardware or software ? I2c?

       
  • Dirk

    Dirk - 2017-10-31

    Hello Anobium,
    please have a look at my ssd1289.gcb
    It is working !
    I need something similar for the ili9341 with no SPI or I2c support

     
  • Anobium

    Anobium - 2017-10-31

    Do you mean the deivces has no SPI or I2C interface? what is the interface?

     
  • stan cartwright

    stan cartwright - 2017-10-31

    I think you have a 8 or 16bit parallel ili9341.
    does it look like this?

     

    Last edit: stan cartwright 2017-10-31
  • Dirk

    Dirk - 2017-10-31

    Yes that´s right 8 or 16bit parallel and no spi.
    any solution ?

     
  • stan cartwright

    stan cartwright - 2017-10-31

    There's isn't one unless you can change the ili9341 include to use parallel using the include for ili9481 as a guide.which is a parallel display. Beyond me,sorry.

     
  • Dirk

    Dirk - 2017-10-31

    Yeah,
    the ili9481.h is a good template i have tried earlier but without any success
    aren't there any code warriors around with the same problem ?

     
    • Anobium

      Anobium - 2017-10-31

      You have purchased some odd beasts. These displays are typically sold with I2C or/and SPI.

      So you were able to use the SSD1289 as this is already a 16bit bus? Correct?

      The ili9341 does not support a 16bit bus. Without a device here for testing this is a huge ask, for anyone. But, conversion of the communication methods should be possible to complete with some ease as the libraries all use common methods.... but the amount of regression testing would take most of the time.

       
  • Dirk

    Dirk - 2017-10-31

    the hx8374 also looks very suitable

     
    • Anobium

      Anobium - 2017-10-31

      What is a hx8374?
      Can you post the URL to the two you have purchased?
      Have you reviewed the GLCDs we support?

       
  • kent_twt4

    kent_twt4 - 2017-10-31

    I have this ili9341 (8 bit interface) on order for two weeks now from ebay https://www.ebay.com/itm/122631646524 probably another week or two before it arrives.

    Considering my complete lack of progress with the hx8347 glcd library, I can only surmise a definite maybe for a 8bit ili9341 library update.

     
    • Anobium

      Anobium - 2017-10-31

      I can do these libraries - I sort of enjoy it!

      I need the hardware/display delivered here. Cus, I am not going to buy them. :-)

       
  • stan cartwright

    stan cartwright - 2017-10-31

    Kent..buy from ebay uk and for twice the price it arrives in a week, sent from Leeds or somewhere uk.
    The arduino shield version looks plug n play. I got a shield for the one I posted. Too many wires otherwise.
    Am I right in thinking the ili9481 would look visually faster than the same code on an ili9341 ? ie is it worth the wiring and no ports left?
    Nice if ili9341 touch screen and sd card and reading screen ram ie pixel or row or box area was available. It can be done in c. I have the code but can't get it working in gcb.
    The ili9341/9841 includes are complicated in the hardware settings and what write actually does.

     

    Last edit: stan cartwright 2017-10-31
  • kent_twt4

    kent_twt4 - 2017-10-31

    @Anobium
    I'll wait on the ili9341 8bit and give it a go when it comes in. I'm too cheap to sponser... :) ... will someone sponser me? (just kidding!). I do like learning something new though, from scratch when possible.

    @Stan
    If the 8 bit library comes together, then the 16 bit is only a minor change to few procedures and initiation. I have no clue at this time on speed difference between the ili9341 and the ili9481, I would expect not a lot, if any? Speed differences on the glcd would mostly come down to I2C, SPI, and parallel interfaces, and clk speed of the micro I would think.

    The ili9481 16 bit interface glcd (arduino mega board model) that I mentioned in a previous post does not have a touch screen nor can it perform gram reads as that pin or capability is not brought out to the header.

     
  • stan cartwright

    stan cartwright - 2017-10-31

    Is it just change this

    sub  SendCommand_ILI9341( IN ILI9341SendByte as byte )
    
      set ILI9341_CS OFF;
      set ILI9341_DC OFF;
    
      #ifdef ILI9341_HardwareSPI
         SPITransfer  ILI9341SendByte,  ILI9341TempOut
         set ILI9341_CS ON;
         exit sub
      #endif
    
      #ifndef ILI9341_HardwareSPI
      repeat 8
    
        if ILI9341SendByte.7 = ON  then
          set ILI9341_DO ON;
        else
          set ILI9341_DO OFF;
        end if
        SET GLCD_SCK On;
        rotate ILI9341SendByte left
        set GLCD_SCK Off;
    
      end repeat
      set ILI9341_CS ON;
      #endif
    
    end Sub
    
    '''Send a data byte to the ILI9341 GLCD
    '''@param ILI9341SendByte Byte to send
    '''@hide
    sub  SendData_ILI9341( IN ILI9341SendByte as byte )
    
      set ILI9341_CS OFF;
      set ILI9341_DC ON;
    
      #ifdef ILI9341_HardwareSPI
         SPITransfer  ILI9341SendByte,  ILI9341TempOut
         set ILI9341_CS ON;
         exit sub
      #endif
    
      #ifndef ILI9341_HardwareSPI
      repeat 8
    
        if ILI9341SendByte.7 = ON then
          set ILI9341_DO ON;
        else
          set ILI9341_DO OFF;
        end if
        SET GLCD_SCK On;
        rotate ILI9341SendByte left
        set GLCD_SCK Off;
    
      end Repeat
      set ILI9341_CS ON;
      #endif
    
    end Sub
    
    '''Send a data word (16 bits) to the ILI9341 GLCD
    '''@param ILI9341SendByte Word to send
    '''@hide
    Sub SendWord_ILI9341(In ILI9341SendWord As Word)
      set ILI9341_CS OFF;
      set ILI9341_DC ON;
    
      #ifdef ILI9341_HardwareSPI
         SPITransfer  ILI9341SendWord_H,  ILI9341TempOut
         SPITransfer  ILI9341SendWord,  ILI9341TempOut
         set ILI9341_CS ON;
         exit sub
      #endif
    
      #ifndef ILI9341_HardwareSPI
      repeat 16
    
        if ILI9341SendWord.15 = ON then
          set ILI9341_DO ON;
        else
          set ILI9341_DO OFF;
        end if
        SET GLCD_SCK On;
        rotate ILI9341SendWord left
        set GLCD_SCK Off;
    
      end repeat
      set ILI9341_CS ON;
      #endif
    End Sub
    

    to this?

    sub  SendCommand_ILI9481( IN ILI9481SendByte as byte )
    
      #if GLCD_TYPE = GLCD_TYPE_ILI9481
    
        #ifndef GLCD_ILI9481_16bit
            '  'Set output command
            #ifdef PIC
              ILI9481_GLCD_DB7 = ILI9481SendByte.7
              ILI9481_GLCD_DB6 = ILI9481SendByte.6
              ILI9481_GLCD_DB5 = ILI9481SendByte.5
              ILI9481_GLCD_DB4 = ILI9481SendByte.4
              ILI9481_GLCD_DB3 = ILI9481SendByte.3
              ILI9481_GLCD_DB2 = ILI9481SendByte.2
              ILI9481_GLCD_DB1 = ILI9481SendByte.1
              ILI9481_GLCD_DB0 = ILI9481SendByte.0
            #endif
            #ifdef AVR
            PORTD = (PORTD & 0B00000011) | ((ILI9481SendByte) & 0B11111100);
            PORTB = (PORTB & 0B11111100) | ((ILI9481SendByte) & 0B00000011);
            #endif
    
              set ILI9481_GLCD_RS OFF
              set ILI9481_GLCD_WR OFF
              set ILI9481_GLCD_WR ON
              set ILI9481_GLCD_RS ON
    
        #endif
    
        #ifdef GLCD_ILI9481_16bit
          Set ILI9481_GLCD_CS Off
          set ILI9481_GLCD_RS OFF
    
          ILI9481_DataPortH = 0
          ILI9481_DataPortL = ILI9481SendByte
    
          'set ILI9481_GLCD_RS OFF
          set ILI9481_GLCD_WR OFF
          set ILI9481_GLCD_WR ON
          set ILI9481_GLCD_RS ON
          Set ILI9481_GLCD_CS On
        #endif
    
      #endif
    
    end Sub
    
    '''Send a data byte to the ILI9481 GLCD
    '''@param ILI9481SendByte Byte to send
    '''@hide
    sub  SendData_ILI9481( IN ILI9481SendByte as byte )
    
      #if GLCD_TYPE = GLCD_TYPE_ILI9481
    
        #ifndef GLCD_ILI9481_16bit
            #ifdef PIC
              ILI9481_GLCD_DB7 = ILI9481SendByte.7
              ILI9481_GLCD_DB6 = ILI9481SendByte.6
              ILI9481_GLCD_DB5 = ILI9481SendByte.5
              ILI9481_GLCD_DB4 = ILI9481SendByte.4
              ILI9481_GLCD_DB3 = ILI9481SendByte.3
              ILI9481_GLCD_DB2 = ILI9481SendByte.2
              ILI9481_GLCD_DB1 = ILI9481SendByte.1
              ILI9481_GLCD_DB0 = ILI9481SendByte.0
            #endif
            #ifdef AVR
            PORTD = (PORTD & 0B00000011) | ((ILI9481SendByte) & 0B11111100)
            PORTB = (PORTB & 0B11111100) | ((ILI9481SendByte) & 0B00000011)
            #endif
    
              set ILI9481_GLCD_WR OFF
              set ILI9481_GLCD_WR ON
    
        #endif
    
        #ifdef GLCD_ILI9481_16bit
            Set ILI9481_GLCD_CS Off
            ILI9481_DataPortH = 0
            ILI9481_DataPortL = ILI9481SendByte
            set ILI9481_GLCD_WR OFF
            set ILI9481_GLCD_WR ON
    
            Set ILI9481_GLCD_CS On
        #endif
    
      #endif
    
    end Sub
    
    '''Send a data word (16 bits) to the ILI9481 GLCD
    '''@param ILI9481SendWord Word to send
    '''@hide
    Sub SendWord_ILI9481(In ILI9481SendWord1 As Word)
    
      Dim ILI9481SendWord1 as Word
      #ifdef GLCD_ILI9481_16bit
        Set ILI9481_GLCD_CS Off
            ILI9481_DataPortH = ILI9481SendWord1_H
            ILI9481_DataPortL = ILI9481SendWord1
        Set ILI9481_GLCD_WR Off
        Set ILI9481_GLCD_WR On
        Set ILI9481_GLCD_CS On
      #endif
    
    End Sub
    
     
  • kent_twt4

    kent_twt4 - 2017-10-31

    @Stan,

    No, not that simple, there is more to it than that... More substitutions happen in a few other places in the library, init, and of course various housekeeping requirements when encountered. One would try and incorporate all interfaces into one sub (like sendcommand, senddata etc.), and use defines for both the 8bit and 16bit interfaces.

     
    • Anobium

      Anobium - 2017-10-31

      And, the regression testing. Kent - you are spot on - simply things down please.

       
  • stan cartwright

    stan cartwright - 2017-10-31

    re regression testing..had to look it up
    When I look at c glcd includes they look device dependent...not really clever at c though.
    Again, is it worth the effort over a spi glcd and is that faster than i2c ?
    Why do glcb includes test the device ie if def glcdxxx then.. when it's the include for glcdxxx anyway?

     
    • Anobium

      Anobium - 2017-10-31

      You are joking of course? Editing an existing piece of code requires regression testing. It is very simple to make an error and testing should pick up the errors - a simple #if may look like it is working for a specific configuration but this is no warranty that something else is not impacted.

       
  • stan cartwright

    stan cartwright - 2017-10-31

    No. Serious. If someone asked what I been up to lately and I said regession testing..
    I have wondered why the glcd includes are not just for one device.
    No point in modifying includes except for personal use as I don't think modded libs as in arduino by joe bloggs would be popular
    I just thought for example the pset which is essential to gcld but it's a sub with the call-ret overhead which is significant in lines and fills. If each device had it's own lib would that be better?
    I might time some alterations. What would be best way to time repeated lines,etc on a uno...print result to display :)

     
1 2 > >> (Page 1 of 2)

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.