Siemens A55/C55 LCD graphics display

westaust55

Moderator
I was contemplating going the same path as others and buying a Nokia 3310 LCD display but may take a right turn and try something different.

Have found out that our IT department have a collection of failed phones they keep for spare parts and will see if I can scrounge some alternate LCD screens from there if IT prepared to release one. Seemingly all Nokia’s in a couple of different models. Just need to catch up with the right man who is currently on holidays.

I also have an old Siemens A55 mobile phone that may be sacrificed to the cause as an alternative.

The Siemens A55/C55 LCD module is amber coloured (seems some may also be blue) and the graphics type with a 101 x 64 pixel resolution so about 50% more pixels than the 3310 module. Have tracked down the full schematics, Siemens Level 2 and 2.5 maintenance/disassembly instructions, etc, for the A55.
Found a couple of circuits showing ways of interfacing from a 5Vdc controller to the 2.9V LCD.

The A55/C55 display has the same interface as the 3310 and operates of 2.9V as opposed to 3.3V.

The one area where I have not located much information is on control codes. There is a video on U-Tube where one is connected to a PC displaying a short video clip. (have copies down some numbers of the PC screen from the video clip :) )

May be a case of trying the same codes as the 3310 LCD in the first instance and play from there.

If anyone else has some information on control codes that would be appreciated.
Or, if anyone else is interested in the data I have collected I can post some of this onto the forum.
 

westaust55

Moderator
Thanks Hippy.

will still be continuing to search for information.

Edit:
That Siemens A55/C55 initialisation code is very similar to the Nokia 3310 initialisation.
 
Last edited:

westaust55

Moderator
Hi Texy,

No had not tried to contact the (Italian) guy with the U-Tube video.
Seemed to be no response to comments left by 3 or 4 others at the time the video was uploaded 12 months ago.

Extra info section with the video gave a link to a website (Electronic Paradise) with little extra over and above what I have found elsewhere. He seems to be promoting a piece of software called LCDream Lab.

The referenced website is the only place I can even find LCDream Lab mentioned. Some timing diagrams on the Electronic Paradise website are in fact taken directly from the datasheet of a microprocessor that includes a “Super LCD controller” – nothing to do with the actual Siemens A55/C55 LCD module. The schematics on the Electronic Paradise website are generic and happen to come from a website for LCDInfo which was concentrating on the Nokia 3310 display and slowing covered a few more LCD models as well.

The link that Hippy gave with some initialisation details may prove to be far more useful.
 

westaust55

Moderator
PICAXE top LCD module interfacing

One item that I have picked up along the way which search for information on the Siemens A55/C55 LCD module is a method of interfacing from a 5V controller to a 2.9V to 3.3V LCD module.

The circuit uses a 74HC245 octal bus transceiver (available from Jaycar ZC4870) and will operated with Vcc down to 2.0V . Powering the LCD module and the 74HC245 from a 3.3V or 3V supply uses the 74HC245 as a ~4.5/5.0V to ~3V level converter for the data/control signals.

The pinout of the 74HC245 is also good with the 8 pins for one side (bus A) all in a row down one side of the 20 pin IC and the 8 pins for the second side (bus B) all in a row down the other side. Makes it very easy to physically wire up.

Beware that the Electronic Paradise website mentioned in my post above make reference to a 7445 which is a BCD to decimal decoder and not the right IC.

EDIT:
UPDATE the interface IC should be a 74LVC245 - this can operate from 3.0 or 3.3V and has 5V tolerant inputs.
If the 74HC245 is used, the 3V supply line will rise to 5V when a PICAXE input is turned ON.
 

Attachments

Last edited:

westaust55

Moderator
An update on findings today.

The Philips PCF8812 LCD driver/controller chips is looking like a good candidate for that possibly used with the Siemens A55/C55 LCD 101 x 64 pixel modules.

Some thoughts:

1. The PCF8812 datasheet was issued in Nov 2000 and the Siemens A55 was released early 2003. By comparison, the PCD8544 datasheet was published in April 1999 and the Nokia 3310 was released in 2000 so time frame roughly similar.

2. The PCF8812 has an added control (compared to the 3310) for HV voltage generation multiplier. The value given in the link Hippy found is $09 which relates to a multiplier of 3 according to the PCF8812 datasheet.

3. The controller is capable of 102 x 65 pixels. This is configures as 8 banks of 8 pixel rows =64 lines of pixels then the 65th row is a bit of an add-on in the address matrix scheme (so likely skipped for mobile phones for ease/faster ops).
The 65th pixel row uses only the lsb from each of 102 full bytes so a lot of wasted memory if using look-up tables (maybe not so bad if using the calculation methods as I often do but lot of effort for 1 extra row of pixels).

4. Now for the columns they are 0 to 101. Maybe this is where the spec of 101 pixels comes in within specs for the display.

However, the Bias system values sent from microcontroller (ie PICAXE) however seem a bit out of place is examples found todate.
One source uses $13 which gives n= 4 and Mux rate of 1:48 (same as the Nokia 3310 LCD).
Another source uses $16 and indicates n=2, which from the PCF8812 datasheet $16 gives n=1 and Mux rate of 1:18 or 1:16. But the datasheet indicates the Mux rate should be 1:65 and n=5 suggesting the value to be sent would be $12.
So clearly some testing will be necessary here.

One key observation is that the PCF8812 has the msb of each byte representing the top pixel in each bank, whereas the PCD8544 (for Nokia 3310) has the lsb of each byte representing the top pixel in each bank. Therefore a complete rewrite of any tables for fonts is required.

Not sure when I will get to the hardware hacking stage as also rather busy on weekends for the time being. Maybe slow progress on that front. Plus waiting to see what old Nokia models our IT has and if they may release one to me.

EDIT:
and just as I was giving it away for the night I found this on another Russian website:
Siemens C55/A55/A52
controller pcf8812
http://rifer.ucoz.ru/publ/1-1-0-20


Translated webpage:
http://209.85.171.104/translate_c?hl=en&sl=ru&u=http://rifer.ucoz.ru/publ/1-1-0-20&prev=/search?q=PCF8812+Siemens&hl=en&usg=ALkJrhimHJJKobErpuCL1PK2PtkXZ30gew

with a photo showing one in operation
 

Attachments

Last edited:

westaust55

Moderator
A status update and a query relating to use of LCD module from mobile phones.

I placed an order for a 3V regulator and a 74HC245 (along with other items for future use) with Futurlec last Monday but the order “got lost” and had to be re-ordered last Friday. Now have a confirmation back from Futurlec that the parts have been dispatched.

In the meantime, I have dismantled the Siemens A55 and removed the LCD module. Have found another complete working A55 mobile for a couple of dollars in Queensland so that is on the way to me and should have it in a week.

Last night I soldered an 8-core cable to the contacts at the rear bottom of the display. While it was easy to tin the contacts with solder, I found it rather difficult to get the wired to bond and the close proximity was getting too close for these eyes.

Eventually I decided to bend each alternate spring contact over through about 120 degrees towards the top of the display. That gave me double the space between the contacts. Having done that, it proved to be easier to achieve a soldered joint between the wire and the contacts.

I would be interested to know for future endeavours how others got on soldering wires to the spring contacts of the LCD modules from mobile phones.
Any comments/suggestions from those who have been down this path on how to make these connections more easily?

For me, it’s now a case of awaiting arrive of the parts from Futurlec to construct a module for 5V to 3V power and signal interface.
 

Attachments

Last edited:

westaust55

Moderator
Siemens A55 mobile LCD in operation

Hi all,

well good news this evening here in the West of Aust.

The parts (LDO 3V regulator and 74HC245) arrived from Futurlec, so I whipped up a small adapter board to interface my PICAXE to the Siemens A55 LCD module.

After ordering did realise that the 74LCV245 would have been the right IC as it is 5V input tolerant when powered from 3Vdc so added some resistor dividers (4.7kOhm / 6.8 kOhm) on the inputs. tested the adapter, and all well.

Plugged in the A55 LCD module and with a minor tweak to the Nokia 3310 program from eclectic's thread and its voila !

a working 101 x 64 LCD display from the Siemens A55 mobile.

I do not have my SLR camera with me at the moment for a good quality pic, but here is a fuzzy pic from my old Nokia mobile.
The text is very clear in reality - its just the mobile's camera

A couple of thing to sort out/review:
1. The text is upside down (relative to the orientation of the LCD in the mobile) :confused:
2. datasheet suggested I would need to invert the bits for charcters but didn't do so and they came out the right way :confused:

But the key point for now is that is is working :D :D
 

Attachments

Last edited:

westaust55

Moderator
Okay a bit more experimenting this evening.

I have tried various initialisation parameters and found some sequences posted elsewhere do not function properly.
Using the code from eclectics thread for the Nokia 3310 as a starting point, below is what I have running successfully so far with the Siemens A55 LCD module.

Have not tried to optimise yet so that the controls and logic are clear.

A couple of points:
1. the percent symbol in the eclectic / texy code is back to front - fixed here
2. I have set up a pseudo proportional width font so narrow characters only use 3 pixel width instead of 5 and a space only used 4 pixel width.
3. every character (except a space) has a following 1 pixel with separator for better clarity.

With the pseudo proportional width as defined above, font I can get 18 characters per line

A slightly better photo attached (I really do have to get my SLR camera for this)

NOTE: The SHIFTOUT command I use is only currently applicable to the 28X1 and 40X1.


Code:
; Siemens A55 mobile 102 x 65 pixel LCD driver


SYMBOL SCLK    = 3 'PICAXE out 3 TO Display pin 2
SYMBOL SDA     = 4 'PICAXE out 4 TO Display pin 3
SYMBOL DC      = 5 'PICAXE out 5 TO Display pin 4
SYMBOL CS      = 6 'PICAXE out 6 TO Display pin 5
SYMBOL RES     = 7 'PICAXE out 7 TO Display pin 8
SYMBOL value   = b0
SYMBOL width   = b1
SYMBOL pointer = b2
SYMBOL X       = b3
SYMBOL Y       = b4
SYMBOL eeprom_addr = b5
SYMBOL Loop1   = b10
SYMBOL loop3   = b12

Main:
        PAUSE   2000 
        SETFREQ m8

        GOSUB InitLCD


        FOR pointer = 0 TO 18
          LOOKUP pointer,("* HI PICAXE FORUM * "),value
          GOSUB ValueToLCD
        NEXT

        X=0
        Y=2
        GOSUB GotoXY

        FOR pointer = 0 TO 18
          LookUp pointer,("102 X 65 PIXEL LCD "),value
          GOSUB ValueToLCD
        NEXT

        X=0
        Y=3
        GOSUB GotoXY

        FOR pointer = 0 TO 18
          LookUp pointer,("FROM A SIEMENS A55 "),value
          GOSUB ValueToLCD
        NEXT

        X=0
        Y=4
        GOSUB GotoXY

        FOR pointer = 0 TO 18
          LookUp pointer,("MOBILE PHONE       "),value
          GOSUB ValueToLCD
        NEXT

        X=0
        Y=5
        GOSUB GotoXY

        FOR pointer = 0 TO 18
          LookUp pointer,("WIK!#$%&'()*+,-./W "),value
          GOSUB ValueToLCD
        NEXT

        X=0
        Y=6
        GOSUB GotoXY

        FOR pointer = 0 TO 18
          LookUp pointer,("& MATHS GENERATED  "), value
          GOSUB ValueToLCD
        NEXT

        X=0
        Y=7
        GOSUB GotoXY

        FOR pointer = 0 TO 18
          LookUp pointer,("GRAPHICS NEXT .... "), value
          GOSUB ValueToLCD
        NEXT

        PAUSE 5000
        GOSUB Invert
        PAUSE 5000
        GOSUB Normal

        SETFREQ m4
        STOP
        END
;=====================================================================
; SUBROUTINES
;---------------------------------------------------------------------
InitLCD:
        LOW SCLK
        LOW SDA
        LOW DC
        LOW CS
        LOW RES
        PAUSE 50
        HIGH RES
        HIGH CS

        Value=$21          ; $21 ==> H=1 and function set = chip active, horiz addressing & extended instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$08          ; Set HV multiplier = x 2.                  For $09 = x3 set Vop at ~$C6 otherwise gives black screen
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$F0          ; set Vop with (PRS = 0 Vlcd = 2.94V TO 6.75V)     If HV multiplier = $08 then use ~$C6
                                ; $E0=5.28V, $F0=6.3V, $FF = 6.72V  NOTE max allowed is 9V
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$16          ; set bias: $16 ==> n=1 FOR mux rate 1:18 or 1:16 NOTE: n = 2 and n=5 DO NOT work
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$06          ; set temperature coefficient = 2
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$20          ; $20 ==> H=0 and function set = FOR basic instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$0C          ; display config =  display non-inverted
        GOSUB CommandToLCD ; transmit To serial LCD module

        GOSUB GoToHome
        GOSUB ClearFast
        GOSUB GoToHome
        GOSUB Normal
 
        RETURN
;---------------------------------------------------- 
Invert:
        Value = 13        ; invert the display light chars on dark background
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
Normal:
        Value = 12
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
GoToHome:
        X = 0
        Y = 0
GotoXY:
        Value = X + 128     ; 128 part = X address command 
        GOSUB CommandToLCD
        Value = Y + 64      ;  64 part = Y address command
        GOSUB CommandToLCD
        RETURN
;----------------------------------------------------

CommandToLCD:
        LOW DC    ; Command mode
        LOW CS
        SHIFTOUT SCLK, SDA,1,(value)
        HIGH CS
        RETURN
;
;----------------------------------------------------
ValueToLCD:
        eeprom_addr=0
        IF Value>32 and Value <58 then
          eeprom_addr=Value-33
          eeprom_addr=eeprom_addr*5+130
        ELSEIF Value>64 and Value <91 then
          eeprom_addr=Value-65
          eeprom_addr=eeprom_addr*5
        ELSEIF Value=32 then
          Value = 0
          GOSUB DataToLCD
          GOSUB DataToLCD
          GOSUB DataToLCD
          GOSUB DataToLCD
        ENDIF
        IF Value=0 then
          RETURN
        ENDIF
        width = 4
        read eeprom_addr, Value
        IF value = 0 then ; found a narrow character
           width = 2
           inc eeprom_addr
        ENDIF
        FOR Loop1 = 0 TO width
          read eeprom_addr, Value
          inc eeprom_addr
          GOSUB DataToLCD
        NEXT Loop1
        value = 0
        GOSUB DataToLCD ; put a 1 bit space after each character for clarity
BaleOut: RETURN
;----------------------------------------------------
DataToLCD:
        HIGH DC 'Write data mode
        LOW CS
        SHIFTOUT SCLK, SDA,1,(value)
        HIGH CS
        RETURN
;----------------------------------------------------
ClearFast:
        GOSUB GoToHome
        LOW SDA
        HIGH DC ; Write data mode
        LOW CS
        FOR Loop1 = 0 TO 101 ; 102 pixels wide
          FOR loop3 = 0 TO 8   ' 9 banks high
            SHIFTOUT SCLK, SDA,1,(0) ; output 0 TO clear screen
          NEXT loop3
        NEXT Loop1
        GOSUB GoToHome
        RETURN

