Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CC3200 with TFT Touch screen

Status
Not open for further replies.

aakash sancheti

Newbie level 3
Joined
Aug 27, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,299
Hey, I am trying to control and use TFT - 2.8'' LCD touch with TI - CC3200 launchpad.
Issue is i have not yet used TFT modules and am clueless about its library requirements.
i surfed various libraries of Arduino for same TFT screen, but i am unalbe to understand how to exactly use it.
so can anyone provide me with the libraries for TFT with CC3200 or guide me for the issue.
Its pretty urgent.
Any suggestions accepted!
Thanks in advance!!!
 

What 2.8" TFT LCD are you using? Do you know what your LCD's display controller is? And by that I don't mean your CC3200, but the controller on the LCD shield/board. Since this is your first time using a TFT, i would like to mention that most TFT LCD shields for the Arduino use the i80 interface or SPI (which I think you may be familiar with if you've used MCUs before).

Your shield uses the i80 interface if it has:
8/16/9/18 pins for data (your LCD probably uses 8 bits)
1 pin for CS - chip select
1 pin for RS - register select (determines if the data being written is for command/register or parameter)
1 pin for WR - write strobe
1 pin for RD - read strobe

and usually 1 bit/pin for RESET

I would suggest looking up the i80/SPI interface first to familiarize yourself how to send commands to your LCD.
Once you figure out how to send commands using the CC3200 (probably via bit-banging at first if it uses i80), initializing your LCD would be your next objective. The process for initialization usually goes like this:

- perform a hardware reset on the lcd by toggling the RESET pin (RESET is usually active low so: HIGH - LOW (for X milliseconds) - HIGH)

- initialize LCD controller registers by writing commands and parameters to registers (if you know your controller, you can try looking for the header file of your controller in the arduino libraries to find out what values to write to your controller's registers for initialization)

- initialize LCD RAM (set the horizontal/vertical start/end RAM addresses, etc )

- send command to enable/activate the display

You'll know you intialized the display correctly if the LCD screen activates and display's "garbage" after sending the command to enable/turn on the display. The touch function is usually controlled separately via SPI interface. Some shields make use of analog lines (which are read via MCU ADC).
 
Last edited:
Hey, thanks for your immediate and worthy reply.
I am using CC3200 controller with 2.8'' TFT - PT0282432T-B702-J Ver.A (Palm technologies) touch. and as you said Yes! it has built in controller - ILI9341. I went through the datasheet of the driver and TFT but still unable to understqand how to exactly use it.
Sir, can you please provie me with some sample C code for CC3200.
i got arduino based codes and libraries but am unable to port it and translate it as per the requirement of CC3200.
these are the libraries i got
- https://learn.adafruit.com/adafruit-gfx-graphics-library
- https://github.com/adafruit/TFTLCD-Library
So please can you tell me how to harness this codes for my use.
I am using CCS compiler with CC3200(Arm Cortex M4 core).
any suggestions accepted!!.

Thank you for your guidance!!!!
 

I really have no experience with the CC3200 so I can't really help you with writing that's code specific for it. But I found that Newhaven display has some pretty good example code for several tft drivers and they are pretty easy to understand:
**broken link removed**

Here's their sample code for the ILI9341, I'm pretty sure you can modify this for your CC3200:
https://www.newhavendisplay.com/app_notes/2-4TFT_ILI9341.txt

Like I mentioned, it's pretty much a matter of sending a series of commands to initialize the display.
I think the basic things you need to remember to keep things simple for now are:

-RD pin should be set high. You don't really need the read strobe to initialize the display (or write data to the screen buffer).
-CS should be low to ensure the chip controller is selected.

So that leaves you with the RS pin, Data port, and the WR pin. These pins are mainly used to (a) write commands and (b) write parameter values.

You'll find in Newhaven's example code that the initialization function mainly uses two other functions:
-TFT_24S_Write_Command
-TFT_24S_Write_Data

I'll try to describe the two:

Code:
void TFT_24S_Write_[B]Command[/B](unsigned int command)
{
GPIO_ResetBits(GPIOC, CS1);   //set chip select low. this line can be removed if the CS pin is already kept low
GPIO_ResetBits(GPIOC, RS);     // set the [B]RS[/B] pin [B]low[/B]. This means we are sending a [B]command[/B].
GPIO_SetBits(GPIOC, nRD);      // set the RD pin high. this line can be removed if the RD pin is already kept high
GPIO_ResetBits(GPIOC, nWR);  // set the [B]WR[/B] pin [B]low[/B] to prepare for writing
GPIO_Write(GPIOB, command);// place the 'command' to the data port
GPIO_SetBits(GPIOC, nWR);     // toggle the [B]WR[/B] pin [B]high[/B] to complete the write. 
TFT_delay(10);
}

void TFT_24S_Write_[B]Data[/B](unsigned int data1)
{
GPIO_Write(GPIOB, data1);      //present the data port
GPIO_SetBits(GPIOC, RS);       // set [B]RS[/B] pin [B]high[/B]. This means we are sending a [B]parameter value[/B].
GPIO_ResetBits(GPIOC, nWR); //set the [B]WR[/B] pin [B]low[/B] to prepare for writing
GPIO_SetBits(GPIOC, nWR);    // toggle the [B]WR[/B] pin [B]high[/B] to complete the write.
}

the transition of the WR pin from low to high causes a write to the ILI9341 of whatever is on the data port and the RS pin determines if it is a command or a parameter value. You'll notice that the only difference between the two functions is really only the RS pin:

-RS = 0 to send a Command or select a register to be written
-RS = 1 to send a parameter for the command or a value to write to the register

Let's take a look at a small part of the init sequence in the newhaven sample code:

Code:
TFT_24S_Write_Command(0x00CB);//Power Control A
TFT_24S_Write_Data(0x0039);//always 0x39
TFT_24S_Write_Data(0x002C);//always 0x2C
TFT_24S_Write_Data(0x0000);//always 0x00
TFT_24S_Write_Data(0x0034);//Vcore = 1.6V
TFT_24S_Write_Data(0x0002);//DDVDH = 5.6V

If you look at the data sheet for the ILI9341, you'll see that the Power Control A Register is 0x00CB.
This register has 5 parameters.

So to configure this register:
-You use TFT_24S_Write_Command(0x00CB) to say we are writing to Power Control A register
-Followed by 5 TFT_24S_Write_Data() instructions to set the parameters for Power Control A.

So I think you just have to follow the initialization sequence in the sample code to initialize your LCD.
 
Last edited:
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top