PCF8533

Top  Previous  Next

COLOR LCD

Color displays were always relatively expensive. The mobile phone market changed that. And Display3000.com , sorted out how to connect these small nice colorfully displays.

You can buy brand new Color displays from Display3000. MCS Electronics offers the same displays.

There are two different chip sets used. One chip set is from EPSON and the other from Philips. For this reason there are two different libraries. When you select the wrong one it will not work, but you will not damage anything.

LCD-EPSON.LBX need to be used with the EPSON chip set.

LCD-PCF8833.LBX need to be used with the Philips chip set.

 

Config Graphlcd = Color , Controlport = Portc , Cs = 1 , Rs = 0 , Scl = 3 , Sda = 2

Controlport

The port that is used to control the pins. PORTA, PORTB, etc.

CS

The chip select pin of the display screen. Specify the pin number. 1 will mean PORTC.1

RS

The RESET pin of the display

SCL

The clock pin of the display

SDA

The data pin of the display

 

As the color display does not have a built in font, you need to generate the fonts yourself.

You can use the Fonteditor for this task.

 

A number of statements accept a color parameter. See the samples below in bold.

LINE

Line(0 , 0) -(130 , 130) , Blue

LCDAT

Lcdat 100 , 0 , "12345678" , Blue , Yellow

CIRCLE

Circle(30 , 30) , 10 , Blue

PSET

32 , 110 , Black

BOX

Box(10 , 30) -(60 , 100) , Red

 

 

See Also

LCD Graphic converter

 

 

Example

' ------------------------------------------------------------------------------

' The support for this display has been made possible by Peter Küsters from (c) Display3000

' You can buy the displays from Display3000 or MCS Electronics

' ------------------------------------------------------------------------------'

'

$lib "lcd-pcf8833.lbx"                                     'special color display support

 

$regfile = "m88def.dat"                                   'ATMega 8, change if using different processors

$crystal = 8000000                                         '8 MHz

 

'First we define that we use a graphic LCD

Config Graphlcd = Color , Controlport = Portc , Cs = 1 , Rs = 0 , Scl = 3 , Sda = 2

 

'here we define the colors

 

Const Blue = &B00000011   'predefined contants are making programming easier

Const Yellow = &B11111100

Const Red = &B11100000

Const Green = &B00011100

Const Black = &B00000000

Const White = &B11111111

Const Brightgreen = &B00111110

Const Darkgreen = &B00010100

Const Darkred = &B10100000

Const Darkblue = &B00000010

Const Brightblue = &B00011111

Const Orange = &B11111000

 

 

'clear the display

Cls

 

'create a cross

Line(0 , 0) -(130 , 130) , Blue

Line(130 , 0) -(0 , 130) , Red

 

Waitms 1000

 

'show an RLE encoded picture

Showpic 0 , 0 , Plaatje

Showpic 40 , 40 , Plaatje

 

Waitms 1000

 

'select a font

Setfont Color16x16

'and show some text

Lcdat 100 , 0 , "12345678" , Blue , Yellow

 

 

Waitms 1000

Circle(30 , 30) , 10 , Blue

 

Waitms 1000

'make a box

Box(10 , 30) -(60 , 100) , Red

 

'set some pixels

Pset 32 , 110 , Black

Pset 38 , 110 , Black

Pset 35 , 112 , Black

End

 

 

Plaatje:

$bgf "a.bgc"

 

 

$include "color.font"

$include "color16x16.font"