;----------------------------------------------------
eeprom 0,(0x7E, 0x11, 0x11, 0x11, 0x7E) ;A
eeprom (0x7F, 0x49, 0x49, 0x49, 0x36) ; B
eeprom (0x3E, 0x41, 0x41, 0x41, 0x22) ; C
eeprom (0x7F, 0x41, 0x41, 0x22, 0x1C) ; D
eeprom (0x7F, 0x49, 0x49, 0x49, 0x41) ; E
eeprom (0x7F, 0x09, 0x09, 0x09, 0x01) ; F
eeprom (0x3E, 0x41, 0x49, 0x49, 0x7A) ; G
eeprom (0x7F, 0x08, 0x08, 0x08, 0x7F) ; H
eeprom (0x00, 0x41, 0x7F, 0x41, 0x00) ; I
eeprom (0x20, 0x40, 0x41, 0x3F, 0x01) ; J
eeprom (0x7F, 0x08, 0x14, 0x22, 0x41) ; K
eeprom (0x7F, 0x40, 0x40, 0x40, 0x40) ; L
eeprom (0x7F, 0x02, 0x0C, 0x02, 0x7F) ; M
eeprom (0x7F, 0x04, 0x08, 0x10, 0x7F) ; N
eeprom (0x3E, 0x41, 0x41, 0x41, 0x3E) ; O
eeprom (0x7F, 0x09, 0x09, 0x09, 0x06) ; P
eeprom (0x3E, 0x41, 0x51, 0x21, 0x5E) ; Q
eeprom (0x7F, 0x09, 0x19, 0x29, 0x46) ; R
eeprom (0x46, 0x49, 0x49, 0x49, 0x31) ; S
eeprom (0x01, 0x01, 0x7F, 0x01, 0x01) ; T
eeprom (0x3F, 0x40, 0x40, 0x40, 0x3F) ; U
eeprom (0x1F, 0x20, 0x40, 0x20, 0x1F) ; V
eeprom (0x3F, 0x40, 0x38, 0x40, 0x3F) ; W
eeprom (0x63, 0x14, 0x08, 0x14, 0x63) ; X
eeprom (0x07, 0x08, 0x70, 0x08, 0x07) ; Y
eeprom (0x61, 0x51, 0x49, 0x45, 0x43) ; Z
eeprom (0x00, 0x00, 0x2f, 0x00, 0x00) ; !
eeprom (0x00, 0x07, 0x00, 0x07, 0x00) ; "
eeprom (0x14, 0x7f, 0x14, 0x7f, 0x14) ; #
eeprom (0x24, 0x2a, 0x7f, 0x2a, 0x12) ; $
eeprom (0x23, 0x13, 0x08, 0x64, 0x62) ; %  - THIS HAS BEEN FIXED HERE was back to front and too low
eeprom (0x36, 0x49, 0x55, 0x22, 0x50) ; &
eeprom (0x00, 0x05, 0x03, 0x00, 0x00) ; '
eeprom (0x00, 0x1c, 0x22, 0x41, 0x00) ; (
eeprom (0x00, 0x41, 0x22, 0x1c, 0x00) ; )
eeprom (0x14, 0x08, 0x3E, 0x08, 0x14) ; *
eeprom (0x08, 0x08, 0x3E, 0x08, 0x08) ; +
eeprom (0x00, 0x00, 0x50, 0x30, 0x00) ; ,
eeprom (0x08, 0x08, 0x08, 0x08, 0x08) ; -  - raised 1 pixel (looks better)
eeprom (0x00, 0x60, 0x60, 0x00, 0x00) ; .
eeprom (0x20, 0x10, 0x08, 0x04, 0x02) ; /
eeprom (0x3E, 0x51, 0x49, 0x45, 0x3E) ; 0
eeprom (0x00, 0x42, 0x7F, 0x40, 0x00) ; 1
eeprom (0x42, 0x61, 0x51, 0x49, 0x46) ; 2
eeprom (0x21, 0x41, 0x45, 0x4B, 0x31) ; 3
eeprom (0x18, 0x14, 0x12, 0x7F, 0x10) ; 4
eeprom (0x27, 0x45, 0x45, 0x45, 0x39) ; 5
eeprom (0x3C, 0x4A, 0x49, 0x49, 0x30) ; 6
eeprom (0x01, 0x71, 0x09, 0x05, 0x03) ; 7
eeprom (0x36, 0x49, 0x49, 0x49, 0x36) ; 8
eeprom (0x06, 0x49, 0x49, 0x29, 0x1E) ; 9
 

Attachments

Last edited:

westaust55

Moderator
The second Siemens A55 mobile I found complete and working in Queensland arrived today so now I have a spare LCD display.

Previously I suggested there was/maybe an issue with orientation of the Siemens A55 LCD display

A couple of thing to sort out/review:
1. The text is upside down (relative to the orientation of the LCD in the mobile)
2. datasheet suggested I would need to invert the bits for charcters but didn't do so and they came out the right way
But this evening, after more research, have found a diagram clearly indicating that the origin is at the bottom right when the LCD is displayed as if in the mobile phone.

So basically the LCD is mounted upside down in the phone when compared with the Nokia 3310. The solution is therefore to just mount the LCD so the origin is at the top left. :)

Also found this snippet (from Russian website):
When programming should note that pixels on this display are not strictly square, with different step on the X and Y. The ratio X / Y is ~19/20, thus drawing in circles, is slightly oval.
 

Attachments

Last edited:

westaust55

Moderator
96 Character Set font for 5 x 7 with tails into 8th row

Noted that the code on eclectic&#8217;s thread for the Nokia 3310 LCD has been limited to 51 characters. (In the non-optimised version, the space as 52nd char was handled by code within the program) so that it will fit within the PICAXE on-board EEPROM.

I have intentions of permanently saving the code in a 24LC256 EEPROM where I already keep the character codes relating to my 48-key keypad.
This will just fit in a 512 byte area of the external EEPROM after allowing for 64 byte page boundaries.
Obviously having extended beyond 256 bytes, I will now need to use a word variable for the EEPROM address pointer.

The data is based on a full 5 pixel width for all characters but my program is automaticlaly strip narrow characters back to 3 pixels wide.

Below is the data that I have created) towards a full font set. I have left the EEPROM directive at front of each line for ease of use by others to extract any subset they may desire.

Some variations from &#8220;standard&#8221; include:
1. Moving the greater than (>) symbol one pixel left so not caught by narrow character set handling for pseudo proportional character widths (3 pixel versus 5 pixel character widths).

2. Space is now a character defined in the font set and by default of the program will appear as a narrow character (see as 3 pixels wide + the 1 pixel character separator)

3. Implement a back slash character (instead of Japanese character between the square brackets)
4. lower case i has top dropped one pixel
5. lower case g, j p, q and y are modified &#8211; &#8220;g&#8221; has entire char dropped 1 pixel and others have the tails extended down one pixel below the base line.

6. altered the character data sequence to be the same order as the ASCII character set for ease of referencing (less maths involved)

Code:
eeprom (0x00, 0x00, 0x00, 0x00, 0x00) ; Sp -new
eeprom (0x00, 0x00, 0x2f, 0x00, 0x00) ; !
eeprom (0x00, 0x07, 0x00, 0x07, 0x00) ; "
eeprom (0x14, 0x7f, 0x14, 0x7f, 0x14) ; #
eeprom (0x24, 0x2a, 0x7f, 0x2a, 0x12) ; $
eeprom (0x23, 0x13, 0x08, 0x64, 0x62) ; %  - THIS HAS BEEN FIXED HERE was back to front and too low
eeprom (0x36, 0x49, 0x55, 0x22, 0x50) ; &
eeprom (0x00, 0x05, 0x03, 0x00, 0x00) ; '   (Apostrophe)
eeprom (0x00, 0x1c, 0x22, 0x41, 0x00) ; (
eeprom (0x00, 0x41, 0x22, 0x1c, 0x00) ; )
eeprom (0x14, 0x08, 0x3E, 0x08, 0x14) ; *
eeprom (0x08, 0x08, 0x3E, 0x08, 0x08) ; +
eeprom (0x00, 0x00, 0x50, 0x30, 0x00) ; ,
eeprom (0x08, 0x08, 0x08, 0x08, 0x08) ; -  - raised 1 pixel (looks better)
eeprom (0x00, 0x60, 0x60, 0x00, 0x00) ; .
eeprom (0x20, 0x10, 0x08, 0x04, 0x02) ; /
eeprom (0x3E, 0x51, 0x49, 0x45, 0x3E) ; 0
eeprom (0x00, 0x42, 0x7F, 0x40, 0x00) ; 1
eeprom (0x42, 0x61, 0x51, 0x49, 0x46) ; 2
eeprom (0x21, 0x41, 0x45, 0x4B, 0x31) ; 3
eeprom (0x18, 0x14, 0x12, 0x7F, 0x10) ; 4
eeprom (0x27, 0x45, 0x45, 0x45, 0x39) ; 5
eeprom (0x3C, 0x4A, 0x49, 0x49, 0x30) ; 6
eeprom (0x01, 0x71, 0x09, 0x05, 0x03) ; 7
eeprom (0x36, 0x49, 0x49, 0x49, 0x36) ; 8
eeprom (0x06, 0x49, 0x49, 0x29, 0x1E) ; 9

eeprom (0x00, 0x36, 0x36, 0x00, 0x00) ; : -new
eeprom (0x00, 0x56, 0x36, 0x00, 0x00) ; ; -new
eeprom (0x08, 0x14, 0x22, 0x41, 0x00) ; < -new
eeprom (0x14, 0x14, 0x14, 0x14, 0x14) ; = -new
eeprom (0x41, 0x22, 0x14, 0x08, 0x00) ; > -new
eeprom (0x02, 0x01, 0x51, 0x09, 0x06) ; ? -new
eeprom (0x32, 0x49, 0x79, 0x41, 0x3E) ; @ -new 

eeprom (0x7E, 0x11, 0x11, 0x11, 0x7E) ; A
eeprom (0x7F, 0x49, 0x49, 0x49, 0x36) ; B
eeprom (0x3E, 0x41, 0x41, 0x41, 0x22) ; C
eeprom (0x7F, 0x41, 0x41, 0x22, 0x1C) ; D
eeprom (0x7F, 0x49, 0x49, 0x49, 0x41) ; E
eeprom (0x7F, 0x09, 0x09, 0x09, 0x01) ; F
eeprom (0x3E, 0x41, 0x49, 0x49, 0x7A) ; G
eeprom (0x7F, 0x08, 0x08, 0x08, 0x7F) ; H
eeprom (0x00, 0x41, 0x7F, 0x41, 0x00) ; I
eeprom (0x20, 0x40, 0x41, 0x3F, 0x01) ; J
eeprom (0x7F, 0x08, 0x14, 0x22, 0x41) ; K
eeprom (0x7F, 0x40, 0x40, 0x40, 0x40) ; L
eeprom (0x7F, 0x02, 0x0C, 0x02, 0x7F) ; M
eeprom (0x7F, 0x04, 0x08, 0x10, 0x7F) ; N
eeprom (0x3E, 0x41, 0x41, 0x41, 0x3E) ; O
eeprom (0x7F, 0x09, 0x09, 0x09, 0x06) ; P
eeprom (0x3E, 0x41, 0x51, 0x21, 0x5E) ; Q
eeprom (0x7F, 0x09, 0x19, 0x29, 0x46) ; R
eeprom (0x46, 0x49, 0x49, 0x49, 0x31) ; S
eeprom (0x01, 0x01, 0x7F, 0x01, 0x01) ; T
eeprom (0x3F, 0x40, 0x40, 0x40, 0x3F) ; U
eeprom (0x1F, 0x20, 0x40, 0x20, 0x1F) ; V
eeprom (0x3F, 0x40, 0x38, 0x40, 0x3F) ; W
eeprom (0x63, 0x14, 0x08, 0x14, 0x63) ; X
eeprom (0x07, 0x08, 0x70, 0x08, 0x07) ; Y
eeprom (0x61, 0x51, 0x49, 0x45, 0x43) ; Z


