Jump to content
43oh

grlib for Adafruit 320x240x18 TFT Display


Recommended Posts

I implemented a Stellaris grlib display driver for Adafruit's 320x240x18 TFT Touch display.

http://adafruit.com/products/335

 

The code can be found on github

https://github.com/a...uit-TFT-ILI9325

 

I tested it only with Lab 10 in the Stellaris Launchpad workshop (w/o touch). Please let me know if you run into issues and I'm glad to fix it.

 

Wiring is a mess as the pins of individual ports are all over the place.

 

post-339-1426460515402_thumb.jpg

 

Regards

Adrian

Link to post
Share on other sites

I just committed an updated version to Github that fixes a glaring bug and adds touch calibration

 

- Bug: Forgot to toggle CS in most places, dooh! (a miracle it ever worked :-)

- Addition: Functions to calibrate touch display. After calibration the StellarisWare touch implementation works just fine with this display

Link to post
Share on other sites
  • 5 months later...

Hi, I tested Stellaris-grlib-driver-Adafruit-TFT-ILI9325 library and work perfect. But, when I connect one sensor to I2C (sensor work fine without TFT library), he doesn't work.
I found the problem in:



 

    Adafruit320x240x16_ILI9325Init();                            // Inicializace LCD
 

 

-> in function

 

void Adafruit320x240x16_ILI9325Init(void)                    // Initializing display
{
  LCDWriteData(0);
}
 

 

->

 

void LCDWriteData(const unsigned short usData)
{
    LCD_DATA_WRITE(usData >> 8);                       // Send higher byte
}
 

 


This function LCD_DATA_WRITE(usData >> 8) make somethink (I don't know what) and the I2C are disabled (I see, in the register MSMON is 0x00 (before 0x03, what is OK)).

Have You some idea, where is the problem?
Thank you, Waldik.
 

Link to post
Share on other sites

Sorry, but I think I led you down the wrong path. Looking at my code, I actually don't use SPI. The display uses 8 lines to transfer bytes in parallel.

 

The macro LCD_DATA_WRITE writes one byte to Port B.

 

// Port and bitmask used for 8-bit data bus
#define LCD_DATA_PERIPH  SYSCTL_PERIPH_GPIOB
#define LCD_DATA_BASE    GPIO_PORTB_BASE
#define LCD_DATA_PINS     0xFF
 
#define LCD_DATA_WRITE(ucByte)    { HWREG(LCD_DATA_BASE + GPIO_O_DATA + (LCD_DATA_PINS << 2)) = (ucByte); }

 

HWREG is a method for fast access to memory mapped registers, which is a bit cryptic and I might have an error in here that causes the code to overwrite other locations than Port B.

 

What pins is your I2C sensor connected to?

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...