SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By silic0re
#28603
Hi there,

I've been looking for a ~2.7-3.0" colour LCD display that could be interfaced to a small microcontroller like a dsPIC, and happened to have a couple of ACX705AK's that I figured I'd give a try. These are 2.7" 240x160 512 colour displays that accept 9-bit colour data (RGB) and some other input through a tiny 22-pin connector. (You can see these displays at http://www.goldmine-elec-products.com/p ... ber=G13752. Datasheet: http://www.datasheets.org.uk/pdf/acx705 ... sheet.html ).

It looks like a few people have seen these over the years and tried to interface them to a few things, and successful attempts have been made for the gumstix: http://docwiki.gumstix.org/Display#Sett ... on_gumstix, AVR: http://www.circuitcellar.com/avr2004/grand.html, and there's been some interest in using this on a Basic Stamp or other host of simpler microcontrollers (such as a PIC) over the past few years on the Parallax forums. EarthLCD also makes an easy to use controller board for these displays: http://store.earthlcd.com/LCD, but it's rather pricey.

Over the past couple of days I set out to try and drive the display using a dsPIC30F3012, with the dsPIC's pins connected to the displays: MCLK, HSYNC, VSYNC, and one pin to each of the three colour pins (red 0-2, green 0-2, blue 0-2), for a total of six wires. At best, this sort of thing would let you display 8 colours, but for testing I thought I'd be okay.

I whipped up a simple program in C for the dsPIC that would generate a clock pulse on the MCLK line, and every 240 or so MCLK pulses generate a HSYNC, as well as a VSYNC every 180 or so HSYNC pulses (as specified in the timing diagrams of the data sheet). The pixel data lines (RGB) also had a counting pattern going through them (000, 001, 010, 011, etc) to send some simple pattern to display on the screen.

The dsPIC was fed with a 20mhz crystal oscillator, and I ran it in 8x mode. The maximum clock rate of the display is 4.20mhz, but since the clock was being generated in code between IF statements and such things, the clock rate from the dsPIC to the display (MCLK) ended up looking about 1mhz when I checked it out with a scope.

I wasn't able to get any data displayed on the screen, and so I pulled all of the pixel data pins (RGB) high to try and go for a white pattern, and concentrate on having the dsPIC generate clock/sync pulses. This didn't seem to work out either. I checked all the voltages going into the display (3.0v (logic), 3.8v (DC->DC converter), 6.5v (frontlight)), and they looked pretty good. I built the thing on a solderless breadboard, so I checked the pins at the display for noise, and it looked okay, though I did notice that the MCLK period would varry a little bit, probably due to entering and exciting comparison statements for the HSYNC and VSYNC pulses. I also noticed that sometimes there were issues with programming the dsPIC, it might take a few times to get the program in and verified, which likely was also due to noise.

I also placed LED's on most of the data lines (MCLK, HSYNC, VSYNC, and the 'blue' pixel data line) to make sure data was being transfered and the dsPIC was running okay -- and that turned out to look good). Overall it looked like a VSYNC was generated about 5 times per second, which would mean the display was running at about 5fps (a little slow, but the datasheet doesn't happen to mention a lower clock limit).

Any thoughts? Has anyone else used one of these displays, and had luck or issues? Is it increadably particular about the clock periods, or should I perhaps be using an external crystal (~4mhz) to drive everything?

On that line of thoughts, has anyone come across a colour display out there (~2.7-3.0") that is particularly easy to interface with a microcontroller?

thanks for any help,
silic0re
By jasonharper
#28608
Do you have the display's S/D line pulled high (or better yet, connected to a PIC pin so that you can implement the proper power-up/power-down sequences)? That looks to be a fairly critical detail, and I don't see it mentioned in your message...
By silic0re
#28609
Oops, it looks like I forgot to mention the shutdown line while I was recalling everything, and it is of course a critical detail. I have S/D pulled up, but not by the dsPIC -- it's just always pulled up. I've also tried waiting a time after the power has been on, then pulling up S/D manually, without results.

thanks,
silic0re
By Philba
#28617
I've looked at that display several times but thought the 9 bits of color to be unwieldy. doesn't fit cleanly in a byte and so on.

From page 6 of the datasheet, you seem to be violating the power up sequence by tying s/d high. It shows sd (and mck, hsync, vsync) being low for some period after power up. also, it shows s/d being low for 1 field's worth of mck, vsync, hsync being active. I don't know why they say that but I would heed the datasheet. at first, anyway...

secondly, I would take care to validate the timing of mck, vsync and hsync. pages 9 and 10. a logic analyzer would be a useful tool here but in a pinch you could do it with a dual trace Oscope.
By silic0re
#28657
Thanks Philba, that's probably wise advice. In my naivety I thought the powerup sequence wasn't too important, but it seems as though the display controller may be very interested in seeing exactly what's described in the datasheet.

Do you think by 'one field' of MCLK, HSYNC, VSYNC, and DATA (before S/D is to be pulled high), it essentially means one full screen of data?

I just checked the AVR code out that I mentioned earlier, and it does appear as though it sends one entire frame of data before pulling S/D high. It also looks as though it stops and starts MCLK from time to time, which may also act partially to conform to the power-up sequence. As an aside, it looks like the author has commented out some some code to pull S/D high right at the beginning of their code -- looks like I'm not the only person to make some assumptions about simply pulling S/D high too early :)

Also, if you had any misgivings about the 9-bit data, you could always pull the LSB of one colour low to make things store neatly in 8-bits? Or use a palette of, say, 256 9-bit colours, and use each bit to reference a given colour.

thanks
silic0re
By Philba
#28696
My quick read of the DS didn't enlighten me on what a "frame" was.

I'm not sue how you would do a palette and get decent colors. The problem with 9 bits is a pixel doesn't fix cleanly into a byte. Manipulations like bitblt and such would be inefficient. If the PIC had more horsepower, it might be ok.

still, the display *is* cheap.
By rewguy
#29187
I have owned this LCD for a couple years, and by coincidence, I just tried to get it working a couple hours ago. I did basically exactly what you did, and it works fine for me. It seems unresponsiive, however, to the LED pins. I haven't been putting 6.5V on them, but I worked my way up from 3V with a small resistor to 5V without an resistor and there is no change at all.

I did not need to issue a reset. My setup is in no way free of noise. Check your code. Maybe you just have a bad LCD?

[edit] As for the 9 bit issue, I tied the LSB of blue to the middle bit of blue, and it seems to work ok.
By silic0re
#29203
Thanks rewguy, I actually found my problem out last weekend -- the 3.8v on my breakout board for the connector was connected to nothing!! (or, more acurately, it was connected to the pin beside where it was supposed to be connected) :oops:

The key for finding the LED voltage was looking at the 15ma typical rating the datasheet notes. For me, this appears to happen around 6.5 volts. After 6.5, the current goes up pretty quickly, and the display gets really bright -- but this is likely at the expense of the LED's lifecycle.

Out of curiosity, which microcontroller did you get connected to the display? It looks like we're having some success!
By rewguy
#29236
I was using the AVR ATMega32L running at 3V. How did you generate 6.5V? A variable voltage regulator?
By silic0re
#29263
I actually ran the whole board off 12V, which fed into three voltage regulators: one for 3.0v, one for 3.8v, and one for 6.5v. There was actually another trim-pot going off the 3.8v to bring it down to 3.3v for the crystal oscillator, which didn't appear to be stable below 3.3v.

It's kind of funny, most of the board is just voltage regulators and sockets! :)