Driving 320x240 LCD on arduino - Page 1
Forum section: electronics / projects

author: amemic
author_rank: Contributor
timestamp: August 17, 2015, 08:58:41 pm
content: Hello!So I got my hands on one of these LCD'sIt is POWERTIP PG320240WRF-CNN LCD, judging by the model number I guess it's 320x240 LCD.By googling I got this datasheet:http://www.scancraftdisplay.se/File/Powertip/PG320240WRF-CNNHS1.pdfBut I haven't found much about has this thing ever been connected to arduino.Pictures are attached, it seems that it has LC79401 driver on it, I know that there are drivers for HD44780 driver, and graphic LCD drivers written for arduino, but, is there anything compatible with this thing? :-)I would like to put it in some good use but I haven't got much experience with driving LCD's so if there is anyone who can help please do reply :-)Thanks! :-)

author: Kintekobo
author_rank: Regular Contributor
timestamp: August 17, 2015, 09:02:44 pm
content: The data sheet states that it is a 4-bit interface so I think that is one of the standard libraries with the Arduino. It's one of the LCD libraries I think.

author: bktemp
author_rank: Super Contributor
timestamp: August 17, 2015, 09:04:56 pm
content: You can not drive this display directly with an arduino, because this LCD has no controller and no memory. The whole image needs to be send at 70Hz to the display.You need a LCD controller like S1D13505 or S1D13700 to connect this display to a microcontroller.

author: Kintekobo
author_rank: Regular Contributor
timestamp: August 17, 2015, 09:07:08 pm
content: Yep, this looks like it should work. It shows the connections for the four data lines. It does seem to be somewhat different with regard to clocking the data in so it may need tweaking. Then again I could be talking through my hat.

author: bktemp
author_rank: Super Contributor
timestamp: August 17, 2015, 09:09:39 pm
content: Quote from: Kintekobo on August 17, 2015, 09:07:08 pmNo, it does not work!HD44780 = character based display controllerLC79401 = shift register

author: Kintekobo
author_rank: Regular Contributor
timestamp: August 17, 2015, 09:11:51 pm
content: is it not the same as the 2-Line LCD displays based on a similar chip set? Seems to be a lot of silicon on that board for it to be so dumb.

author: amemic
author_rank: Contributor
timestamp: August 17, 2015, 09:16:18 pm
content: @bktemp I was thinking that it might be something like that...after checking out the main controller board which contains the "brain" of the entire device, I discovered an epson D1370400A2 chip on it which seems to be driving the thing.@Kintekobo: bktemp I was thinking the same thing, whole bunch of chip brain, but I kinda thought that 16x2 line LCD is not the same thing to drive as this graphic LCD thingy :-)Now the question is, can it be driven in any way on arduino without additional controller or do I have to fiddle with this epson

author: Kintekobo
author_rank: Regular Contributor
timestamp: August 17, 2015, 09:17:26 pm
content: Either way it should be a fun project.

author: amemic
author_rank: Contributor
timestamp: August 17, 2015, 09:20:37 pm
content: Yes, it should, fun and challenging :-)Maybe I could try to send some data to it, but not quite sure how to approach

author: Kintekobo
author_rank: Regular Contributor
timestamp: August 17, 2015, 09:25:01 pm
content: Maybe bktemp can help? He seemed to be up to speed on the chip-set.

author: amemic
author_rank: Contributor
timestamp: August 17, 2015, 09:35:23 pm
content: Hopefully, He is, afterall, coming from the same country as the device that this thing was salvaged fromMaybe there is standalone controller board with EPSON D13700's to buy for cases like this, it would made life a lots easier :-)I'm presuming that the lack of controller requires constant refreshing of the screen, and i suspect taht would cut off quite a large bit of processing power from the arduinoBut it would be quite cool to make use of this thing, honestly I just want to spit out huge amount of text data on this sucker for a PC status monitoringEDIT:Now, I'm thinking, maybe, just, maybe an idea...long time ago I remembered making a PC status LCD from HD44780 16x2 screen connected to parallel port of my pc...maybe it is possible to do similar thing and let the pc do the processing

author: Kintekobo
author_rank: Regular Contributor
timestamp: August 17, 2015, 09:47:57 pm
content: Ah, now you say that it would take a lot of processing power from the Arduino as if that was a bad thing. Considering just how cheap ATMega chips are you can afford to have one dedicated to driving the display. A basic home-brew Arduino can be put together for about $5 but then again you can get an Arduino Mini from China for $2 postage included!

author: amemic
author_rank: Contributor
timestamp: August 17, 2015, 09:51:27 pm
content: Hmm, when You put it that way...it might not be a bad idea...but there is still one thing to consider...well, I haven't had any experience at all with developing an LCD driver :-D

