SPI Graphics LCD driver

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

SPI Graphics LCD driver

Post by TimB » Mon May 05, 2008 5:21 pm

I have to write to a GLCD over a distance of about 2'. Also do not want to use to many pins on my PLC board so I purchased the SPI driven GLCD board from MIcroE

SF is ideal as I can rewrite the GLCD code to send the pin data directly via SPI to the GLCD expander board.

Now before I embark on it I have to ask has any one else done it yet?

Or if I put up with the lost pins how far can I go with a ribbon cable?

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Tue May 06, 2008 5:26 pm

Hi Tim,
read http://www.sfcompiler.co.uk/forum/viewtopic.php?t=578

I'm in vacations and I do not have access to my computer. I can send you everything once I'll be back at home next monday.
I have a working GLCD lib via MikroE spi module for the KS0108 driver.

ps. I do not have even access to my mails, so I can not answer. I'll be back at home on Sunday by night. Hope it's not too late for you.
TimB wrote:
Or if I put up with the lost pins how far can I go with a ribbon cable?
If you do not use SPI you can use a simple ribbon cable. Personnaly when I worked on the GLCD Module for the KS0108 with three CS pins (module is on the wiki), I used a flat ribbon cable (I reused a PC HDD cable) of about 4" without any pb. I think that with a lower quality cable you can still go up to 2 or 3" if you do not send too much data quickly.

Regards
octal

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Tue May 06, 2008 8:27 pm

Hi Octal

I will wait until Sunday

The data through put is not really great just some text and a graphic that changes on a key input.

Pretty small graphic around 40x40 pixels

As for the ribbon cable I need 1' to 2' which is 12-24 inches, so I doubt it will work.

Its a quick job so I might even get a read made module with pic on board.

CS
Posts: 127
Joined: Thu Nov 02, 2006 9:14 am

Post by CS » Mon May 12, 2008 5:14 pm

Hi TimB,

I have build my own SPI-Driver like the one from MicroE. The distance between the display (incl. the SPI driver) and the main pcb are round about 2m. Works verry well.

Good luck

CS

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

1-wire Serial Graphic LCD

Post by rmteo » Tue May 13, 2008 10:49 pm

Here is a pic of my serial (one-wire) graphic LCD on an EP4 dev board:

Image

It does everything that the on-board graphic LCD will do plus the following:

1. Requires only one port pin (plus 5V and GND connections) instead of 14 pins (use hardware OR software USART).
2. Communicates using RS-232 at 9600-115200 baud (TTL or true RS232 levels).
3. Fully adjustable backlight, 255 brightness levels.
4. Can draw dots, lines, boxes, rectangles, circles, and ellipses.

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Wed May 14, 2008 1:45 am

Any chance you can share a schematic?
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Wed May 14, 2008 2:03 am

It is based on a PIC18F and is laid out on a 1in. x 2in. PCB. There isn't really a whole lot to the schematic - it is mostly in the firmware. The description below should give you a good idea.

Image

Commands are short and simple, eg. to clear the screen requires a single byte. To draw a rectangle, a sequence of 5 bytes is required - the first byte indicates that it is a rectangle, followed by 4 bytes indicating the top left corner (x1,y1) and the bottom right corner (x2,y2). This is about the longest command sequence - all others are 4 bytes or less. Strings (up to 40 characters at a time) are sent out with a single terminating byte. The controller handles line wrapping etc. To set the backlight, a control byte followed by a value of 0-255 will set the backllight brightness from full OFF to full ON. The value of the brightness (plus a few other parameters) is stored in EEPROM so it is retained on power down.

The longest cable I have used is about 2ft. (60cm.). It allows a graphic LCD to be added to just about any MCU application - including 8-pin devices and those with small amounts of FLASH. Great for evaluating compilers and yet have graphics capabilities. :D

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Wed May 14, 2008 2:46 am

I guess a better question would have been...
"How are you controlling the screen brightness on this module?"
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Wed May 14, 2008 2:50 am

I am using the hardware PWM module to switch a BJT (you could also use a MOSFET) to control screen brightness.

TimB
Posts: 262
Joined: Wed Oct 04, 2006 7:25 am
Location: London UK

Post by TimB » Wed May 14, 2008 7:36 am

rmteo

Not heard from octal, so am having to look else were. Are you selling one of those boards. Its just what I want.

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Wed May 14, 2008 2:01 pm

Tim, I do have some quantity available. Do you need just the add-on board or the complete display? PM for details.

Post Reply