Jump to content
chicken

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

Share this post


Link to post
Share on other sites

That looks really great. I'm really tempted to get one of those displays. It looks like being of a good quality, and touch built-in is really neat.

Share this post


Link to post
Share on other sites

Rob is building a similar one in the other thread.

 

I saw that one as well, yes. But the display doesn't have any touch-layer as far as I can see, and that would be really sweet.

So many options are nice, but at some point I have to make a choice :-)

Share this post


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

Share this post


Link to post
Share on other sites

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.
 

Share this post


Link to post
Share on other sites

I won't have time to look into it any time soon. But I think the Stellaris Launchpad shares the pins (and possibliy peripherals) for SPI and I2C, which would mean  that you can't use both at the same time.

Share this post


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?

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×