Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Touch Panels and Screens

Status
Not open for further replies.
I am getting a little confused:confused:

one question, lately reading literature, it seems that to control TFT LCD efficiently I would need a PIC32 with PMP and DMA at minimum.....:eek:

I confess I havent read the controllers datasheet throughly yet but it also seems they require more than just instructions... or maybe I am understanding it wrong...sorry
 
I'll try and put it into perspective..

To drive a TFT panel you need to refresh the screen at 60Hz or so just like any TV or monitor..

There are very low level functions that apply the RGB colour pixel by pixel across the screen and several control signals to allow for frame clock and so on..

To be able to do this you can interface directly to a micro... Assuming 480 x 272 pixels ( 4.3") you need a clock rate of 7.8Mhz... Once you set up your DMA and timers to output all the data you are going to need a screen buffer to keep the screen refreshed the screen size for 8 bit colour is 128k, You then need all the lowlevel screen manipulation routines... ie.. plot pixel, clear, refresh ... Then slightly higher level... lines, circles, images and so on..

Controller chips do all of the above... all you need to do is specify colours and drawing parameters and so on..

Intelligent LCD's do all of the above... all you need to do is sequence images, text and so on..

It is much easier to use a Controller chip than do it yourself as you need quite a few resources that could be more useful elsewhere... I have a project posted here using 512 LED's set up as a screen... I have shift registers as line drivers and a pic16f877a clocking the data to the LED's I have a buffer that is directly copied to the LED's at the correct interval and an off screen buffer that I draw on... This gives a good idea of how direct draw works..

Much easier with a controller chip!!
 
I am browsing through Nextion. Do their LCDs use controllers??? I am reaing datasheets etc (like https://wiki.iteadstudio.com/images/8/86/Datasheet_NX4827T048.pdf
or https://wiki.iteadstudio.com/NX4827T043 ) and it says nothing about it. I asked them directly and they just sent me the links... so I am not sure...

I am thinking controlless driving should be a pain so I am checking the controllers (if they use one) before purchasing. Any help greatly appreciated

The Nextion panels are controlled via an ASCII protocol: they are best-suited as Human Interface Devices (HIDs,) not video-displays.
For instance, you can draw a line by sending the ASCII-text :
line 0,0,100,100,RED
... which, according to the user-manual, will draw a red line between the coordinate (0,0) and the coordinate (100,100)
 
Apparently it seems I need at least PIC24... (sigh) Does Pickit3 work with this and PIC32s?

Only if you want to use their software.. You can use pic16's to write to a colour LCD.. All you wont have is a double buffer!!

Most LCD controllers have facility to use SD cards for multi media... Reading from the card directly ..

My advice is to get a cheap 3.2" LCD that you can interface DEAD easy.. **broken link removed** It has all the stuff you need to learn... SSD1289, SD card... 8 bit interface..

Or get a similar with the VERY popular ILI9341 controller... Head to MOTY22's web site and look at his drivers for that screen... Once you get going you'll be able to do all that's needed..
 
Only if you want to use their software.. You can use pic16's to write to a colour LCD.. All you wont have is a double buffer!!

Most LCD controllers have facility to use SD cards for multi media... Reading from the card directly ..

My advice is to get a cheap 3.2" LCD that you can interface DEAD easy.. **broken link removed** It has all the stuff you need to learn... SSD1289, SD card... 8 bit interface..

Or get a similar with the VERY popular ILI9341 controller... Head to MOTY22's web site and look at his drivers for that screen... Once you get going you'll be able to do all that's needed..

Thank you very much for your very helpful post.

I have been reading MOTY project and it seems that using the ILI9341 controller, connecting the MCU to the LCD is very simple. Of course there is nothing to make buttons or widgets like that, and I still have dont understand how it is sending only 61 bytes to put a whole picture....
Also dont understand when he writes : Inputs to the TFT driver are level shifted from 5V to 3.3V by buffers. o_O But it is quite informative. That site seems very helpful thanks!

Edit2: I understood what he meant by the buffer annotation. But if that is necessary I wonder why it is not included in the schematics.

Now I am left with one wondering though: The ILI9341 has very basic commands that deal with putting colors to pixels I guess, so does that mean that for example even if I want to display text, I have to write my own libraries to paint each letter pixel by pixel???
 
Last edited:
Hello again

I am finally considering the first stage of implementation of this project.
I am thinking of getting the following TFT LCD (it is cheap!!)

http://www.wvshare.com/product/3.2inch-320x240-Touch-LCD-C.htm

it uses the ILI9325 and I ll be using a PIC18.

Now I have the following considerations (problems??)

1) First, this LCD requires 16 bits of data!!! So I will be using 16 pins of any MCU I use just for data! that is a lot! , Moreover, there are other pins for enable reset, read and write etc, plus the pins for the Touch Panel SPI interface.... suffice is to say that my old 18F2550 won't make it, will it? :confused: So, I have here in the lab a PIC18F4553... (well actually is a small development board with that, and some leds, switches, crystal etc). Yeah I know I wont use the USB but counting the pins I have available in this , well, I make it by the skin of my teeth! I will use almost all the pins to connect to the LCD and I know the programming will be a little less elegant....

(I know it is not the ideal, because what if my LCD is to control some other unrelated process- say a motor- then there would not be enough pins for that!)

2) Now if you see the above link you will notice it says
Note : this product should work with MCUs with 2.2V~3.6V IO voltage ONLY.
Well, that is a pickcle, :confused: First I was thinking of using something like the 74HC4050 to interface it but again! too many pins! so I am thinking now of powering the PIC with 3.3V instead of 5V as I have always done:eek:... Do you see a problem in this??