eeprom (0x00, 0x7F, 0x41, 0x41, 0x00) ; [ -new
eeprom (0x02, 0x04, 0x08, 0x10, 0x20) ; \ -new 
eeprom (0x00, 0x41, 0x41, 0x7F, 0x00) ; ] -new
eeprom (0x04, 0x02, 0x01, 0x02, 0x04) ; ^ -new
eeprom (0x40, 0x40, 0x40, 0x40, 0x40) ; _ -new
eeprom (0x00, 0x01, 0x02, 0x04, 0x00) ; ` -new (back tick)
eeprom (0x20, 0x54, 0x54, 0x54, 0x78) ; a -new
eeprom (0x7F, 0x48, 0x44, 0x44, 0x38) ; b -new
eeprom (0x38, 0x44, 0x44, 0x44, 0x20) ; c -new
eeprom (0x38, 0x44, 0x44, 0x48, 0x7F) ; d &#8211;new
eeprom (0x38, 0x54, 0x54, 0x54, 0x18) ; e -new
eeprom (0x08, 0x7E, 0x09, 0x01, 0x02) ; f -new
eeprom (0x18, 0xA4, 0xA4, 0xA4, 0x7C) ; g &#8211;new (tail now below base line)
eeprom (0x7F, 0x08, 0x04, 0x04, 0x78) ; h -new
eeprom (0x00, 0x48, 0x7A, 0x40, 0x00) ; i &#8211;new (modified &#8211; shortened 1 pixel)
eeprom (0x40, 0x80, 0x88, 0x7A, 0x00) ; j -new (tail now below base line)
eeprom (0x7F, 0x10, 0x28, 0x44, 0x00) ; k -new
eeprom (0x00, 0x41, 0x7F, 0x40, 0x00) ; l -new
eeprom (0x7C, 0x04, 0x18, 0x04, 0x78) ; m -new
eeprom (0x7C, 0x08, 0x04, 0x04, 0x78) ; n -new
eeprom (0x38, 0x44, 0x44, 0x44, 0x38) ; o -new
eeprom (0xFC, 0x24, 0x24, 0x24, 0x18) ; p -new (tail now below base line)
eeprom (0x18, 0x24, 0x24, 0x28, 0xFC) ; q &#8211;new (tail now below base line)
eeprom (0x7C, 0x08, 0x04, 0x04, 0x08) ; r -new
eeprom (0x48, 0x54, 0x54, 0x54, 0x20) ; s -new
eeprom (0x04, 0x3F, 0x44, 0x40, 0x20) ; t -new
eeprom (0x3C, 0x40, 0x40, 0x20, 0x7C) ; u -new
eeprom (0x1C, 0x20, 0x40, 0x20, 0x1C) ; v -new
eeprom (0x3C, 0x40, 0x30, 0x40, 0x3C) ; w -new
eeprom (0x44, 0x28, 0x10, 0x28, 0x44) ; x -new
eeprom (0x1C, 0xA0, 0xA0, 0xA0, 0x7C) ; y - new (tail now below base line)
eeprom (0x44, 0x64, 0x54, 0x4C, 0x44) ; z -new
eeprom (0x00, 0x08, 0x36, 0x41, 0x00) ; { -new
eeprom (0x00, 0x00, 0x7F, 0x00, 0x00) ; | &#8211;new
eeprom (0x00, 0x41, 0x36, 0x08, 0x00) ; } -new
eeprom (0x08, 0x08, 0x2A, 0x1C, 0x08) ; --> -new
eeprom (0x08, 0x1C, 0x2A, 0x08, 0x08) ; <-- -new
 
Last edited:

Michael 2727

Senior Member
Slightly OT, well maybe not.

The Retrofit-
A couple of weeks ago I purchased an old (1938 onwards ) 35mm Slide Projector,
it is an Aldis Aspheric 111 type, 2 slide C/W case. $2 Bucks at the OP Shop/charity shop.
The original 240v 300W lamp was broken and could cost AUD $60 to $80 to relpace.
I thought Luxeon 3W LED maybe but not enough Oomph there.
Then I tried a 12VDC 50W Dichroic lamp (domestic downlight) because the OP Shop had
a new switchmode 240VAC-12VDC 60W supply for a dolla (nearly broke me ) ;)
Anyway after a few hours with the Dremel and various other tools I managed
to fit the the 12V Lamp neatly into the projector ( while still maintaining original condition )
I had to remove the original lamp reflector and one of the difuser lenses inside.

But it works fine, probably only at half the original luminance or so but still very usable.

Now this got me thinking, a Nokia LCD fits neatly into the slide frame with room to spare.
The silver backing on the Nokia Display is light-transmissive, no need to peel it off.
With some scrolling letters/words or simple animation you could have a rather quirky
nuvo retro wall art display. A Picaxe LCD projector.

The projector has an internal cooling fan, where some of the flow is directed across
the 35mm film slide, and an internal 6mm glass heat filter (I'm guessing IR filter ) so
the LCD panel does not get too hot after 5 mins or more.
I once left my LCD watch ontop of a steam cleaner at a service station, to my horror
the entire face went jet black from the heat, it did work fine after it had cooled down.

Anyway just a thought if you were looking quirky rainy day project for an LCD.
 

westaust55

Moderator
Code to put 5x7 font in external EEPROM

For those who may be interested, here is the code that I have used to write the 96 character 5x7 pixel(+tails) font set into EEPROM

I realise that it is not necessary to put the address at the start of every
HI2COUT command but it does not stop it working and acts as a reference point for adjustments, etc . . .

Code:
SYMBOL eeprom_0 = %10100000                       ; %1010 = EEPROM, 000 = Addr/page 0, and 0 = control bit
SYMBOL lcd_data = 1                               ; serial pin for data to LCD display

Init:                                             
Hi2csetup  i2cmaster, eeprom_0, i2cfast, i2cword  ; setup i2c comms to the EEPROM, with i2cword for 24LC256
;
; first 128 bytes at pages 0 & 1 are used for 48-key keypad codes
;
; next 384 bytes at pages 2 to 7 are still free
;
Main:                                        ; write 5x7 font data for graphic LCD to pages 8 to 15 within EEPROM
Hi2cout  512, (0x00, 0x00, 0x00, 0x00, 0x00) ; Sp -new
Pause 20
Hi2cout  517, (0x00, 0x00, 0x2f, 0x00, 0x00) ; !
Pause 20
Hi2cout  522, (0x00, 0x07, 0x00, 0x07, 0x00) ; "
Pause 20
Hi2cout  527, (0x14, 0x7f, 0x14, 0x7f, 0x14) ; #
Pause 20
Hi2cout  532, (0x24, 0x2a, 0x7f, 0x2a, 0x12) ; $
Pause 20
Hi2cout  537, (0x23, 0x13, 0x08, 0x64, 0x62) ; % fixed (was back to front as o\° and 1 pixel too low)
Pause 20
Hi2cout  542, (0x36, 0x49, 0x55, 0x22, 0x50) ; &
Pause 20
Hi2cout  547, (0x00, 0x05, 0x03, 0x00, 0x00) ; ' (apostrophe)
Pause 20
Hi2cout  552, (0x00, 0x1c, 0x22, 0x41, 0x00) ; (
Pause 20
Hi2cout  557, (0x00, 0x41, 0x22, 0x1c, 0x00) ; )
Pause 20
Hi2cout  562, (0x14, 0x08, 0x3E, 0x08, 0x14) ; *
Pause 20
Hi2cout  567, (0x08, 0x08, 0x3E, 0x08, 0x08) ; +
Pause 20
Hi2cout  572, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout  576, (0x00, 0x00, 0x50, 0x30, 0x00) ; ,
Pause 20
Hi2cout  581, (0x08, 0x08, 0x08, 0x08, 0x08) ; -
Pause 20
Hi2cout  586, (0x00, 0x60, 0x60, 0x00, 0x00) ; .
Pause 20
Hi2cout  591, (0x20, 0x10, 0x08, 0x04, 0x02) ; /
Pause 20
Hi2cout  596, (0x3E, 0x51, 0x49, 0x45, 0x3E) ; 0
Pause 20
Hi2cout  601, (0x00, 0x42, 0x7F, 0x40, 0x00) ; 1
Pause 20
Hi2cout  606, (0x42, 0x61, 0x51, 0x49, 0x46) ; 2
Pause 20
Hi2cout  611, (0x21, 0x41, 0x45, 0x4B, 0x31) ; 3
Pause 20
Hi2cout  616, (0x18, 0x14, 0x12, 0x7F, 0x10) ; 4
Pause 20
Hi2cout  621, (0x27, 0x45, 0x45, 0x45, 0x39) ; 5
Pause 20
Hi2cout  626, (0x3C, 0x4A, 0x49, 0x49, 0x30) ; 6
Pause 20
Hi2cout  631, (0x01, 0x71, 0x09, 0x05, 0x03) ; 7
Pause 20
Hi2cout  636, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout  640, (0x36, 0x49, 0x49, 0x49, 0x36) ; 8
Pause 20
Hi2cout  645, (0x06, 0x49, 0x49, 0x29, 0x1E) ; 9
Pause 20
Hi2cout  650, (0x00, 0x36, 0x36, 0x00, 0x00) ; : -new
Pause 20
Hi2cout  655, (0x00, 0x56, 0x36, 0x00, 0x00) ; ; -new
Pause 20
Hi2cout  660, (0x08, 0x14, 0x22, 0x41, 0x00) ; < -new
Pause 20
Hi2cout  665, (0x14, 0x14, 0x14, 0x14, 0x14) ; = -new
Pause 20
Hi2cout  670, (0x41, 0x22, 0x14, 0x08, 0x00) ; > -new
Pause 20
Hi2cout  675, (0x02, 0x01, 0x51, 0x09, 0x06) ; ? -new
Pause 20
Hi2cout  680, (0x32, 0x49, 0x79, 0x41, 0x3E) ; @ -new 
Pause 20
Hi2cout  685, (0x7E, 0x11, 0x11, 0x11, 0x7E) ; A
Pause 20
Hi2cout  690, (0x7F, 0x49, 0x49, 0x49, 0x36) ; B
Pause 20
Hi2cout  695, (0x3E, 0x41, 0x41, 0x41, 0x22) ; C
Pause 20
Hi2cout  700, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout  704, (0x7F, 0x41, 0x41, 0x22, 0x1C) ; D
Pause 20
Hi2cout  709, (0x7F, 0x49, 0x49, 0x49, 0x41) ; E
Pause 20
Hi2cout  714, (0x7F, 0x09, 0x09, 0x09, 0x01) ; F
Pause 20
Hi2cout  719, (0x3E, 0x41, 0x49, 0x49, 0x7A) ; G
Pause 20
Hi2cout  724, (0x7F, 0x08, 0x08, 0x08, 0x7F) ; H
Pause 20
Hi2cout  729, (0x00, 0x41, 0x7F, 0x41, 0x00) ; I
Pause 20
Hi2cout  734, (0x20, 0x40, 0x41, 0x3F, 0x01) ; J
Pause 20
Hi2cout  739, (0x7F, 0x08, 0x14, 0x22, 0x41) ; K
Pause 20
Hi2cout  744, (0x7F, 0x40, 0x40, 0x40, 0x40) ; L
Pause 20
Hi2cout  749, (0x7F, 0x02, 0x0C, 0x02, 0x7F) ; M
Pause 20
Hi2cout  754, (0x7F, 0x04, 0x08, 0x10, 0x7F) ; N
Pause 20
Hi2cout  759, (0x3E, 0x41, 0x41, 0x41, 0x3E) ; O
Pause 20
Hi2cout  764, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout  768, (0x7F, 0x09, 0x09, 0x09, 0x06) ; P
Pause 20
Hi2cout  773, (0x3E, 0x41, 0x51, 0x21, 0x5E) ; Q
Pause 20
Hi2cout  778, (0x7F, 0x09, 0x19, 0x29, 0x46) ; R
Pause 20
Hi2cout  783, (0x46, 0x49, 0x49, 0x49, 0x31) ; S
Pause 20
Hi2cout  788, (0x01, 0x01, 0x7F, 0x01, 0x01) ; T
Pause 20
Hi2cout  793, (0x3F, 0x40, 0x40, 0x40, 0x3F) ; U
Pause 20
Hi2cout  798, (0x1F, 0x20, 0x40, 0x20, 0x1F) ; V
Pause 20
Hi2cout  803, (0x3F, 0x40, 0x38, 0x40, 0x3F) ; W
Pause 20
Hi2cout  808, (0x63, 0x14, 0x08, 0x14, 0x63) ; X
Pause 20
Hi2cout  813, (0x07, 0x08, 0x70, 0x08, 0x07) ; Y
Pause 20
Hi2cout  818, (0x61, 0x51, 0x49, 0x45, 0x43) ; Z
Pause 20
Hi2cout  823, (0x00, 0x7F, 0x41, 0x41, 0x00) ; [ -new
Pause 20
Hi2cout  828, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout  832, (0x02, 0x04, 0x08, 0x10, 0x20) ; \ -new 
Pause 20
Hi2cout  837, (0x00, 0x41, 0x41, 0x7F, 0x00) ; ] -new
Pause 20
Hi2cout  842, (0x04, 0x02, 0x01, 0x02, 0x04) ; ^ -new
Pause 20
Hi2cout  847, (0x40, 0x40, 0x40, 0x40, 0x40) ; _ -new
Pause 20
Hi2cout  852, (0x00, 0x01, 0x02, 0x04, 0x00) ; ` -new (back tick)
Pause 20
Hi2cout  857, (0x20, 0x54, 0x54, 0x54, 0x78) ; a -new
Pause 20
Hi2cout  862, (0x7F, 0x48, 0x44, 0x44, 0x38) ; b -new
Pause 20
Hi2cout  867, (0x38, 0x44, 0x44, 0x44, 0x20) ; c -new
Pause 20
Hi2cout  872, (0x38, 0x44, 0x44, 0x48, 0x7F) ; d -new
Pause 20
Hi2cout  877, (0x38, 0x54, 0x54, 0x54, 0x18) ; e -new
Pause 20
Hi2cout  882, (0x08, 0x7E, 0x09, 0x01, 0x02) ; f -new
Pause 20
Hi2cout  887, (0x18, 0xA4, 0xA4, 0xA4, 0x7C) ; g -new (tail now below base line)
Pause 20
Hi2cout  892, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout  896, (0x7F, 0x08, 0x04, 0x04, 0x78) ; h -new
Pause 20
Hi2cout  901, (0x00, 0x48, 0x7A, 0x40, 0x00) ; i -new (modified - shortened 1 pixel)
Pause 20
Hi2cout  906, (0x40, 0x80, 0x88, 0x7A, 0x00) ; j -new (tail now below base line)
Pause 20
Hi2cout  911, (0x7F, 0x10, 0x28, 0x44, 0x00) ; k -new
Pause 20
Hi2cout  916, (0x00, 0x41, 0x7F, 0x40, 0x00) ; l -new
Pause 20
Hi2cout  921, (0x7C, 0x04, 0x18, 0x04, 0x78) ; m -new
Pause 20
Hi2cout  926, (0x7C, 0x08, 0x04, 0x04, 0x78) ; n -new
Pause 20
Hi2cout  931, (0x38, 0x44, 0x44, 0x44, 0x38) ; o -new
Pause 20
Hi2cout  936, (0xFC, 0x24, 0x24, 0x24, 0x18) ; p -new (tail now below base line)
Pause 20
Hi2cout  941, (0x18, 0x24, 0x24, 0x28, 0xFC) ; q -new (tail now below base line)
Pause 20
Hi2cout  946, (0x7C, 0x08, 0x04, 0x04, 0x08) ; r -new
Pause 20
Hi2cout  951, (0x48, 0x54, 0x54, 0x54, 0x20) ; s -new
Pause 20
Hi2cout  956, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout  960, (0x04, 0x3F, 0x44, 0x40, 0x20) ; t -new
Pause 20
Hi2cout  965, (0x3C, 0x40, 0x40, 0x20, 0x7C) ; u -new
Pause 20
Hi2cout  970, (0x1C, 0x20, 0x40, 0x20, 0x1C) ; v -new
Pause 20
Hi2cout  975, (0x3C, 0x40, 0x30, 0x40, 0x3C) ; w -new
Pause 20
Hi2cout  980, (0x44, 0x28, 0x10, 0x28, 0x44) ; x -new
Pause 20
Hi2cout  985, (0x1C, 0xA0, 0xA0, 0xA0, 0x7C) ; y - new (tail now below base line)
Pause 20
Hi2cout  990, (0x44, 0x64, 0x54, 0x4C, 0x44) ; z -new
Pause 20
Hi2cout  995, (0x00, 0x08, 0x36, 0x41, 0x00) ; { -new
Pause 20
Hi2cout 1000, (0x00, 0x00, 0x7F, 0x00, 0x00) ; | -new
Pause 20
Hi2cout 1005, (0x00, 0x41, 0x36, 0x08, 0x00) ; } -new
Pause 20
Hi2cout 1010, (0x08, 0x08, 0x2A, 0x1C, 0x08) ; --> -new
Pause 20
Hi2cout 1015, (0x08, 0x1C, 0x2A, 0x08, 0x08) ; <-- -new
Pause 20
Hi2cout 1020, (0x00, 0x00, 0x00, 0x00) ; respect 64 byte paging borders
;----------------------------------------------------
Pause 20
Serout lcd_data, N2400, ( "EEPROM Writing Done." )
Pause 1000
Serout lcd_data, N2400, ( "Now test the Keypad." )
Pause 20
Serout lcd_data, N2400, ( "                    " )
Pause 20
Serout lcd_data, N2400, ( "and 5x7 LCD Fonts.  " )
 

westaust55

Moderator
The Retrofit-
A couple of weeks ago I purchased an old (1938 onwards ) 35mm Slide Projector,
it is an Aldis Aspheric 111 type, 2 slide C/W case. $2 Bucks at the OP Shop/charity shop.
The original 240v 300W lamp was broken and could cost AUD $60 to $80 to relpace.
I thought Luxeon 3W LED maybe but not enough Oomph there.
Then I tried a 12VDC 50W Dichroic lamp (domestic downlight) because the OP Shop had
a new switchmode 240VAC-12VDC 60W supply for a dolla (nearly broke me ) ;)
Anyway after a few hours with the Dremel and various other tools I managed
to fit the the 12V Lamp neatly into the projector ( while still maintaining original condition )
I had to remove the original lamp reflector and one of the difuser lenses inside.

But it works fine, probably only at half the original luminance or so but still very usable.

Now this got me thinking, a Nokia LCD fits neatly into the slide frame with room to spare.
The silver backing on the Nokia Display is light-transmissive, no need to peel it off.
With some scrolling letters/words or simple animation you could have a rather quirky
nuvo retro wall art display. A Picaxe LCD projector.