author: Maxlor
author_rank: Frequent Contributor
timestamp: August 18, 2015, 12:15:27 am
content: To make good use of that display, you'll need an MCU that can output parallel data at 5MHz continuously while offering some way to change that data, and that has 9600 Bytes of RAM for a frame buffer. An Arduino UNO doesn't. Even an Arduino Mega doesn't have enough RAM (granted, you could procedurally generate things and thus save RAM... but you'd be limiting yourself.)I'd see it as an opportunity to leave Arduino-land, and maybe try using one of the higher range AVR chips directly. Actually checking the range, there seems to be only one suitable AVR chip, the ATMEGA1284, and you'd be really pushing its capabilities. I don't know, maybe just use a display driver chip suited for that display? Or use a much faster MCU. Doing it in software on an 8-bit MCU seems like masochism to me.

author: amemic
author_rank: Contributor
timestamp: August 18, 2015, 12:34:07 am
content: Yeah, I took some extra googling and reading and came to a similar conclusion...I need a device that will send data to screen at fairly high rate so it could work properly without noticeable lag in refresh...I just didn't know how much power I'd need...It crossed my mind to get some epson controllers off ebay and make separate controller board because salvaging the memory and chip from the original electronics would be fairly fiddly considering the package and the amount of some kind of protective red goo which makes desoldering fairly difficult....So I tried to find anything on ebay without success...what I did found is that you can get 320x240 color lcd for a few bux...which is tempting...but still...i like the size of this screen...it's almost 3" and I can put nice large font on it...Maybe I can get the complete epson controller board for this thing somewhere else besides ebay?

author: dadler
author_rank: Unknown
timestamp: August 18, 2015, 01:16:19 am
content: An arduino due or teensy 3.1/LC can easily drive this display. They are 32bit ARM uCs though.

author: amyk
author_rank: Super Contributor
timestamp: August 18, 2015, 04:40:13 am
content: It depends what exactly you want to display on the LCD, but 5MHz monochrome data is easy compared to this...http://www.linusakesson.net/scene/craft/...colour VGA signaland sounddemo in 8KB of flash and 1KB of RAM on an AVR at 20MHz.Maybe you could make a game, start with something simple like Pong or Tetris...

author: bktemp
author_rank: Super Contributor
timestamp: August 18, 2015, 05:48:35 am
content: Quote from: Maxlor on August 18, 2015, 12:15:27 amIt has be done using a ATmega8515 with external SRAM, but modern microcontrollers have enough RAM internally. Using DMA it is easy to implement a LCD controller, because DMA does all the high speed data transfers in the background. Using a PIC32 it is really easy because the parallel master port generates the clock signals for shifting out the data into the LCD. DMA transfers the data from SRAM to the PMP. All you have to do is setup the DMA each line and generate a few timing signals. Microchip has an application note and software driving 320x240 TFT LCDs using PIC32 + DMA.

author: amemic
author_rank: Contributor
timestamp: August 18, 2015, 09:16:49 am
content: @amyk: wel that is fairly cool stuff. but I was thinkin ond displaing just some text info, like temperatures, humidity, maybe some wind speed, stuff like that :-)@bktemp: Interestingly, I do have one ATMega8515 in my stock, I bought it for a project which I scrapped later and this thing is standing in my drawer for a few years now

author: Rolo
author_rank: Regular Contributor
timestamp: August 18, 2015, 10:51:19 am
content: An Uno can address flash as ram using progmem and clock SPI up to 8 Mhz so should be possible. I used similair approach in controlling a led matrix board.

author: bktemp
author_rank: Super Contributor
timestamp: August 18, 2015, 11:17:22 am
content: SPI is only 1bit, but this LCD needs 4bits in parallel.It works with ATmega8515, because it has a 8bit bus interface similar to the PMP found on PIC32.Here you can find the project (it is in German, but you can use the google translator):https://www.mikrocontroller.net/articles/Grafikf%C3%A4higer_LCD_Controller_f%C3%BCr_320x240_LCD_mit_8_Graustufen

author: amemic
author_rank: Contributor
timestamp: August 18, 2015, 01:11:13 pm
content: @bktemp: that is a really interesting project, I kinda like itIn conclusion, I think that I need quite a big rfresh of my internal RAM, seeing how much I have forgotten about these things...and then I can start thinking about hooking up something goodThis really looks like a challenge to do, and I do like challenges, but I'll have to get some literature for research first

author: eilize
author_rank: Contributor
timestamp: August 19, 2015, 03:05:04 pm
content: how do you find the "5Mhz"?i meanCL1 =59.5µsCL2=CL1/80on each falling edge of CL2, D0,D1,D2,D3 must be valid(D0..D3 on the same port)so you need 1.34Mhzi forget something?

author: Maxlor
author_rank: Frequent Contributor
timestamp: August 19, 2015, 04:50:27 pm
content: You are correct, seems I forgot to factor in the fact that 4 bits are transmitted per clock cycle.

author: eilize
author_rank: Contributor
timestamp: August 19, 2015, 11:10:44 pm
content: but you need always lot of ramlet's say you take 4x4 pixel per character, you can encode it on 2 byte (and usind a mosfet to reduce the number of instruction...don't want to rotate the byte 4 time)let's say 32char->64bytesyou need (320*240)/16 = 4800byte to describe the value of the character on this 4x4squaretotal 4864byteif you use 8x8pixel per char,you need 8byte per character32char->256byte(320*240)/(16*4) =1200total 1456 bytelot of work when you know there are lcd with controller ^^