Shop OBEX P1 Docs P2 Docs Learn Events
ILI9341 — Parallax Forums

ILI9341

CelticLordCelticLord Posts: 50
edited 2016-04-10 00:23 in Propeller 1
I have two boards withh the 9341 graphics controller.
The First works fine,
http://www.elecfreaks.com/store/24-tft-lcd-tft0124sp-p-785.html
but the newest one from Adafruit
https://www.adafruit.com/products/2090
does not work with the driver (Mark Tillotson) http://obex.parallax.com/search/ili9341
Can anyone resolve this, or have an updated driver?

Comments

  • CelticLordCelticLord Posts: 50
    edited 2016-04-19 19:28
    Been through anything I can think of and don't see why the driver should not work?
    1. Same graphics chip ILI9341
    2. same communication methoud (SPI)
    3. All pins connected and referenced correct when initialized.
    4. Backlight biased and bright but blank.

  • CelticLordCelticLord Posts: 50
    edited 2016-06-14 20:59
    All working Fine!
    Problem was no literature with Product. Found on Adafruit site.
    Pads IM1 IM2 IM3 need to be soldered for SPI
    All I need to do now is get the I2C for touch screen woring, don't know what the device address would be. Tryed going through all 128 (0 - 127) addresses with no luck. There are no address pins to set on the board. Has to be 0 and the I2C (jm_i2c.spin) http://obex.parallax.com/object/311 driver needs to be tweek some way or other. Any help?
  • Ah, glad its working now - TFT grief is not fun, I know.
  • CelticLordCelticLord Posts: 50
    edited 2016-06-14 23:04
    Got any ideas on getting the I2C for the touch screen working.
    Using (jm_i2c.spin) http://obex.parallax.com/object/311 driver
    The touch screen has IRQ / SCL / SDA as you know.
    IRQ goes low when screen touched to signal valid touch (Works),
    but when it goes to I2C section of my code (Spin) to execute I2c read x(4) and y(6) addresses it locks up there. Tried all 128 (0 - 127) possible id for the touch screen chip http://www.buydisplay.com/download/ic/FT6206.pdf.
    So I think, and im no expert with I2C, its the I2c code needs tweeked to run the clk at 10 - 400khz per data sheet. How I do not know.
    Help Apreciated
  • CelticLord wrote: »
    Got any ideas on getting the I2C for the touch screen working.
    Using (jm_i2c.spin) http://obex.parallax.com/object/311 driver
    The touch screen has IRQ / SCL / SDA as you know.
    IRQ goes low when screen touched to signal valid touch (Works),
    but when it goes to I2C section of my code (Spin) to execute I2c read x(4) and y(6) addresses it locks up there. Tried all 128 (0 - 127) possible id for the touch screen chip http://www.buydisplay.com/download/ic/FT6206.pdf.
    So I think, and im no expert with I2C, its the I2c code needs tweeked to run the clk at 10 - 400khz per data sheet. How I do not know.
    Help Apreciated

    Snippet from Adafruit page:

    The capacitive touch screen controller communicates over I2C, which uses two hardwire pins. However, you can share these pins with other sensors and displays as long as they don't conflict with I2C address 0x38.

    https://learn.adafruit.com/adafruit-2-dot-8-color-tft-touchscreen-breakout-v2/capacitive-touchscreen
  • CelticLordCelticLord Posts: 50
    edited 2016-06-16 23:54
    Need help to fix code it just hangs when it goes to subroutine Touch after it beep the piezo speaker. Graphics work but dose not display due to hanging up in Touch.
    It is not my code directly but how im trying to use the I2C by Johhny Mac. What am I doing wrong!
    CON
      _clkmode = xtal1 + pll16x  'Standard clock mode * crystal frequency = 80 MHz
      _CLKFREQ = 80_000_000
    
      '*************************************
      '**  glcdlay 2.8TFTLCDCAPTOUCH SPI  **
      '*************************************
      ' SD Card     SPI
      _dopin   = 23 ' MISO      
      _clkpin  = 25 ' CLK         
      _dipin   = 21 ' MOSI    
      _cspin   = 7  ' CS              
      _cdpin   = -1 ' -1 if unused.
      _wppin   = -1 ' -1 if unused.
      _rtcres1 = -1 ' -1 always.
      _rtcres2 = -1 ' -1 always.  
      _rtcres3 = -1 ' -1 always.
    
      ' LCD         SPI
      nRESET   = 15 ' Reset 
      RS       = 17 ' D/C      
      nCS      = 19 ' CS      
      MOSI     = 21 ' MOSI    
      SCLK     = 25 ' CLK     
      MISO     = 23 ' MISO    
    
    
      'Touch Screen I2C
      TSDA     = 4   ' SDA
      TSCL     = 6   ' SCL
      TIRQ     = 12  ' IRQ
      TSAD     = 0   ' I2C Address
    
      'Speaker
      Spkr   =  0
    
    OBJ
      ASE         : "ASCII_STREngine"
      sd          : "MicroSD"
      glcd        : "ILI9341-spi"
      TS          : "I2C" 
    
    VAR
      Byte Button, tsByte, iLoop, bBeeps, bSpkrOn, bSpkrOff
    
    Main
        '*********************************
        '**     INITIALIZE SPEAKER      **
        '*********************************
        DIRA[Spkr] := 1
     
       '*********************************
       '**       INITIALIZE  I2C       **
       '*********************************
      TS.setupx(TSCL, TSDA)
          
      '*********************************
      '**     INITIALIZE KEYBOARD     **
      '*********************************
      DIRA[TIRQ] := 0
    
      Repeat
        '****************************
        '**        KeyBoard        **
        '****************************
    
        Repeat iLoop from 1 to 50
          Button := ina[TIRQ]
          if Button == 0  
            Touch
    
    
    PUB Touch
      Beep 
      tsByte := TS.rd_byte(TSAD, $04)
      glcd.DrawStringSmall (16,96,ASE.integerToDecimal(tsByte,3))  
    
    Pub Beep
      '**************************
      '**         Beep         **
      '**************************
      Repeat bBeeps from 1 to 50
        outa[Spkr] := 1
        repeat bSpkrOn from 1 to 100
        outa[Spkr] := 0
        repeat bSpkrOff from 1 to 10
    



  • This piece of code:
    'Touch Screen I2C
      TSDA     = 4   ' SDA
      TSCL     = 6   ' SCL
      TIRQ     = 12  ' IRQ
      TSAD     = 0   ' I2C Address
    

    TSAD should be $38, ie hexadecimal, according to the Adafruit snippet I posted.

    Do you have or need a pullup on SDA ?
    SCL and IRQ will not need them.
  • CelticLordCelticLord Posts: 50
    edited 2016-06-17 17:17
    TSAD was set to $38 before, but I just reset it to $38
    1. Yes I have a 10K pullup on SDA
    Have also tried a 1K. Dont have 4.7k to use
    2. All connections are correct
    Graphics card funtions just not when it gets to the TOUCH routine because it dose not process the I2C when it hangs in it.
    I know it hangs because the clock routine is not updated due to it not returning from TOUCH
    3. It is going to touch because I have an audio beep there.

    Same result it hangs in Touchs I2C code
Sign In or Register to comment.