The projector has an internal cooling fan, where some of the flow is directed across
the 35mm film slide, and an internal 6mm glass heat filter (I'm guessing IR filter ) so
the LCD panel does not get too hot after 5 mins or more.
I once left my LCD watch ontop of a steam cleaner at a service station, to my horror
the entire face went jet black from the heat, it did work fine after it had cooled down.

Anyway just a thought if you were looking quirky rainy day project for an LCD.
Hi Michael,
Slide projector lamps are not a problem for me.
30 years ago I bought a Rollie projector with a zoom lens. As was living in a very remote are (an Island of the Kimberley coast of WA) I bought a spare lamp. Projector has been all over Austalia (WA, NT and NSW) by sea, air, road & rail and used regularly up to 3 years ago (people actually still asked to see some of my slides). After all those years I still have the original and the spare lamp.

With respect to your thoughts you could use a monochrome LCD and have an even more retro look. The Siemens A55 LCD I am using has about 50% more pixels than many of the Nokia LCD’s.
Have in my searching come accross some information relating to Nokia colour screens but have not delved into that info as yet.

Heat would be an issue as you mention. From my own past experience with a watch and near flat battery, display was good on a cold morning but faded out as the day (at Alice Springs) warmed up.
 

westaust55

Moderator
ex mobile phone LCD Voltage setting info

Here is some information on setting VLCD for ex mobile LCD’s such as the Siemens A55 and the Nokia 3310(and maybe others) that may be useful to others.


The Russian website to which Hippy had given me a link, wrt my A55 display, for potential LCD initialisation had the commands as follows:

//=== Init for Siemens C55/A55 LCD - OK! ===
Delay(1000);

LSend(0x21,0); // PowerON, ExtCommandSet
LSend(0x09,0); // Internal HV-gen x3
LSend(0xE0,0); // Set Vop
LSend(0x16,0); // Bias n=2 //15
LSend(0x06,0); // Temperature coeff 2
LSend(0x20,0); // StandartCommandSet
LSend(0x0C,0); // normal mode, display non-inverted
I am operating the LCD module on a 3.0V supply generally as per the voltage used within the phone (although the datasheet for the LCD PCF8812 controller indicates the chip is rated to 5V).
When this data was first entered the display came up black, indicating that the VLCD was far too high.

When I adjusted the second value (for HV multiplier) from $09 to $08) the display was clearly visible. I tried various settings in lieu of $E0) for the third value to set Vop and found that values in the range $EO to $FF were all clearly visible. Higher values in this range do tend to make the active background show up slightly and by using $F0 the slight darker tinge (compared to the OFF state) to the background acts as an indicator that the LCD is functional even when the display it is cleared.

Changing the HV multiplier setting back to $09, the value for Vop had to be reduced. With Vop at $C0 the display was barely visible, at $C6 is was clear and distinct and by $D0 is was far too dark. The PCF8812 datasheet does not provide any formula to state how Vop or VLCD is affected by the HV multiplier but does set a limit for VLCD (see note 2 below).

With a 3V supply and the HV multiplier on $08 the HV rails is 6V whereas with the HV multiplier on $09 the HV rails is 9V.
From the formula VLCD = a + Vop * b (part of overall formula from datasheets)
From the A55/PCF8812 display, where a = 2.94 and b= 0.03 , so with Vop = $C6, the actual voltage VLCD = 8.88V which is very close to the 9V limit.
So seemingly will be far better to run with the HV multiplier at $09 and Vop at $C6.
It is clear that a variation in VLCD by as little as ~0.3 to 0.5 Volts is enough to go from a totally clear display (too faint) to a total dark display.

For the Siemens A55 LCD with PCF8812, a one increment/count change in the value of Vop adjusts the voltage of VLCD by 0.03 Volts.
For the Nokia 3310 LCD with PCF8544 driver, a one increment/count change in the value of Vop adjusts the voltage of VLCD by 0.06 Volts.

Notes:
1. The PCF8812 for the A55 LCD has a dual range for Vop selected by the PRS bit in the Vop range control command. I have found that leaving this at the default value of 0 is sufficient. Changing the PRS bit to a 1 adds 3.18 Volts to the value of VLCD

2. There are voltage limits for the voltages of Vop and VLCD being 8.5V and 10.0V respectively for the 3310/PCF8544 LCD and (not stated) and 9.0V respectively for the A55/PCF8812 LCD.

From some trials, changes were clearly visible in the correct range with a VLCD change of 0.1 Volts (a change of $03 to parameter Vop).
The Nokia 3310 LCD does NOT have a HV multiplier only the Vop parameter.

So if you display does not function at first energisation, do not presume automatically that it is dead. Instead try changing the value of Vop in say $08 or at most $10 increments and see if this brings about any success.
 
Last edited:

westaust55

Moderator
Clear shot of A55 LCD with 5x7(+tails) font

Okay, now have my better camera to hand, so here are some better shots.

I have left some of the LCD module within part of the original plastic frame as a means of mounting into a plastic box along with the PICAXE to LCD adapter module sometime later. WIll likely buy a 74LVC245 to replace the 74HC245 and make up a new adapter which will not need the resistor dividers.
 

Attachments

Last edited:

westaust55

Moderator
Greek Font in 5x7 format

Made a start towards creating a 5x7 font for the Greek Alphabet with both upper and lower case versions. Attached is my interpretation so far done during my lunch break. Some based on charcters from the typical AXE033 fontset where they exist but those dropepd down typically 1 pixel to the baseline and then others added for the full set.

Will likely have a go this evening to encode into EEPROM/i2cout statements to store in an external EEPROM. Will occupy 256 bytes.
On the other hand, could use ISO/IEC 8859-7(aka Greek 8-bit Font) for coding but will occupy more space and includes some other "western European" symbols/characters.

Any comments/corrections before I get started are appreciated.

Any thoughts by others on adding some mathematical orientated characters (e.g. Square root, degree, etc) ? :confused:
 

Attachments

Last edited:

westaust55

Moderator
5x7 (+tails) GREEK font set

This evening created my own Greek fontset.
Have at this time just appended the extra 48 characters to the end of the existing 96 for the standard fontset.
So starting with a value of 128, passing this value to the VALUETOLCD subroutine will print the uppercase or lower case characters for the Greek alphabet.

Have made a few minor edits to the appearance of some lower case characters relative to the sheet given in the previous post
(eg lowered phi 1 pixel, reduced height of Chi, modified gamma & Xi.)

Found that having developed the visual side of the font in Excel, it was very easy to use Excel to calculate all the byte values, rather than me doing it by hand. :)
Therefore, creating the PICAXE code to write to EEPROM took a relatively short time.


AGAIN: I realise that it is not necessary to put the address at the start of every
HI2COUT command but it does not stop it working and acts as a reference point for adjustments, etc . . .


Code:
SYMBOL eeprom_0 = %10100000                       ; %1010 = EEPROM, 000 = Addr/page 0, and 0 = control bit
SYMBOL lcd_data = 1                               ; serial pin for data to LCD display

Init:                                             
Hi2csetup  i2cmaster, eeprom_0, i2cfast, i2cword  ; setup i2c comms to the EEPROM with i2cword for 24LC256
;
;
; GREEK Alphabet starts here
;
; write 5x7 font data for graphic LCD to pages 16 to 19 within EEPROM
Pause 20
Hi2cout 1024, (0x78, 0x16, 0x11, 0x16, 0x78) ; UC Alpha
Pause 20
Hi2cout 1029, (0x41, 0x7F, 0x49, 0x49, 0x36) ; UC Beta
Pause 20
Hi2cout 1034, (0x41, 0x7F, 0x01, 0x01, 0x03) ; UC Gamma
Pause 20
Hi2cout 1039, (0x70, 0x4E, 0x41, 0x4E, 0x70) ; UC Delta
Pause 20
Hi2cout 1044, (0x41, 0x7F, 0x49, 0x5D, 0x41) ; UC Epsilon
Pause 20
Hi2cout 1049, (0x63, 0x51, 0x49, 0x45, 0x63) ; UC Zeta
Pause 20
Hi2cout 1054, (0x41, 0x7F, 0x08, 0x7F, 0x41) ; UC Eta
Pause 20
Hi2cout 1059, (0x3E, 0x49, 0x49, 0x49, 0x3E) ; UC Theta
Pause 20
Hi2cout 1064, (0x00, 0x41, 0x7F, 0x41, 0x00) ; UC Iota
Pause 20
Hi2cout 1069, (0x41, 0x7F, 0x08, 0x36, 0x41) ; UC Kappa
Pause 20
Hi2cout 1074, (0x70, 0x0E, 0x01, 0x0E, 0x70) ; UC Lambda
Pause 20
Hi2cout 1079, (0x7F, 0x02, 0x3C, 0x02, 0x7F) ; UC Mu
Pause 20
Hi2cout 1084, (0x00, 0x00, 0x00, 0x00) ; respect EEPROM 64 byte paging borders
;----------------------------------------------------
Pause 20
Hi2cout 1088, (0x7F, 0x02, 0x0C, 0x10, 0x7F) ; UC Nu
Pause 20
Hi2cout 1093, (0x63, 0x49, 0x49, 0x49, 0x63) ; UC Xi
Pause 20
Hi2cout 1098, (0x3E, 0x41, 0x41, 0x41, 0x3E) ; UC Omicron
Pause 20
Hi2cout 1103, (0x41, 0x7F, 0x00, 0x7F, 0x41) ; UC Pi
Pause 20
Hi2cout 1108, (0x41, 0x7F, 0x09, 0x09, 0x06) ; UC Rho
Pause 20
Hi2cout 1113, (0x63, 0x55, 0x49, 0x49, 0x63) ; UC Sigma
Pause 20
Hi2cout 1118, (0x03, 0x41, 0x7F, 0x41, 0x03) ; UC Tau
Pause 20
Hi2cout 1123, (0x03, 0x4C, 0x70, 0x4C, 0x03) ; UC Upsilon
Pause 20
Hi2cout 1128, (0x1C, 0x22, 0x7F, 0x22, 0x1C) ; UC Phi
Pause 20
Hi2cout 1133, (0x63, 0x14, 0x08, 0x14, 0x63) ; UC Chi
Pause 20
Hi2cout 1138, (0x0F, 0x10, 0x7F, 0x10, 0x0F) ; UC Psi
Pause 20
Hi2cout 1143, (0x5E, 0x61, 0x01, 0x61, 0x5E) ; UC Omega
Pause 20
Hi2cout 1148, (0x00, 0x00, 0x00, 0x00) ; respect EEPROM 64 byte paging borders
;----------------------------------------------------

Pause 20
Hi2cout 1152, (0x18, 0x24, 0x24, 0x18, 0x24) ; LC Alpha
Pause 20
Hi2cout 1157, (0xF8, 0x54, 0x54, 0x54, 0x28) ; LC Beta
Pause 20
Hi2cout 1162, (0x04, 0xFC, 0x40, 0x30, 0x0C) ; LC Gamma
Pause 20
Hi2cout 1167, (0x22, 0x55, 0x49, 0x49, 0x30) ; LC Delta
Pause 20
Hi2cout 1172, (0x28, 0x54, 0x54, 0x44, 0x28) ; LC Epsilon
Pause 20
Hi2cout 1177, (0x1E, 0x21, 0xA1, 0xA1, 0xE1) ; LC Zeta
Pause 20
Hi2cout 1182, (0x04, 0x78, 0x04, 0x04, 0x78) ; LC Eta
Pause 20
Hi2cout 1187, (0x3E, 0x49, 0x49, 0x3E, 0x00) ; LC Theta
Pause 20
Hi2cout 1192, (0x00, 0x08, 0x3C, 0x40, 0x00) ; LC Iota
Pause 20
Hi2cout 1197, (0x7C, 0x10, 0x28, 0x44, 0x44) ; LC Kappa
Pause 20
Hi2cout 1202, (0x41, 0x23, 0x1C, 0x60, 0x40) ; LC Lambda
Pause 20
Hi2cout 1207, (0xFC, 0x20, 0x40, 0x40, 0x3C) ; LC Mu
Pause 20
Hi2cout 1212, (0x00, 0x00, 0x00, 0x00) ; respect EEPROM 64 byte paging borders
;----------------------------------------------------

Pause 20
Hi2cout 1216, (0x04, 0x0C, 0x30, 0x40, 0x3C) ; LC Nu
Pause 20
Hi2cout 1221, (0x1A, 0x25, 0xA5, 0xa1, 0xE1) ; LC Xi
Pause 20
Hi2cout 1226, (0x38, 0x44, 0x44, 0x44, 0x38) ; LC Omicron
Pause 20
Hi2cout 1231, (0x44, 0x3C, 0x04, 0x3C, 0x44) ; LC Pi
Pause 20
Hi2cout 1236, (0xF8, 0x24, 0x44, 0x44, 0x38) ; LC Rho
Pause 20
Hi2cout 1241, (0x38, 0x44, 0x4C, 0x34, 0x04) ; LC Sigma
Pause 20
Hi2cout 1246, (0x00, 0x04, 0x7C, 0x44, 0x00) ; LC Tau
Pause 20
Hi2cout 1251, (0x04, 0x3C, 0x40, 0x44, 0x38) ; LC Upsilon
Pause 20
Hi2cout 1256, (0x30, 0x48, 0xFC, 0x48, 0x30) ; LC Phi
Pause 20
Hi2cout 1261, (0x44, 0x28, 0x10, 0x28, 0x44) ; LC Chi
Pause 20
Hi2cout 1266, (0x3C, 0x40, 0xFC, 0x40, 0x3C) ; LC Psi
Pause 20
Hi2cout 1271, (0x38, 0x44, 0x30, 0x44, 0x38) ; LC Omega
Pause 20
Hi2cout 1276, (0x00, 0x00, 0x00, 0x00) ; respect  EEPROM 64 byte paging borders
;----------------------------------------------------
Pause 20
Serout lcd_data, N2400, ( "EEPROM Writing Done." )
Pause 1000
Serout lcd_data, N2400, ( "Now test the Fonts. " )
Pause 20
 
Last edited:

westaust55

Moderator
Who wants a bigger font for ex phone graphic LCDs

Started thinking about a double sized font for use with the LCD modules extracted from some mobile phones (eg Nokia 3310 and Siemens A55).

Spent half an hour at lunchtime thinking about this and it would be very easy to achieve a 2x font display, That is 10 x 14 pixels derived from the already established 5x7 font data.

Obviously on a 3310 display this reduces the resolution to 7 chars/line x 3 lines and even on the Siemens A55 display it is down to just 8 chars/line (maybe 9 with pseudo-proportial font) x 4 lines.

Can even do a version to display double height but single width text.

The maths is easy and thoughts are to use the scratchpad memory area (128 bytes there) to hold the bottom half of the text data as the top half of a line is printed then its just a case of transferring the data for the bottom half of the characters to try and keep the speed up.

A few tweaks to the existing program code should be able to do all that.

Any thoughts, suggestions, etc from other such LCD module users prior to my starting?
Will look at doing the code tonight and upload the revised program if there is interest.
 

westaust55

Moderator
Tall+Wide and Tall+Narrow Fonts from Std 5x7

Following on from my last post, had a go at some extra code to permit display of larger fonts based upon the "standard" 5x7 font set.

Below is tonights endeavours. AT the moment there are now too many variables used for non PICAXE X1 parts to run without some optimisation
(Optimisation) will/may come later.

A few pointers for those with a different LCD driver already working and just wishing to merge in the new features from this code:

1. Copy over just the subroutines:
- DatatoLCD , and
- Bottom

2. Just prior to the loop for any text to be handled, add in the program line
fontsize = 2 ; for double height and double width
fontsize = 3 ; for double height and single width

The after the loop to pass characters is done, use the program line
GOSUB bottom ; this prints the bottom half of the double height text

Both font variants have come up good on my A55 LCD module.

Unfortunately attached photo is blurry as do not have my good camera with me.


Code:
; Siemens mobile A55 102 x 65 pixel LCD driver
; Will/should also work with the Nokia 3310 LCD


SYMBOL SCLK    = 3 'PICAXE out 3 TO Display pin 2
SYMBOL SDA     = 4 'PICAXE out 4 TO Display pin 3
SYMBOL DC      = 5 'PICAXE out 5 TO Display pin 4
SYMBOL CS      = 6 'PICAXE out 6 TO Display pin 5
SYMBOL RES     = 7 'PICAXE out 7 TO Display pin 8
SYMBOL value   = b0
SYMBOL pointer = b1
SYMBOL X       = b2
SYMBOL Y       = b3
SYMBOL temp    = b4
SYMBOL temp1   = b5
SYMBOL eeprom_addr = w3 ; w3 = b7 + b6
SYMBOL Loop1   = b8
SYMBOL loop3   = b9
SYMBOL FontSize = b15
SYMBOL Top_byte = b16
SYMBOL Bot_byte = b17
SYMBOL temp2    = b18
SYMBOL temp3    = b19
; NOTE: b10, b11, b12, b13 & b14 used for reading from external EEPROM
;
Symbol EEPROM_0 = %10100000    ; %1010 = EPROM, 000 = Addr/page 0,
;