I am planning on ordering the LCD on monday so meanwhile, do you see any problem??:arghh:

Thanks a lot for any advice, pointer or comment
 
1) All these TFT's run in 8 bit mode, so There's no problem there..

2) Run the whole system at 3.3v... Buy a pic18LF2550... There will be no conflict that way...
1) You mean there is a way I can set it to use only 8 pins? I ll ask the manufacturer..

2) 18LF2550? You mean a low voltage version? Is there any problem with me using the normal 18F4553 with 3.3V?
 
1) There are 4 pins on all ILI chips... IM[0~3] this allows you to set the interface .. 8, 9, 16 or 18 bit ... Serial or parallel..

upload_2015-10-24_11-6-21.jpeg


2) The specs are a bit weird.... The operating voltage is 2 ~ 5.5v for low frequencies and 3v ~ 5.5v for high frequencies.. But I remember issues with frequencies above 16Mhz when running on 3v... Perhaps the internal OSC doesn't suffer like the external one did with low voltage..

If I was running a TFT I would want to run the micro as fast as I can...
 
PIC18F2550 must be powered by 5V supply when USB is used.
IM0-IM3 are selected by the screen manufacturer and you can't access them because the chip is covered by epoxy. You have to use 16 bits data with a 5 to 3.3v buffer for each input.
 
PIC18F2550 must be powered by 5V supply when USB is used.
Rubbish!! Use a 3v3 convertor... All the pic32's run on 3,3v and almost ALL have a USB connector..
IM0-IM3 are selected by the screen manufacturer and you can't access them because the chip is covered by epoxy. You have to use 16 bits data with a 5 to 3.3v buffer for each input.
The screens I have used have these pins available.... The one in Moty22' tutorials is one of such!!
 
hi KR,
The datasheet for the TFT states that 5V is required for the TFT on pins 1 and 2 , but lower down the d/s it also says the TFT can be powered from 3.3v on pins 33 and 34 , but pins 1 and 2 MUST be left disconnected.
This means the TFT has an onboard 3.3v regulator.
E

upload_2015-10-25_8-20-36.png
 
PIC18F2550 must be powered by 5V supply when USB is used.
IM0-IM3 are selected by the screen manufacturer and you can't access them because the chip is covered by epoxy. You have to use 16 bits data with a 5 to 3.3v buffer for each input.
thanks

what buffer would you recommend if I may ask???
 
PIC18F2550 must be powered by 5V supply when USB is used.

This is untrue... you could power the ILI9325 with the USB 5v and run the pic on the 3v3 that the ILI9325 provides Then there's no need for the buffer!
 
thanks

what buffer would you recommend if I may ask???
If you need DIP IC use the one you mentioned 74HC4050. If you can use SMD select IC with 8 buffers that work at 3V and tolerate 5V at the input.
To my opinion you should start with a 40 pin pic that works at 3V3 , so you don't need buffers, learn how to use the TFT module and after that move on to USB pic. TFT's are great fun.

PIC18F2550 must be powered by 5V supply when USB is used.

This is untrue... you could power the ILI9325 with the USB 5v and run the pic on the 3v3 that the ILI9325 provides Then there's no need for the buffer!

Ian, my friend, what are we missing?
This is from the datasheet:
2.3 Oscillator Settings for USB
When the PIC18F4550 is used for USB connectivity, it
must have either a 6 MHz or 48 MHz clock for USB
operation, depending on whether Low-Speed or
Full-Speed mode is being used. This may require some
forethought in selecting an oscillator frequency and
programming the device.

2550.gif
 
Thank you both!
Ummm I think 18F4553 is not limited to more than 4.2V only for USB functions. I tried a simple LED on and off with 3.3V and even though the documentation of my board said it would work, it didn't . So I guess I must look for low voltage PICs. I dont need the USB functions, but preferabily one that works similarly to the 4553, and has a lot of pins, so any recommendations?
 
I used the pic18f4520 and now the pic18f45k20... It has everything I need ( I run at 5v on this device ) For my small Graphical screen I use a pic18LF26k20 because of the extra code memory and sram... I run this at 3v3 as the small graphical screen also runs at 3v3...
 
I used the pic18f4520 and now the pic18f45k20... It has everything I need ( I run at 5v on this device ) For my small Graphical screen I use a pic18LF26k20 because of the extra code memory and sram... I run this at 3v3 as the small graphical screen also runs at 3v3...
Thank you for your reply.
I have been able to find the PIC18F45K20 in a local store. Same as the one you used..

However this is a 3.3V PIC, isn't it?? At least reading the datasheet , it seems so. I am planning on buying it tomorrow...
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top