Main:
        PAUSE   2000 
        SETFREQ m8

        GOSUB InitLCD
        x = 0
        y = 0
        Fontsize = 1
        FOR pointer = 0 TO 18
          LOOKUP pointer,("* Hi PICAXE Forum*  "),value
          GOSUB ValueToLCD
        NEXT

        X=0
        Y=2
        GOSUB GotoXY

        FontSize = 2
        FOR pointer = 0 TO 9
          LookUp pointer,("* FONT2 * "), value
          GOSUB ValueToLCD
        NEXT
        gosub bottom
        
        X=0
        Y=5   ; ****NOTE****  for Nokia3310 make y = 4
        GOSUB GotoXY

        FontSize = 3
        FOR pointer = 0 TO 18
          LookUp pointer,("FONT3 Tall/Narrow   "), value
          GOSUB ValueToLCD
        NEXT
        gosub bottom

        PAUSE 5000
        GOSUB Invert
        PAUSE 5000
        GOSUB Normal

        SETFREQ m4
        STOP
        END
;=====================================================================
; SUBROUTINES
;---------------------------------------------------------------------
InitLCD:
        LOW SCLK
        LOW SDA
        LOW DC
        LOW CS
        LOW RES
        PAUSE 50
        HIGH RES
        HIGH CS

        Value=$21          ; $21 ==> H=1 and function set = chip active, horiz addressing & extended instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$08          ; Set HV multiplier = x 2.              For $09 = x3 set Vop at ~$C6 otherwise gives black screen
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$F0          ; set Vop with (PRS = 0 Vlcd = 2.94V TO 6.75V)      If HV mult = $08 then use ~$C6
                           ; $E0=5.28V, $F0=6.3V, $FF = 6.72V  NOTE max allowed is 9V
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$16          ; set bias: $16 ==> n=1 FOR mux rate 1:18 or 1:16 NOTE: n = 2 and n=5 DO NOT work
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$06          ; set temperature coefficient = 2
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$20          ; $20 ==> H=0 and function set = FOR basic instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        Value=$0C          ; display config =  display non-inverted
        GOSUB CommandToLCD ; transmit To serial LCD module

        GOSUB GoToHome
        GOSUB ClearFast
        GOSUB GoToHome
        GOSUB Normal
 
        RETURN
;---------------------------------------------------- 
Invert:
        Value = 13        ; invert the display light chars on dark background
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
Normal:
        Value = 12
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
GoToHome:
        X = 0
        Y = 0
GotoXY:
        Value = X + 128     ; 128 part = X address command 
        GOSUB CommandToLCD
        Value = Y + 64      ;  64 part = Y address command
        GOSUB CommandToLCD
        RETURN
;----------------------------------------------------

CommandToLCD:
        LOW DC    ; Command mode
        LOW CS
        SHIFTOUT SCLK, SDA,1,(value)
        HIGH CS
        RETURN
;
;----------------------------------------------------
ValueToLCD:
        IF value < $20 or value > $AF then BaleOut ; outside font set range
        
        value = value - $20
        temp = value / 12
        temp = temp * 4
        eeprom_addr = value * 5 + temp + 512 
        
 
        Hi2csetup i2cmaster, EEPROM_0, i2cfast, i2cword  
        Hi2cin  eeprom_addr, (b10, b11, b12, b13, b14)
                
        IF b10 = 0 then goto narrow1   ; found a narrow character
        value = b10
        GOSUB DataToLCD
narrow1:
        value = b11
        GOSUB DataToLCD
        value = b12
        GOSUB DataToLCD
        value = b13
        GOSUB DataToLCD
        IF b10 = 0 then goto narrow2   ; found a narrow character
        value = b14  
        GOSUB DataToLCD 
narrow2:        
        value = 0
        GOSUB DataToLCD ; put a 1 bit space after each character for clarity
BaleOut: RETURN
;----------------------------------------------------
DataToLCD:

        IF FontSize = 1 THEN GOTO DataOut
;
; here if FontSize  = 2 or 3 for double height characters         
;
        
        
        Top_byte = 0
        Bot_byte = 0
        FOR Loop1 = 0 to 3                   ; to check lower 4-bit nybble of value
          LOOKUP loop1, (3,6,12,24), temp
          temp1 = DCD loop1
          temp1 = temp1 AND value
          top_byte = temp1 * temp + top_byte
          loop3 = loop1+4                    ; also checking top 4-bit nybble of value
          temp2 = DCD loop3
          temp2 = temp2 AND value / $10
          bot_byte = temp2*temp + bot_byte
        NEXT loop1
        PUT temp3, bot_byte                   ; save bottom part of text in scratchpad
        temp3 = temp3 + 1
        value = top_byte
        IF FontSize = 2 THEN GOSUB DataOut     ; Tall & Wide
                                                ;or fall thru for Tall and Narrow 
                 
DataOut: HIGH DC 'Write data mode
        LOW CS
        SHIFTOUT SCLK, SDA,1,(value)
        HIGH CS
        RETURN

;----------------------------------------------------

Bottom: y = y + 1
        GOSUB gotoxy
        For loop1 = 0 to temp3
          GET loop1, value
          IF FontSize = 2 THEN GOSUB DataOut  ; Tall and Wide
          GOSUB DataOut                       ; or fall thru for Tall and Narrow
        NEXT Loop1
        temp3 = 0
        RETURN
        
;----------------------------------------------------
ClearFast:
        GOSUB GoToHome
        LOW SDA
        HIGH DC ; Write data mode
        LOW CS
        FOR Loop1 = 0 TO 101 ; 102 pixels wide
          FOR loop3 = 0 TO 8   ' 9 banks high
            SHIFTOUT SCLK, SDA,1,(0) ; output 0 TO clear screen
          NEXT loop3
        NEXT Loop1
        GOSUB GoToHome
        RETURN
Edit: a thought has just come to mind - if I use a value like $FF (255) as a flag at the end of a string then the subroutines ValuetoLCD and DatatoLCD could handle the call to the subroutine Bottom automatically.
thought about storing both the upper and lower part of the text in PICAXE Scratchpad RAM. This would be okay for double width characters but as Scratchpad only has 128 bytes even in X1 PICAXE's not enough RAM to hold up to 204 bytes of data for the A55 LCD as 2 rows of 102 bytes to handle the double height single width version.
 

Attachments

Last edited:

westaust55

Moderator
Graphic LCD module program tweak

Update to last nights last mniute thought.

modified the main program to add a value of $FF (255) at the end of the string

Code:
FontSize = 2
        FOR pointer = 0 TO [B]10[/B]
          LookUp pointer,("* FONT2 *"[B],$FF[/B]), value
          GOSUB ValueToLCD
        NEXT
then at the start of subroutine ValueToLCD added the line:

Code:
IF Value = $FF and Fontsize > 1 then goto Bottom
Result is all works still and no need for two subroutine calls in the main program

Tonight may start looking at writing some code for drawing of lines between two pre-defined points.
 
Last edited:

westaust55

Moderator
Siemens A55 LCD module - Line Plotting subroutine

Tonight I managed to get some line plotting code working.
To use the added subroutine for line plotting:

1. Add these extra SYMBOL statements at the start:

Code:
SYMBOL x1      = b20
SYMBOL y1      = b21
SYMBOL x2      = b22
SYMBOL y2      = b23
SYMBOL dx      = b24
SYMBOL dy      = b25
SYMBOL slope = b26
SYMBOL sign   = b27
SYMBOL base =  b25 ; also used for dy
SYMBOL page = b24  ; also used for dx
SYMBOL pixel = b19
2. add some extra lines into the main program like these:
( The examples here have been picked so the lines do not cross as there is insufficient RAM in the PICAXE to act as a LCD memory buffer. Thus a crossing line will delete part of an existing line).

Code:
x1 = 00
        y1 = 10
        x2 = 15
        y2 = 64
        gosub plotline
        x1 = 20
        y1 = 10
        x2 = 20
        y2 = 64
        gosub plotline
        x1 = 25
        y1 = 64
        x2 = 25
        y2 = 10
        gosub plotline
        x1 = 30
        y1 = 10
        x2 = 45
        y2 = 64
        gosub plotline
        x1 = 65
        y1 = 10
        x2 = 50
        y2 = 64
        gosub plotline
        x1 = 68
        y1 = 10
        x2 = 101
        y2 = 10
        gosub plotline
        x1 = 68
        y1 = 15
        x2 = 101
        y2 = 30
        gosub plotline
        x1 = 60
        y1 = 55
        x2 = 101
        y2 = 40
        gosub plotline

3. Append the following subroutine to the bottom of the existing mobile phone text printing program:

Code:
;----------------------------------------------------------------------
PlotLine:
        IF x2 < x1 THEN
          dx = x1
          dy = y1  
          x1 = x2
          y1 = y2
          x2 = dx
          y2 = dy
        ENDIF
        IF y2 < y1 THEN
          sign = 1                       ; negative slope
          dy = y1 - y2
        ELSE
          sign = 0                      ; positive slope
          dy = y2 - y1  
        ENDIF
        dx = x2 - x1
          
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -        
        IF dy > dx THEN           ; test for steep slope lines
        
          IF y2 < y1 THEN         ; here for steep sloped lines
            dx = x1
            dy = y1  
            x1 = x2
            y1 = y2
            x2 = dx
            y2 = dy
          ENDIF
          temp  = 255               ; used to hold previous x value
          temp1 = 255               ; used to hold previous pixel value
          loop3 = 255               ; used to hold previous page value
          IF x2 < x1 THEN
            sign = 1 ; negative slope
            dx = x1 - x2
          ELSE
            sign = 0 ; positive slope
            dx = x2 - x1  
          ENDIF
          dy = y2 - y1
          
          slope = 100 * dx / dy  
          base = x1
          FOR temp2 = y1 to y2                
            x1 = temp2 - y1 * slope / 100
            IF sign = 0 THEN
              x1 = base + x1
            ELSE
              x1 = base - x1  
            ENDIF
            page = temp2 / 8                ; determine which vertical page (of 8 bits) the pixel is on
            pixel = temp2 // 8              ; pixel position on page as bit 0,1,2  ,. . . . 7
            pixel = DCD pixel            ; convert to a value 1,2,4,8, .
            x = x1
            y = page
            GOSUB Gotoxy
            IF x = temp AND page = loop3 THEN
              pixel = pixel OR temp1
            ELSE
              temp  = 255
              temp1 = 255
              loop3 = 255
            ENDIF
            temp = x
            temp1 = pixel
            loop3 = page
            value = pixel
            GOSUB Dataout
          NEXT temp2
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -                
        ELSE                            ; here if it is a shallow slope lines
          slope = 100 * dy / dx         ; multiplier of 100 used for accuracy to 2 decimal place
          base =  y1
          FOR x = x1 TO x2
            y1 = x - x1 * slope /100
            IF sign = 0 THEN  
              y1 = base + y1
            ELSE
              Y1 = base - y1
            ENDIF
            page = y1 / 8                ; determine which vertical page (of 8 bits) the pixel is on
            pixel = y1 // 8              ; pixel position on page as bit 0,1,2  ,. . . . 7
            pixel = DCD pixel            ; convert to a value 1,2,4,8, . . . 128
            Y=page
            GOSUB Gotoxy
            value = pixel
            GOSUB Dataout
          NEXT x
        ENDIF                              
         RETURN
;======================================================= ================
 

Attachments

Last edited:

westaust55

Moderator
Have just added some "readable" copies of photos to posts 21 and 23 showing the multi-sized font display and line plotting respectively using the developed program.



Thinking that the next add-ins will be:
1. To draw a circle of radius "r" centred on point x1,y1
2. To add a graphing function to (for example) plot an analogue signal.

Probably not much will happen on this over the next few days as away from home but still have forum access :D


any other thoughts on other possibilities/tasks, etc for use of these mobile LCD displays?
 

Michael 2727

Senior Member
Hi westoz,
Just as a matter of interest, how did you connect your wires to the LCD ?

I have 2 Nokia displays, one has gold pads on the glass, which I was not going
to try and solder to as they will prolly drop off, but it has "U" shaped header/pins
where one side press against the display, the other side poke out of the plastic
housing at the back where they make contact with the Phones PCB.
I was going to attach to the back side pins. 1mm pin spacings is going to be
the hard part with my tired eyes.
The other display has conductive (multi sandwhich ) rubber contacts and I think
I chucked the main PCB out, silly me. May be able to poke thin wire through the
rubber to get a contact, something like wire wrap wire should do it.

The lines look interesting, waiting for the circle now :)
 

westaust55

Moderator
Hi Michael,

Yes I did have some initial difficulty in soldering to the terminals.
I am now in possession of 2 x Siemens A55 mobile LCD modules and 2 x Nokia 3310 type LCD modules and do note that the Nokia LCD&#8217;s are going to be much more difficult.

If you look at the attachment to post 8 you will see how I solved the problem in terms of contact closeness for the A55 display.
In that post, I also asked how others got on soldering to LCD contacts. Had hoped for replies from the likes of eclectic and Texy but no response.

The attachment to post 7 shows how/where the A55 LCD contacts are relative to the LCD glass. I tinned the wires, tinned the gold contacts and then soldered the wires to the A55 LCD contacts.

Having now received 1 x 3310 via ebay for $0.99 and another free (even better) from the IT department at work, I can see that by comparison, the A55 display is far easier to solder to as the terminals are away from the glass section and long enough to bend up. In fact I bent every second contact over through around 150 degrees in a &#8220;zip&#8221; / zig-zag fashion to make the spacing better for soldering.

I had read somewhere that for the 3310 type LCD module, others had wedged a match or toothpick behind the display contacts to raise them from the glass screen to steady the contacts to avoid LCD damage.

I have also read of others who have cut up the old mobile PCB and kept the part with the contacts. Then soldered to the PCB and remounted the LCD to the PCB portion.

Trust this information is of some use.

My recommendation would be if those interested can get hold of a Siemens A55/C55 or similar phone free/cheap use that instead of the Nokia 33xx type. They are not so readily available but the advantages are easier soldering to connections and 50% more pixels making display of more info possible.
 

eclectic

Moderator
the Nokia LCD’s are going to be much more difficult.

If you look at the attachment to post 8 you will see how I solved the problem in terms of contact closeness for the A55 display.
In that post, I also asked how others got on soldering to LCD contacts. Had hoped for replies from the likes of eclectic and Texy but no response.
Did someone call?

Here's a couple of pics from an earlier posting.

I agree with Westaust. The Nokia displays are NOT fun to solder!
The ribbon cable has wider spacing than the contacts.

1. <1mm tip iron and 30swg solder.
2. Good eyesight / steady hands / patience.

I buy number 1. Number 2 is diminishing.

And err, I won't show the ones I botched!

e.
 

Attachments

westaust55

Moderator
The overall routines for initialisation of the mobile phone LCD together with basic text printing using standard 5x7 sized characters requires 14 variables with use of internal EEPROM or 15 variables with an external EEPROM. Could likely get this down to 14 variables to fit into the non X1/X2 parts.

For the double height font set, an additional 7 variables are used.
For line drawings 11 additional variables are required and for circles a further 5 variable are required.


As this is well in excess of the actual variables available even within the X1/X2 parts, many variables have been assigned multiple aliases (for readability) and the variable sued in different routines for differing purposes.
While I have still to fully write up and test the circle plotting routine (should be tonight), I have taken the opportunity to prepare a table identifying the variable usable and a few more details about the subroutines. These are provided in the attached table.

I have renamed some alaises and will upload the entire revised code when I have done the circle drawing code.

Note that the line and circle plotting are using some X1/X2 part specific commands such as DCD and SQR but do not see this as an issue as the "smaller" picaxes will not have sufficent variables to run these routines.

Hope this may help those reading through the program.
 

Attachments

westaust55

Moderator
Here is the (almost) final product as a set of graphic LCD drivers to suit the Siemens A55 LCD module.

The circle drawings subroutine (plot circle) is working but I observe 2 issues:
1. circles are not entirly circular due to vertical to horizontal pixel ration of the display
2. the line drawing part works well with lines but does over-write (clear) some pixels on the circle :( ( - I know what is happening just have to sort out a fix if not too time consuming)

Hmm can only have 10K chars in a post :rolleyes:
Second half of the code is in the next post . . . . .

Code:
; ========================================
;   File....... A55_LCD_Driver
;   Purpose.... Siemens A55 LCD module driver
;   Author..... Westaust55
;   E-mail.....
;   Started.... 04-08-2008
;   Updated.... 19-08-2008
;  ==========================================
;
;
; -----[ Program Description ]----------------------------
;
; A program to initialise the graphic LCD module from a Siemens A55 
; includes routines to display text in two sizes and plot lines and circles
; The A55 LCD module has a resolution of 101 x 64 pixels
;
; Most of this PICAXE BASIC programming can also be used for the
; Nokia 3310 type LCD displays
;
; -----[ Revision History ]-------------------------------
;
;A  04-08-2008 Started - routines to initialise LCD module and display text
;B  05-08-2008 Modified code for text display for pseodo-proportional text
;C  08-08-2008 Relocated the 5x7 font into exteral EEPROM and expanded 
;                    to full 96 character "standard" font with lowered tals,
;D  11-08-2008 Modified code to handle extra character for Greek font
;E  13-08-2008 Modified code to enable display of double size characters
;F  14-08-2008 Added routine to allow plotting of lines
;G  18-08-2008 Added routine to plot a circle - calls the line plotting routine
;H  19-08-2008 Modified routines for better circle plotting
; 
;
; -----[ I/O Definitions ]----------------------------------
;
; - - - DIGITAL INPUT PINS  - - -
;
;
; - - - DIGITAL OUTPUT PINS - - -
;
;
; below outputs are specific to the A55 LCD module control/data
;
SYMBOL SCLK   = 3 'PICAXE out 3 To A55 LCD Display pin 2
SYMBOL SDA    = 4 'PICAXE out 4 To A55 LCD Display pin 3
SYMBOL DC      = 5 'PICAXE out 5 To A55 LCD Display pin 4
SYMBOL CS      = 6 'PICAXE out 6 To A55 LCD Display pin 5
SYMBOL RES     = 7 'PICAXE out 7 To A55 LCD Display pin 8
;
; - - - ANALOGUE INPUT PINS  - - -
;
;
; -----[ i2c Device Addressing ]-----------------------
;
; 24LC256 External EEPROM's
SYMBOL eeprom_0 = %10100000  
; PCF8574 8-BIT IO EXPANDERS
SYMBOL expand_0 = %01000000  
SYMBOL expand_1 = %01000010  
;
; -----[ Constants ]-----------------------------------
;
;
; -----[ General Variables ]-----------------------------
;
; Not used after general initialisation
;
SYMBOL pattern     = b23     ; 8 bit pattern to be sent to the  8 x LED's
SYMBOL shflock     = b25     ; Flag to indicate if shiftlock is ON/OFF
;
;
; -----[ Graphic LCD Specific Variables ]------------------
SYMBOL value       = b0
SYMBOL pointer     = b1
SYMBOL x           = b2
SYMBOL y           = b3
SYMBOL temp        = b4
SYMBOL temp1       = b5
SYMBOL eeprom_addr = w3    ; w3 = b7 + b6
SYMBOL loop1       = b8
SYMBOL loop2       = b9
; NOTE: b10, b11, b12, b13 & b14 used for reading from external EEPROM
;
; these (below) are only used mainly for double height font display
SYMBOL nybble_low  = b8
SYMBOL nybble_high = b9
SYMBOL fontsize    = b15
SYMBOL top_byte    = b16
SYMBOL bot_byte    = b17
SYMBOL bot_sav_addr = b19
SYMBOL temp2       = b18
;
; these (below) are for line plotting -note that there are some duplicate names for the same variables
SYMBOL r           = b1
SYMBOL slope       = w3    
SYMBOL base        = b10
SYMBOL page        = b11
SYMBOL circ_y1     = b12
SYMBOL circ_y2     = b13
SYMBOL pixel       = b14
SYMBOL h           = b15
SYMBOL k           = b16
SYMBOL minx        = b17    
SYMBOL x1          = b20
SYMBOL y1          = b21
SYMBOL x2          = b22
SYMBOL y2          = b23
SYMBOL dx          = b24
SYMBOL dy          = b25
SYMBOL maxx        = b26
SYMBOL sign        = b27
; 
; -----[ EEPROM Data ]---------------------------------
;
; Note used here 
; For users without external EEPROM for Font data, the EEPROM statements for
; up to 51 standard 5x7 pixel characters should be inserted here.
; 
; -----[ Initialization ]-----------------------------
;
Init:                          ; This is specific to Westaust55's system to turn off some LED's
       pattern = 0           ; Set to clear all 8 red LED's to OFF
       GOSUB Pattn2led
       shflock = 0           ; Set the SHIFTLOCK green LED to OFF
       GOSUB Shlok2led
       PAUSE 100
;
; -----[ Program Code ]----------------------------------------------------
;
Main: PAUSE   2000 
        SETFREQ m8
 
        GOSUB InitLCD
        x = 0
        y = 0
        fontsize = 1
        FOR pointer = 0 TO 18
          LOOKUP pointer,("* Hi PICAXE Forum * "), value ; 
          GOSUB CharToLCD
        NEXT

; GOTO Plotting           ; comment these in or out depending upon what you wish to try
; GOTO Bypass1          ; comment these in or out depending upon what you wish to try
Circling:
       x1 = 50
       y1 = 35
       r  = 25
       gosub Plotcircle
       
GOTO bypass2            ; comment these in or out delpending upon what you wish to try

Plotting:
        x1 = 00
        y1 = 10
        x2 = 15
        y2 = 64
        GOSUB plotline
        x1 = 20
        y1 = 10
        x2 = 20
        y2 = 64
        GOSUB plotline
        x1 = 25
        y1 = 64
        x2 = 25
        y2 = 10
        GOSUB plotline
        x1 = 30
        y1 = 10
        x2 = 45
        y2 = 64
        GOSUB plotline
        x1 = 65
        y1 = 10
        x2 = 50
        y2 = 64
        GOSUB plotline
        x1 = 68
        y1 = 10
        x2 = 101
        y2 = 10
        GOSUB plotline
        x1 = 68
        y1 = 15
        x2 = 101
        y2 = 30
        GOSUB plotline
        x1 = 60
        y1 = 55
        x2 = 101
        y2 = 40
        GOSUB plotline
       
 Bypass1:
 ;goto bypass2           ; comment these in or out depending upon what you wish to try

        X=0
        Y=2
        GOSUB GotoXY

        fontsize = 2
        FOR pointer = 0 TO 10
          LOOKUP pointer,("* FONT2 *",$FF), value [B][COLOR="Red"]MUST[/COLOR][/B] have $FF as last value if fontsize <>1

          GOSUB CharToLCD
        NEXT
                
        x=0
        y=5   ; ****NOTE****  for Nokia3310 make y = 4
        GOSUB GotoXY

        FontSize = 3
        FOR pointer = 0 TO 19
          LOOKUP pointer,("FONT3 Tall/Narrow ",$FF), value
          GOSUB CharToLCD
        NEXT
Bypass2:        
        PAUSE 5000
        GOSUB Invert
        PAUSE 5000
        GOSUB Normal

        SETFREQ m4
        STOP
        END
;
; -----[ Subroutines ]--------------------------------------
;
Pattn2led:         ; this routine is specific to Westuast55's system - not reuqired by others
           HI2CSETUP  i2cmaster, expand_0, i2cfast, i2cbyte
           HI2COUT (pattern)
           RETURN
;
Shlok2led:         ; this routine is specific to Westuast55's system - not reuqired by others
           HI2CSETUP  i2cmaster, expand_1, i2cfast, i2cbyte
           HI2COUT (shflock)
           RETURN
; ---------------------------------------------------
;
InitLCD:
        LOW SCLK
        LOW SDA
        LOW DC
        LOW CS
        LOW RES
        PAUSE 50
        HIGH RES
        HIGH CS

        value=$21          ; $21 ==> H=1 and function set = chip active, horiz addressing & extended instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$08          ; Set HV multiplier = x 2.              For $09 = x3 set Vop at ~$C6 otherwise gives black screen
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$F0          ; set Vop with (PRS = 0 Vlcd = 2.94V TO 6.75V)      If HV mult = $08 then use ~$C6
                           ; $E0=5.28V, $F0=6.3V, $FF = 6.72V  NOTE max allowed is 9V
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$16          ; set bias: $16 ==> n=1 FOR mux rate 1:18 or 1:16 NOTE: n = 2 and n=5 DO NOT work
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$06          ; set temperature coefficient = 2
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$20          ; $20 ==> H=0 and function set = FOR basic instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$0C          ; display config =  display non-inverted
        GOSUB CommandToLCD ; transmit To serial LCD module

        GOSUB ClearFast
        GOSUB Normal
        RETURN
;---------------------------------------------------- 
Invert:
        Value = 13        ; invert the display light chars on dark background
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
Normal:
        Value = 12        ; normal diplay with dark chars on light background
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
GoToHome:
        x = 0
        y = 0
GotoXY:
        value = x + 128     ; 128 part = X address command 
        GOSUB CommandToLCD
        value = y + 64      ;  64 part = Y address command
        GOSUB CommandToLCD
        RETURN
;
;----------------------------------------------------
CommandToLCD:
        LOW DC    ; Command mode
        LOW CS
        SHIFTOUT SCLK, SDA,1,(value)
        HIGH CS
        RETURN
;
;----------------------------------------------------
 
Last edited:

westaust55

Moderator
A55 LCD drivers - part 2

Code:
CharToLCD:
        IF value = $FF AND fontsize > 1 THEN Bottom  ; $FF is text string is complete flag 

;   NOTE:  If using PICAXE internal EEPROM for font set then modify the next 7 lines of code
;
        IF value < $20 OR  value > $AF THEN BaleOut ; outside font set range
                                              ; $20-$7F = Std chars &  $80 -$AF for Greek chars

        value = value - $20            ; compute external EEPROM address 
        temp = value / 12
        temp = temp * 4
        eeprom_addr = value * 5 + temp + 512 

        Hi2csetup i2cmaster, EEPROM_0, i2cfast, i2cword  ; setup for tExternal EEPROM
        Hi2cin  eeprom_addr, (b10, b11, b12, b13, b14)   ; read 5 bytes of char data 

        IF b10 = 0 THEN Narrow1   ; found narrow char
        value = b10
        GOSUB DataToLCD
Narrow1:
        value = b11
        GOSUB DataToLCD
        value = b12
        GOSUB DataToLCD
        value = b13
        GOSUB DataToLCD
        IF b10 = 0 THEN Narrow2 ; bypass right col of narrow char
        value = b14  
        GOSUB DataToLCD 
Narrow2:        
        value = 0
        GOSUB DataToLCD          ; put a 1 bit space after char
BaleOut: RETURN
;
;---------------------------------------------------
DataToLCD:
        IF FontSize = 1 THEN DataOut
;
; here if FontSize  = 2 or 3 for double height characters         
;
        Top_byte = 0                  ; data for upper half of double height text
        Bot_byte = 0                   ; data for lower half of double height text
        FOR nybble_low = 0 TO 3  ; to check lower nybble of value
          LOOKUP Nybble_low, (3,6,12,24), temp  ; multipliers for each bit value to get double height
          temp1 = DCD Nybble_low
          temp1 = temp1 AND value
          top_byte = temp1 * temp + top_byte
          nybble_high = nybble_low + 4      ; also check top nybble of value
          temp2 = DCD nybble_high
          temp2 = temp2 AND value / $10
          bot_byte = temp2 * temp + bot_byte
        NEXT nybble_low

        PUT bot_sav_addr, bot_byte      ; bottom part of text in scratchpad
        bot_sav_addr = bot_sav_addr + 1
        value = top_byte
        IF FontSize = 2 THEN GOSUB DataOut   ; Tall & Wide (2 pixel wide lines)
                                               ;or fall thru for Tall & Narrow 
;- - - - - - - - - - - - - - - - - - - - - - - - - - - -
DataOut: HIGH DC 'Write data mode
         LOW CS
         SHIFTOUT SCLK, SDA,1,(value)
         HIGH CS
         RETURN
;
;-----------------------------------------------
Bottom: 
        y = y + 1                           ; display the bottom 1/2 of tall font
        GOSUB gotoxy
        FOR nybble_high = 0 TO bot_sav_addr    ; for each char bot byte
          GET nybble_high, value
          IF FontSize = 2 THEN GOSUB DataOut  ; Tall &d Wide
          GOSUB DataOut                 ; or fall thru for Tall & Narrow
        NEXT nybble_high
        bot_sav_addr = 0
        RETURN
;
;-------------------------------------------------
ClearFast:
        GOSUB GoToHome
        LOW SDA
        HIGH DC                             ; Write data mode
        LOW CS
        FOR Loop1   = 0 TO 101        ; 102 pixels wide
          FOR loop2 = 0 TO 8            ; 9 banks high
            SHIFTOUT SCLK, SDA,1,(0)   ; clear 
          NEXT loop2
        NEXT Loop1
        GOSUB GoToHome
        RETURN
;
;---------------------------------------------------
PlotLine:
        IF x2 < x1 THEN
          dx = x1
          dy = y1  
          x1 = x2
          y1 = y2
          x2 = dx
          y2 = dy
        ENDIF

        IF y2 < y1 THEN
          sign = 1 ; -ve slope
          dy = y1 - y2
        ELSE
          sign = 0 ; +ve slope
          dy = y2 - y1  
        ENDIF
        dx = x2 - x1
; - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - -        
        IF dy > dx THEN         ; test for steep slope
          IF y2 < y1 THEN       ; steep sloped lines handled here
            dx = x1
            dy = y1  
            x1 = x2
            y1 = y2
            x2 = dx
            y2 = dy
          ENDIF

          IF x2 < x1 THEN
            sign = 1 ; negative slope
            dx = x1 - x2
          ELSE
            sign = 0 ; positive slope
            dx = x2 - x1  
          ENDIF

          dy = y2 - y1
          slope = 100 * dx / dy       ; x 100 for accuracy to 2 d.p's 
          base = x1

          FOR loop1 = y1 to y2         ; for each pixel in the y axis   
            x1 = loop1 - y1 * slope / 100
            IF sign = 0 THEN
              x1 = base + x1
            ELSE
              x1 = base - x1  
            ENDIF

            page = loop1 / 8   ; determine which vertical page (of 8 bits) pixel is on
            pixel = loop1 // 8   ; pixel pos'n on page as bit 0 to 7
            pixel = DCD pixel    ; convert to a value 1,2,4,8,16,32,64,128

            x = x1
            y = page
            GOSUB Gotoxy                  ; move to required LCD location

            IF x = temp AND page = temp2 THEN ; if at the same byte as the last pixel or data so last pixel not lost
              pixel = pixel OR temp1
           ELSE                         ; else clear old data if a new byte location
             temp  = 255
             temp1 = 255
             temp2 = 255
            ENDIF

            temp  = x                     ; save current data for next increment in case at same byte location 
            temp1 = pixel
            temp2 = page

            value = pixel                 ; turn on the current pixel
            GOSUB Dataout

          NEXT loop1
; - - - - - - - - - - - - - - - - - - - - - - - - - - - -                
        ELSE                             ; here if it is a shallow slope line
          slope = 100 * dy / dx         ; multiplier of 100 used for accuracy to 2 decimal place
          base  =  y1

          FOR x = x1 TO x2
            y1 = x - x1 * slope /100
            IF sign = 0 THEN  
              y1 = base + y1
            ELSE
              Y1 = base - y1
            ENDIF

            page  = y1 / 8               ; determine which vertical page (of 8 bits) the pixel is on
            pixel = y1 // 8               ; pixel position on page as bit 0,1,2  . . . 7
            pixel = DCD pixel            ; convert to a value 1,2,4,8, . . . 128
;
;**************REV H EDITS ARE HERE **********
            IF loop1 = y1 THEN
              put 4, page    ; save LCD page
              put 6, x1       ; save LCD x coord
            ENDIF 

            x = x1
            y = page
            GOSUB Gotoxy   ; move to required LCD location

           get 3, x1
            IF x = temp  AND  page = temp2 THEN ; if at the same byte as the last pixel or data so last pixel not lost
              pixel = pixel OR temp1
            ELSE                            ; else clear old data if a new byte location
             temp  = 255
             temp1 = 255
             temp2 = 255
            ENDIF
            IF x1 = 55  THEN           ; if circle flag is set, then we are drawing a circle                
              get 9, x1 
              IF x = x1 THEN           ; if at last pixel(s) and in same column as prior segment
                get 7, x1            
                IF  page =  x1 THEN    ; and if last part of this segment is overlapping the start of old segment
                  get 8, temp
                  pixel = pixel OR temp  ; add in old data segement data so pixels not erased / lost      
                ENDIF
              ENDIF 
            ENDIF          
 ;**********************************************************    
 
            temp  = x                       ; save current data for next increment in case at same byte location 
            temp1 = pixel
            temp2 = page
            value = pixel 
 
           get 3,x1
            IF x1 = 55 THEN              ; when flag set for circle and it is the first part of a steep line
              get 1,x1
              IF x = x1 THEN
              get 4, x1
              IF page = x1 THEN 
                put 5, pixel              ; save LCD pixel = y coord
              ENDIF
              ENDIF                 
            ENDIF 
                  
            GOSUB Dataout    ; turn on the current pixel
 
          NEXT loop1

; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -                
        ELSE                                ; here if it is a shallow slope line
          slope = 100 * dy / dx             ; multiplier of 100 used for accuracy to 2 decimal place
          base  =  y1

          FOR x = x1 TO x2
            y1 = x - x1 * slope /100
            IF sign = 0 THEN  
              y1 = base + y1
            ELSE
              Y1 = base - y1
            ENDIF

            page  = y1 / 8                  ; determine which vertical page (of 8 bits) the pixel is on
            pixel = y1 // 8                 ; pixel position on page as bit 0,1,2  ,. . . . 7
            pixel = DCD pixel               ; convert to a value 1,2,4,8, . . . 128

            Y=page
            GOSUB Gotoxy                    ; move to required LCD location

            value = pixel
            GOSUB Dataout                   ; turn on the current pixel
          NEXT x

        ENDIF                              
 
        RETURN
;
;-----------------------------------------------------------------------------------------
 
Last edited:

westaust55

Moderator
A55 LCD Drivers Part 3 of 3

Did some work to improve circle plotting this evening.
Seems to be successful in prevent writing of new pixels erasing previous pixels on the current circle.
Have updated to program listing accordingly in the two previous posts rather than add more posts to this thread.

As this code is now running at 1322 bytes its probably big enough for now.
Plenty of room still in X1 parts for text and line/circle definintions but great care would be required for use as part of another program as all 28 (b0-b27)variables are used for the full package and have had to save some data into the scratchpad over and above holding text and circle data in the scratchpad area.

Due to limit on number of characters in a post (10,000), I have split the PLOTCIRCLE subroutine away from the rest and provide it below.
Circles are still slightly out-of-round due to the aspect ration of the pixels on the LCD module. My measurement suggests a vertical reduction of ~13.5/15 or 0.9 is required. For those with whom this is an issue, I leave it for you to adjust. Heck the ratio is likely different for the Nokia 3310 type LCD's anyway.

Enjoy and have fun . . . . . .

Code:
;---------------------------------------------------------------------
Plotcircle:
        h = x1                              ; First get and save lower and upper limits for x axis
        k = y1
        minx = h - r
        maxx = h + r
        PUT 3, 55 
        
        For loop2 = minx to maxx
          IF loop2 < h THEN
            Temp = h - loop2
          ELSE
            Temp = loop2 - h                ; = (x-h)
          ENDIF
  
          slope = temp * temp              ; = (x-h)^2 - 100 used for fractional accuracy
          slope = r * r - slope
          slope = SQR slope
          circ_y2 = slope + k               ; y for upper half of the circle
          circ_y1 = k - slope               ; hold Y for lower half of the circle
  
          IF loop2 = minx THEN
            x1 = loop2
            y1 = circ_y1
            bot_sav_addr =  10               ; calculate scratchpad address to save data for bottom half of circle
            put bot_sav_addr, circ_y2       ; save data for the bottom half of the circle
          ELSE
            x2 = loop2
            y2 = circ_y1
            put 1, x2
            put 2, y2
            bot_sav_addr = loop2 - minx + 10 ; calculate scratchpad address to save data for bottom half of circle
            put bot_sav_addr, circ_y2       ; save data for the bottom half of the circle
            GOSUB plotline:                 ; draw line segment as next part of circle - upper half
            get 1, x1
            get 2, y1
            ;*****Added in Rev H***********
           get 4, temp                       ; move newest data from segment just done
           put 7, temp                       ; to old data slot for enxt segment to do
           get 5, temp
           put 8, temp
           get 6, temp
           put 9, temp
          ;****************************
          ENDIF
        NEXT loop2
        
        For loop2 = minx to maxx            ; now draw bottom half of circle
          
          IF loop2 = minx THEN
            x1 = loop2
            bot_sav_addr =  10               ; calculate scratchpad address to fetch data for bottom half of circle
            get bot_sav_addr, y1            ; get saved  data for the bottom half of the circle
          ELSE
            x2 = loop2
            bot_sav_addr = loop2 - minx + 10 ; retrieve saved data from bottom half of circle
            get bot_sav_addr, y2
            put 1, x2
            put 2, y2
            GOSUB plotline:                 ; draw line segment as next part of circle - lower half
            get 1, x1
            get 2, y1
           
          ENDIF
        NEXT loop2
        PUT 3, 0  
        RETURN
; =============================================
;      THE END
; =============================================
 
Last edited:

westaust55

Moderator
Technical/Moderators,

Its about time to park this thread in the completed projects area.

While I am going to do a few more small things like:
1. build a small box which plugs into the expansion connector on top of my main box to house the Siemens A55 gLCD module with a thin protective film over the LCD glass
2. add some LED’s as a backlight
3. look at using a few port C signals for basic controls (to free up some “standard” outputs)
4. maybe fine-tune the software – as and when time permits

These may not happen in a hurry (plenty else to do and a trip to Canada soon :) ) and when done I may later post a few more pics/info. In the meantime there is enough information within the thread and commentary within the program that [I}almost[/I] anyone who tries to do the same should get their ex-mobile monochrome gLCD working.
 

ValueAdd

Senior Member
Hey Westy,

Before this thread does get parked, I for one would like to thank you for putting all this information up on the forum.

Like others, I have been following your progress with great interest and thoughts of using the information to do the same. Much easier when the information is presented so clearly for us newbies.
 

Michael 2727

Senior Member
Re: Wiring up a Module

I just remembered last time I saw my PC Tech up the road he was installing an
80 Strand Ribbon IDE cable on a PCs IDE to HDD. Everybody has/is going SATA these
days but someond decided in the latter days of IDE that 80 wires work better/faster than 40.
The wire is very thin 1/2 normal width, twice as many, it may be worth a go here.
I have to go see the guy tomorrow I'll see if he has a spare cable. :)
 

westaust55

Moderator
Creating Fonts and Graphics for small gLCD's

Thought others may be interested in an Excel spreadsheet I whipped up to quickly get the required values for new fonts and other graphics to use on gLCD&#8217;s such as those from Nokia and Siemens mobiles as discussed todate in this thread.

It takes away the mental maths and lets you draw your creation pictorially and then just read off the hex values.

Obviously I cannot upload an excel spreadsheet (I guess Rev Ed wish to avoid any virus) and although there are ways to get around that limitation, I won&#8217;t promote that method here.

So for those interested, I have printed out a portion of the spreadsheet showing the formula and small lookup table and a second file with an example of a portion showing what it looks like when in use.

You should be able to cut the formula from the pdf file and paste them into a spreadsheet in the same manner to make your own graphic aid. Each spreadsheet cell formula is on a single line and I have shown 3 columns here. If you create one column, you can just drag the cells along to make what ever overall width you want.

Edit:
Should mention that I use a black coloured cell with with the value 1 in it. The coloured cell gives the visual effect and the number is necessary for the calculations to work. Just create one such cell then copy (Control-C) and past (Control-V) to put the markers where you want them.
 

Attachments

Last edited:

westaust55

Moderator
gLCD graphing 101 - Part 1 of 2

Did not think I would get to this till monday but having given it some thought and typed up in word I dumped it into the PE this morning and it worked first time. So here is a little graphing routine.

I look at an analogue input with READADC for a value from 0 to 255 and display an instantaneous value and a graph shown past data.
Bit slow in PICAXE BASIC (correct time scale at bottom is more like 0 to 4 mins) but it does work. See the attached pics.
In my case I have a pot, LCD, mag field strength sensor and temp DS18B20 (okay not anologue) permanently attached to my system so several items available to graph.

Have removed the line and circle plotting routines here but still has the all the font routines - and relies on normal fonts in external EEPROM.
The program has used 67 bytes of internal EEPROM for some narrow digits and symbols as line segments for the x and y axes.
Test at the top line is in the normal 5x7 pixel font.

Code:
; =========================================================================
;   File....... A55_LCD_Driver
;   Purpose.... Siemens A55 LCD module drivers and graphing routine
;   Author..... Westaust55
;   E-mail.....
;   Started.... 23-08-2008
;   Updated.... 23-08-2008
;  ========================================================================
;
;
; -----[ Program Description ]---------------------------------------------
;
; A program to initialise the graphic LCD module from a Siemens A55 
; includes routines to display a moving graph of a varying value
; The A55 LCD module has a resolution of 101 x 64 pixels
;
; Most of this PICAXE BASIC programming can also be used for the
; Nokia 3310 type LCD displays
;
; -----[ Revision History ]------------------------------------------------
;
;A  23-08-2008 Use Std LCD init routines. 
;              Started - routines to display text and graph
; 
;
; -----[ I/O Definitions ]-------------------------------------------------
;
; - - - DIGITAL INPUT PINS  - - -
SYMBOL key_data = 0         ; keypad serial data input
;intrpt val_data =1         ; keypad valid data signal
SYMBOL tempsens = 2         ; DS18B20 temp sensor data input
SYMBOL irdetect = 3         ; infrared detector data input
;
; - - - DIGITAL OUTPUT PINS - - -
SYMBOL speaker  = 0         ; piezo speaker output;
SYMBOL lcd_data = 1         ; serial data to LCD display
SYMBOL ir_outpt = 2         ; infrared LED data output
;
; below outputs are specific to the A55 LCD module control/data
;
SYMBOL SCLK     = 3 'PICAXE out 3 To A55 LCD Display pin 2
SYMBOL SDA      = 4 'PICAXE out 4 To A55 LCD Display pin 3
SYMBOL DC       = 5 'PICAXE out 5 To A55 LCD Display pin 4
SYMBOL CS       = 6 'PICAXE out 6 To A55 LCD Display pin 5
SYMBOL RES      = 7 'PICAXE out 7 To A55 LCD Display pin 8
;
; - - - ANALOGUE INPUT PINS  - - -
SYMBOL adc_pot = 5          ; potentiometer analogue input
SYMBOL adc_ldr = 6          ; light dependant resistor analogue input
SYMBOL adc_mag = 7          ; hall effect magnetic field sensor analogue input
;
;
; -----[ i2c Device Addressing ]-------------------------------------------------------
;
; 24LC256 External EEPROM's
SYMBOL eeprom_0 = %10100000  ; %1010 = EPROM, 000 = Addr 0 & 0 = control bit
;
; PCF8574 8-BIT IO EXPANDERS
SYMBOL expand_0 = %01000000  ; %0100 = Chip ID, 000 = Addr 0 - For the 8 Red LED's
SYMBOL expand_1 = %01000010  ;                , 001 = Addr 1 - For Keypad Shift LED
;
;
; -----[ Constants ]-------------------------------------------------------
;
;
; -----[ General Variables ]-------------------------------------------------------
;
; Not used after general initialisation - SPECIFIC to WESTAUST55 system
;
SYMBOL pattern     = b23     ; 8 bit pattern to be sent to the  8 x LED's
SYMBOL shflock     = b25     ; Flag to indicate if shiftlock is ON/OFF
;
;
; -----[ Graphic LCD Specific Variables ]-------------------------------------------------------
SYMBOL value       = b0
SYMBOL pointer     = b1
SYMBOL x           = b2
SYMBOL y           = b3
SYMBOL temp        = b4
SYMBOL temp1       = b5
SYMBOL eeprom_addr = w3    ; w3 = b7 + b6
SYMBOL loop1       = b8
SYMBOL loop2       = b9
; NOTE: b10, b11, b12, b13 & b14 used for reading from external EEPROM
;
; these (below) are only used mainly for double height font display
SYMBOL nybble_low  = b8
SYMBOL nybble_high = b9
SYMBOL fontsize    = b15
SYMBOL top_byte    = b16
SYMBOL bot_byte    = b17
SYMBOL bot_sav_addr = b19
SYMBOL temp2       = b18


SYMBOL analogue    = w10   ; w10 = b21 + b20
SYMBOL loop3       = w11   ; w11 = b23 + b22       
SYMBOL newest      = b24
SYMBOL maxy        = b25
SYMBOL pixel       = b26
SYMBOL temp4      = b27
;
;
; 
; -----[ EEPROM Data ]-----------------------------------------------------
;
EEPROM ($3E, $41, $41, $3E) ; 0
EEPROM ($00, $42, $7F, $40) ; 1
EEPROM ($62, $51, $49, $46) ; 2
EEPROM ($49, $49, $49, $36) ; 3
EEPROM ($1F, $10, $10, $7C) ; 4
EEPROM ($4F, $49, $49, $31) ; 5
EEPROM ($3E, $49, $49, $31) ; 6
EEPROM ($61, $11, $09, $07) ; 7
EEPROM ($36, $49, $49, $36) ; 8
EEPROM ($46, $49, $49, $3E) ; 9
EEPROM ($00, $5C, $54, $74, $00, $7C, $54, $5C, $00, $7C, $44, $44) ; sec
EEPROM ($00, $02, $02, $7F) ; bottom left corner
EEPROM ($02, $02, $02, $02) ; horiz axis straight
EEPROM ($02, $02, $02, $7E) ; horiz axis with marker
EEPROM ($00, $02, $02, $FF) ; vert axis with marker
;
; -----[ Initialization ]--------------------------------------------------
;
Init:                        ; This is specific to Westaust55's system to turn off some LED's
       pattern = 0           ; Set to clear all 8 red LED's to OFF
       GOSUB Pattn2led
       shflock = 0           ; Set the SHIFTLOCK green LED to OFF
       GOSUB Shlok2led
       PAUSE 100
;
;
; -----[ Program Code ]----------------------------------------------------
;
Main:	  PAUSE   2000 
        SETFREQ m8
 
        GOSUB InitLCD
        
        GOSUB ClearBuffer
                
        GOSUB Plotaxes
        x = 18
        y = 0
        GOSUB gotoxy
        fontsize = 1
        FOR pointer = 0 TO 6
          LOOKUP pointer,("Volts = "), value
          GOSUB CharToLCD
        NEXT
        
        
        For loop3 = 1 to 10000
        READADC adc_pot, newest

        x = 66
        y = 0
        GOSUB gotoxy
        
        GOSUB DisplayNew
        
        GOSUB NewesttoBuffer
       
        GOSUB PlotGraph
          
        NEXT loop3
        
        
        PAUSE 5000
        GOSUB Invert
        PAUSE 5000
        GOSUB Normal

        SETFREQ m4
        STOP
        END

;
; -----[ Subroutines ]-----------------------------------------------------
;
Pattn2led:         ; this routine is specific to Westuast55's system - not reuqired by others
           HI2CSETUP  i2cmaster, expand_0, i2cfast, i2cbyte
           HI2COUT (pattern)
           RETURN
;
Shlok2led:         ; this routine is specific to Westuast55's system - not reuqired by others
           HI2CSETUP  i2cmaster, expand_1, i2cfast, i2cbyte
           HI2COUT (shflock)
           RETURN
; ------------------------------------------------------------------------
;
InitLCD:
        LOW SCLK
        LOW SDA
        LOW DC
        LOW CS
        LOW RES
        PAUSE 50
        HIGH RES
        HIGH CS

        value=$21          ; $21 ==> H=1 and function set = chip active, horiz addressing & extended instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$08          ; Set HV multiplier = x 2.              For $09 = x3 set Vop at ~$C6 otherwise gives black screen
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$F0          ; set Vop with (PRS = 0 Vlcd = 2.94V TO 6.75V)      If HV mult = $08 then use ~$C6
                           ; $E0=5.28V, $F0=6.3V, $FF = 6.72V  NOTE max allowed is 9V
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$16          ; set bias: $16 ==> n=1 FOR mux rate 1:18 or 1:16 NOTE: n = 2 and n=5 DO NOT work
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$06          ; set temperature coefficient = 2
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$20          ; $20 ==> H=0 and function set = FOR basic instruction set
        GOSUB CommandToLCD ; transmit To serial LCD module

        value=$0C          ; display config =  display non-inverted
        GOSUB CommandToLCD ; transmit To serial LCD module

        GOSUB ClearFast
        GOSUB Normal
        RETURN
;---------------------------------------------------- 
Invert:
        Value = 13        ; invert the display light chars on dark background
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
Normal:
        Value = 12        ; normal diplay with dark chars on light background
        GOSUB CommandToLCD
        RETURN
;---------------------------------------------------- 
GoToHome:
        x = 0
        y = 0
GotoXY:
        value = x + 128     ; 128 part = X address command 
        GOSUB CommandToLCD
        value = y + 64      ;  64 part = Y address command
        GOSUB CommandToLCD
        RETURN
;----------------------------------------------------

CommandToLCD:
        LOW DC    ; Command mode
        LOW CS
        SHIFTOUT SCLK, SDA,1,(value)
        HIGH CS
        RETURN
;
;----------------------------------------------------
 

Attachments

Last edited:

westaust55

Moderator
gLCD graphing 101 - part 2 of 2

Code:
;
;----------------------------------------------------
CharToLCD:
        IF value = $FF AND fontsize > 1 THEN Bottom  ; $FF is flag that text string is complete

;   NOTE:  If using PICAXE internal EEPROM for font set then modify the next seven lines of code
;
        IF value < $20 OR  value > $AF  THEN BaleOut ; outside the font set range
                                                     ; $20 to $7F for Std chars and  $80 to $AF for Greek alphabet

        value = value - $20                          ; now compute external EEPROM address for character data
        temp = value / 12
        temp = temp * 4
        eeprom_addr = value * 5 + temp + 512 
        
        Hi2csetup i2cmaster, EEPROM_0, i2cfast, i2cword  ; setup for the External EEPROM
        Hi2cin  eeprom_addr, (b10, b11, b12, b13, b14)   ; read 5 bytes of character data from the EEPROM
                
        IF b10 = 0 THEN Narrow1   ; found a narrow character
        value = b10
        GOSUB DataToLCD
Narrow1:
        value = b11
        GOSUB DataToLCD
        value = b12
        GOSUB DataToLCD
        value = b13
        GOSUB DataToLCD
        IF b10 = 0 THEN Narrow2   ; bypass the blank right most column of narrow character
        value = b14  
        GOSUB DataToLCD 
Narrow2:        
        value = 0
        GOSUB DataToLCD           ; put a 1 bit space after each character for clarity
BaleOut: RETURN
;
;----------------------------------------------------------------------------------------
;
DataToLCD:
        IF FontSize = 1 THEN DataOut
;
; here if FontSize  = 2 or 3 for double height characters         
;
        Top_byte = 0                            ; holds data for upper half of double height text
        Bot_byte = 0                            ; holds data for lower half of double height text
        FOR nybble_low = 0 TO 3                 ; to check lower 4-bit nybble of value
          LOOKUP Nybble_low, (3,6,12,24), temp  ; multipliers to multiply each bit value by to get double height
          temp1 = DCD Nybble_low
          temp1 = temp1 AND value
          top_byte = temp1 * temp + top_byte
          nybble_high = nybble_low + 4          ; also checking top 4-bit nybble of value
          temp2 = DCD nybble_high
          temp2 = temp2 AND value / $10
          bot_byte = temp2 * temp + bot_byte
        NEXT nybble_low
        
        PUT bot_sav_addr, bot_byte                     ; save bottom part of text in scratchpad
        bot_sav_addr = bot_sav_addr + 1
        value = top_byte
        IF FontSize = 2 THEN GOSUB DataOut      ; Tall & Wide (needs two pixel wide lines)
                                                 ;or fall thru for Tall and Narrow 
;
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -                 
DataOut: HIGH DC 'Write data mode
         LOW CS
         SHIFTOUT SCLK, SDA,1,(value)
         HIGH CS
         RETURN
;
;----------------------------------------------------------------------------------------
;
Bottom: y = y + 1                             ; here to display the bottom half of tall fonts
        GOSUB gotoxy
        FOR nybble_high = 0 TO bot_sav_addr         ; for each char bottom byte
          GET nybble_high, value
          IF FontSize = 2 THEN GOSUB DataOut  ; Tall and Wide
          GOSUB DataOut                       ; or fall thru for Tall and Narrow
        NEXT nybble_high
        bot_sav_addr = 0
        RETURN
;
;----------------------------------------------------------------------------------------
;
ClearFast:
        GOSUB GoToHome
        LOW SDA
        HIGH DC                               ; Write data mode
        LOW CS
        FOR Loop1   = 0 TO 101                ; 102 pixels wide
          FOR loop2 = 0 TO 8                  ; 9 banks high
            SHIFTOUT SCLK, SDA,1,(0)          ; output 0's TO clear screen
          NEXT loop2
        NEXT Loop1
        GOSUB GoToHome
        RETURN
;
;----------------------------------------------------------------------------------------
;
PlotAxes:                          ; draw the x and y axis with scales  - for Nokia 3310 needs some rework 
        FOR y = 0 to 5             ; draw main part of the y-axis 
          pointer = 6 - y
          temp = pointer / 2 * 2
          IF temp = pointer THEN
            x = 0
            GOSUB gotoxy
            pointer = pointer *4
            FOR loop1 = 0 to 3       ; get y-axis scale number
              READ pointer, value
              GOSUB DataOut           ; print the scale number data at alternate ticks
              pointer = pointer + 1
            NEXT loop1
          ELSE
            x = 4
            GOSUB gotoxy
          ENDIF
          pointer = 64
          FOR loop1 = 0 to 3       ; get y-axis segment with tick marker
            READ pointer, value
            GOSUB DataOut           ; print the scale number data
            pointer = pointer + 1
          NEXT loop1
        NEXT y
        
        x = 0                       ; set postion for x-axis
        y = 6
        GOSUB gotoxy
        FOR loop1 = 0 to 24        ; draw the x axis with a "tick" mark every 20 pixels
          pointer = 56
          IF loop1 = 0 THEN
          pointer = 0
          ELSEIF loop1 = 1 THEN
            pointer = 52
          ELSE IF loop1 = 6 OR loop1 = 11 OR loop1 = 16 OR loop1 = 21 THEN
            pointer = 60
          ENDIF
          FOR loop2 = 0 TO 3       ; draw a segment of the x-axis
            READ pointer, value
            GOSUB DataOut
            pointer = pointer + 1
          NEXT loop2
        NEXT loop1
        
        y = 7                     ; put numbers below x-axis 
        FOR loop1 = 0 TO 4
          temp = loop1 / 2
          x = loop1 * 20 + 7 - temp
          GOSUB gotoXY
        
          pointer = loop1 * 2       
          pointer = 8 - pointer * 4
        
          FOR loop2 = 0 TO 3        ; output data for 1 character
            READ pointer, value
            GOSUB DataOut
            pointer = pointer + 1
          NEXT loop2
        NEXT loop1
        pointer = 40
        FOR loop2 = 0 TO 11       ; put "sec" at right hand end
          READ pointer, value
          GOSUB DataOut
          pointer = pointer + 1
        NEXT loop2
        RETURN
;
;----------------------------------------------------------------------------------------
;
ClearBuffer:
       value = 39            ; for Nokia 3310 change 39 to lower value
       FOR loop1 = 10 TO 100 ; clear 100 bytes - for Nokia 3310 change to 84
         PUT loop1, value
       NEXT loop1
       RETURN
;
;----------------------------------------------------------------------------------------
;
NewesttoBuffer:                ; data is scaled here going into the buffer so only need to do calcs once
        FOR loop1 = 10 TO 99 ; scroll buffer 1 byte down - for Nokia 3310 change to 83
          temp = loop1 + 1
          GET temp,  value
          PUT loop1, value
        NEXT loop1
        analogue = newest * 39 / 255  ; for Nokia 3310 change all 39 to lower value eg 23
        IF analogue >39 THEN
          analogue = 39
        ENDIF  
        value = 39 - analogue
        PUT 100, value     ; and then put pre-scaled new value into buffer
        RETURN
;
;----------------------------------------------------------------------------------------
;
; not used as yet - intended for dynamic y-axis scaling
;
FindMax:
       maxy = 0
       For loop1 = 10 To 100 ; - for Nokia 3310 change to 99
         GET loop1, value
         IF Value > maxy THEN
           maxy = value
         ENDIF
       NEXT loop1
       RETURN
;
;----------------------------------------------------------------------------------------
;
DisplayNew:                            ; this displays the instantaneous value at top of LCD
        analogue = newest * 100 / 51
        value = analogue / 100 + $30
        GOSUB CharToLCD
        value = $2E
        GOSUB CharToLCD
        temp4 = analogue // 100
        value =  temp4 / 10 + $30
        GOSUB CharToLCD
        value = temp4 // 10 + $30
        GOSUB CharToLCD
        value = $20                  ; extra space needed due to psuedo proportional fonts
        GOSUB CharToLCD
        RETURN
;
;----------------------------------------------------------------------------------------
;
PlotGraph:
  value = $22                ; switch to vertical plotting mode 
  GOSUB CommandToLCD
  temp4 = 0
  FOR x = 10TO 100      ; for each column in the graphing area
    FOR loop1 = 1 TO 5   ; clear the entire buffer for the current column buffer
      PUT loop1, 0
    NEXT loop1
    GET x, value       ; fetch the value from the main graphing buffer
    y = value / 8 + 1   ; the page in which the pixel is to be set to ON
    pixel = value // 8   ; determine which page of the LCD the pixel is on
    value = DCD pixel   ; calculate the value represent the pixel within the byte (8-bits)
    PUT y, value            ; set the current bit for this column on and all others are off
    y = 1
    GOSUB gotoxy      ; position to top of current row
    FOR loop1 = 1 TO 5  ; output each of the 5 bytes to redraw the current graph area column
      GET loop1, value    ; fetch each byte of data from scratchpad column buffer
      GOSUB DataOut    ; put the data for the current column to the display
    NEXT loop1
  NEXT x
  value = $20                ; finished graphing for now, so switch to horizontal plotting mode 
  GOSUB CommandToLCD
  RETURN
; =================================================
;      THE END
; =================================================
 
Last edited:

westaust55

Moderator
faster plotting of graphing portion

I have tweaked/optimised the PlotGraph subroutine to speed up the plotting process a bit.

The following subroutine is a drop in replacement for that in the previous post. It occupies 18 bytes more but improves the time by 30%.

By comparison and using the x-axis scaling as supplied in the earlier code, it originally took 230 seconds (3min 50sec) to move from the 0sec to the 8 sec mark. The optimised code takes just 160 seconds (2min 40 sec).

Code:
;
;----------------------------------------------------------------------------------------
;
PlotGraph:
  value = $22            ; switch to vertical plotting mode 
  GOSUB CommandToLCD
    
  FOR x = 10 TO 100      ; for each column of the 90 pixel wide graphing area
    
    FOR loop1 = 1 TO 5   ; clear the column buffer ready for the current column
      PUT loop1, 0
    NEXT loop1

    GET x, value        ; fetch the value from current colum from the main graphing buffer
    y = value / 8 + 1   ;  calculate the page in which the pixel is to be set to ON
    pixel = value // 8  ; determine which pixel on this page of the LCD is on
    value = DCD pixel   ; calculate the value represent the pixel within the byte (8-bits)
    PUT y, value        ; set the current bit for this column on and all others are off
  
    LOW CS    
    
    LOW DC              ; Command mode - to set go to move pointer
    value = x + 128     ; 128 part = X address command     
    SHIFTOUT SCLK, SDA,1,(value)
     
    SHIFTOUT SCLK, SDA,1,(65) ; y is always in page 1 
    
    HIGH DC             ; Write data mode
    FOR loop1 = 1 TO 5  ; output each of the 5 bytes to redraw the current graph area column
      GET loop1, value  ; fetch each byte of data from scratchpad column buffer
      SHIFTOUT SCLK, SDA, 1, (value)    ;  put the data for the current column to the display
    NEXT loop1
    HIGH CS
  NEXT x
  value = $20           ; finished graphing for now, so switch to horizontal plotting mode 
  GOSUB CommandToLCD
  RETURN
;
;-----------------------------------------------------------------------------------------
 
Last edited:

marcos.placona

Senior Member
What an excellent job! Congratulations for that. I've been feeling tempted to get one of this LCD's since I started to read your posts here :D

Keep the great job mate!
 

westaust55

Moderator
Siemens A55 - compass indicator

Decided to have a go and create a compass like display on the gLCD as an indicator to go with the CMPS03 compass module

Without sufficient RAM/scratchpad memory, it is not possible to store the location of all pixels or draw overlapping lines. Even close lines may partly erase an existing line due to data being written in bytes. As such, for now I perceive that the only way to do this is define a series of images that can be "drawn" on the gLCD as required for the compass. I am looking to define say 32 images for this purpose.

Aim will be to have a circle 48 pixels high (so will work on the Nokia 3310 gLCD as well). On my Siemens A55 LCD due to the pixel aspect ratio for 48 pixels high seems will need about 54 pixels wide to achieve a fairly circular depiction of the compass.

This will still leave some space at the side of the gLCD for a numeric value as a digital heading.

As the Nokia 3310 display is basically the same size as the Siemens A55 I think that the aspect ratio will vary and the circles could be squashed a little horizontally.

To allow for 32 images for calling up as required depending upon how I do it, in its simplest form it would take about 10kBytes of memory. Hence an external EEPROM such as the 32k 24LC256 will be essential.

Attached are some diagrams (albeit distorted to compensate for the gLCD aspect ratio) depicting the first few images.
 

Attachments

Top