Hi all,
I am trying to use this LCD, I usually use PICs but since I have some Arduino nano left over, I must say that they are even more practical than PICs, I have comfortably compiled and programmed.
This lcd has software contrast adjustment but i can't find the method to adjust it, i also read the datasheet but i didn't understand anything how to set the lcd registers.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used these about 10 years ago. You need to set the "volts".
This is an extract from my program...
subinilcdsetportc.1on'reset pinwait5mssetportc.2on'power on (LCD powered from C.2)wait5mssetportc.1off'reset pulse wait5mssetportc.1on'reset off setportc.0off'command mode 1=data,0=cmdforj=1to8readtablest1,j,dataout'initialize LCDshiftout'shift registernextjsetporte.1on'SCE pin - what does this do?endsubSubshiftoutsetporte.1offporta.7=0forkk=0to7porta.6=Dataout.7' read bit to dat pin. porta.7=1' clk high, load bit.porta.7=0'clk lowRotateDataoutleftSimple' Move to next bit in Dataout. nextkksetporte.1onEndSubtablest1'setup data b'00100001''extended instruction setb'00000110''temp coeffb'00010011''set bias n=4 for mux 1:48b'11000010''set volts alkaline 8 extra'b'11110000' 'setvoltsforNiMhb'00100000''basic instruction setb'00001100''normal modeb'10000000''set leftb'01000000''set topendtable
the important thing is in the table ST1 you can see I have two different setting for alkaline an NHMh batteries. That said don't expect much contrast from the display.
I stopped using them as they went bad - it appears that the connection from the PCD8544 to the LCD fails over time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@David Stephenson
in your code I don't really understand what I should change to vary the contrast, maybe the table values but I don't know which ones. I have several of these LCDs and they work well despite being small you can see well, the contrast seems correct but I wanted to understand how to possibly change it in the arduino C library there is a simple method with which to pass read or write a variable.
@Anobium
On this LCD the contrast management is adjusted internally by the controller through software and completely different from the HD44780 family. reading help I see that there are two commands:
GLCDWriteByte and GLCDReadByte to pass commands but I can't understand how they work. Is there any example?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The device has a charge pump to supply the LCD voltages. Depending on the supply voltage the level needs to be set so the blacks are as black as possible with the background still white.
There could be some advantage to changing the bias, but I never found much difference.
To access the charge pump you need to select the extended instruction set.
with d/c set to cmd (pin off).
send b'00100001' bit 5 selects option, bit 0 =1 puts device into extended instruction set.
send b'1,v6,v5,v4,v3,v2,v1,v0' bit 7 selects charge pump voltage, v6-v0 are the values.
send b'00100000' bit 5 again selects option and bit0=0 sets it back to normal instruction set.
set d/c back to data, and set SCE pin.
All these should be sent using I2C I was unaware of this at the time so wrote my own shift register toggling the clk pin with the data bit.
See the Philips datasheet for the full list of instructions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks David I understood something more, I also do some tests to learn something, however without changing anything (3.3V input power supply) you can see quite well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did a lot of testing today and it doesn't work.
I poked around in the library to better understand and tried some internal subs:
contrast= 20 ' default(20) (min=16 - max=23)
ExtendedCommand_PCD8544 (contrast) 'it does not work
Write_Command_PCD8544(0x21)
Write_Command_PCD8544(contrast) 'SET contrast Bias system
Write_Command_PCD8544(0x20)
this works fine, i don't know why !!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you are going into the extended commands (by entering 0x21).
sending 128-255 (in extended command) will set the charge pump voltage.
If calling "contrast" sets bit7=1 then the allowed values are 1-127, you may notice in my program I am sending 112 to deal with 2.4V from 2xNiMh cells (so clearly 16-23 is not correct or is that for 5V operation?).
Where's the help file for this library?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ExtendedCommand_PCD8544 is not documented so that tells me that the method has not been tested / was not tested.
This may work based on Gigi's experience.
subExtendedCommand_PCD8544(in_PCD8544SendByte)Write_Command_PCD8544(0x21); LCD Extended Commands..Write_Command_PCD8544(_PCD8544SendByte); Set PCD8544SendByteWrite_Command_PCD8544(0x20); LCD Standard Commands..endsub
Last edit: Anobium 2022-05-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm sorry if it seems like I'm nitpicking (again), but if I go to http://gcbasic.sourceforge.net/help/
then type in the search box pcd8544 it returns no results.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use arduino nano 5V, GLCD PCD8544 3.3V from arduino.
From datasheett use byte:
Bias system 0 0 0 0 .1 0 BS2 BS1 BS0 set Bias System (BSx)
bit4=1 set contrast bit 0,1,2
to send use of the undocumented but freely available GLCD sub GCB library
glcd_pcd8544.h
--
contrast= 20 ' default(20) (min=16 - max=23)
Write_Command_PCD8544(0x21) ' LCD Extended Commands
Write_Command_PCD8544(contrast) 'SET contrast Bias system
Write_Command_PCD8544(0x20) ' LCD Standard Commands
No use: Write_Command_PCD8544(0x0C)
No use: ExtendedCommand_PCD8544 ( in PCD8544SendByte )
Practically sub Write_Command_PCD8544(byte) it should send I2C data
If you have the opportunity to do some confirmation tests
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
subExtendedCommand_PCD8544(inPCD8544SendExtendedByteasByte)Write_Command_PCD8544(0x21); LCD Extended Commands..Write_Command_PCD8544(PCD8544SendExtendedByte); Set PCD8544SendByteWrite_Command_PCD8544(0x20); LCD Standard Commands..endsub
The issue was the variable name was clashing with another sub routine. All is good. I know this because I got my PCD8455 Test bed out, and, it works!
I will update the library today.
Worthy of note. The contrast control only works only new PCD8455 ICs; The original phone GLCDs do not support contrast - I can see this on the test bed as the test bed has multiple PCD8455 displays so I can test properly.
OK OK OK
You were right to test the operation, I have never used graphic displays always the old ones HD447870.
In fact I suspected that something was interfering but I am not able to understand.
Anobium you are truly a great person available and prepared.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I am trying to use this LCD, I usually use PICs but since I have some Arduino nano left over, I must say that they are even more practical than PICs, I have comfortably compiled and programmed.
This lcd has software contrast adjustment but i can't find the method to adjust it, i also read the datasheet but i didn't understand anything how to set the lcd registers.
Thanks
I used these about 10 years ago. You need to set the "volts".
This is an extract from my program...
the important thing is in the table ST1 you can see I have two different setting for alkaline an NHMh batteries. That said don't expect much contrast from the display.
I stopped using them as they went bad - it appears that the connection from the PCD8544 to the LCD fails over time.
Are simply trying to control the contrast? use PWM
See https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/master/Vendor_Boards/Arduino_LCD_Shields/Full_Demo_of_LCD_Shield_Capabilities_mega328p.gcb
@David Stephenson
in your code I don't really understand what I should change to vary the contrast, maybe the table values but I don't know which ones. I have several of these LCDs and they work well despite being small you can see well, the contrast seems correct but I wanted to understand how to possibly change it in the arduino C library there is a simple method with which to pass read or write a variable.
@Anobium
On this LCD the contrast management is adjusted internally by the controller through software and completely different from the HD44780 family. reading help I see that there are two commands:
GLCDWriteByte and GLCDReadByte to pass commands but I can't understand how they work. Is there any example?
The device has a charge pump to supply the LCD voltages. Depending on the supply voltage the level needs to be set so the blacks are as black as possible with the background still white.
There could be some advantage to changing the bias, but I never found much difference.
To access the charge pump you need to select the extended instruction set.
with d/c set to cmd (pin off).
send b'00100001' bit 5 selects option, bit 0 =1 puts device into extended instruction set.
send b'1,v6,v5,v4,v3,v2,v1,v0' bit 7 selects charge pump voltage, v6-v0 are the values.
send b'00100000' bit 5 again selects option and bit0=0 sets it back to normal instruction set.
set d/c back to data, and set SCE pin.
All these should be sent using I2C I was unaware of this at the time so wrote my own shift register toggling the clk pin with the data bit.
See the Philips datasheet for the full list of instructions.
I am certain there are standard LCD controls for this.
What the URL to the correct datasheet for your type of LCD ?
Thanks David I understood something more, I also do some tests to learn something, however without changing anything (3.3V input power supply) you can see quite well.
@Anobium
https://www.sparkfun.com/datasheets/LCD/Monochrome/Nokia5110.pdf
Thank you - this was my first GLCD library!
Use
ExtendedCommand_PCD8544 ( PCD8544SendByte )
where'Temperature control 0 0 0 0 0 0 1 TC1 TC0 sets the temperature Coefficient (TCx)
So, you send 0b100. 0b101. 0b110 or 0b111 to set the temperature Coefficient
I did a lot of testing today and it doesn't work.
I poked around in the library to better understand and tried some internal subs:
contrast= 20 ' default(20) (min=16 - max=23)
ExtendedCommand_PCD8544 (contrast) 'it does not work
Write_Command_PCD8544(0x21)
Write_Command_PCD8544(contrast) 'SET contrast Bias system
Write_Command_PCD8544(0x20)
this works fine, i don't know why !!!
If it works... then, job done! Well done.
If you are going into the extended commands (by entering 0x21).
sending 128-255 (in extended command) will set the charge pump voltage.
If calling "contrast" sets bit7=1 then the allowed values are 1-127, you may notice in my program I am sending 112 to deal with 2.4V from 2xNiMh cells (so clearly 16-23 is not correct or is that for 5V operation?).
Where's the help file for this library?
Help file? In the Help. See the Windows Help, http://gcbasic.sourceforge.net/help/_pcd8544_controllers.html or any of the Help formats.
ExtendedCommand_PCD8544 is not documented so that tells me that the method has not been tested / was not tested.
This may work based on Gigi's experience.
Last edit: Anobium 2022-05-31
I'm sorry if it seems like I'm nitpicking (again), but if I go to http://gcbasic.sourceforge.net/help/
then type in the search box pcd8544 it returns no results.
Works here.
Is the search case sensitive?
Interesting... if I put in pcd85 I get no matches, yet if I put in pcd8544 it gives the expected result - strange.
The website search could be improved. Way beyond my abilities to resolve.
I use arduino nano 5V, GLCD PCD8544 3.3V from arduino.
From datasheett use byte:
Bias system 0 0 0 0 .1 0 BS2 BS1 BS0 set Bias System (BSx)
bit4=1 set contrast bit 0,1,2
to send use of the undocumented but freely available GLCD sub GCB library
glcd_pcd8544.h
--
contrast= 20 ' default(20) (min=16 - max=23)
Write_Command_PCD8544(0x21) ' LCD Extended Commands
Write_Command_PCD8544(contrast) 'SET contrast Bias system
Write_Command_PCD8544(0x20) ' LCD Standard Commands
No use: Write_Command_PCD8544(0x0C)
No use: ExtendedCommand_PCD8544 ( in PCD8544SendByte )
Practically sub Write_Command_PCD8544(byte) it should send I2C data
If you have the opportunity to do some confirmation tests
The correct sub follows:
The issue was the variable name was clashing with another sub routine. All is good. I know this because I got my PCD8455 Test bed out, and, it works!
I will update the library today.
Worthy of note. The contrast control only works only new PCD8455 ICs; The original phone GLCDs do not support contrast - I can see this on the test bed as the test bed has multiple PCD8455 displays so I can test properly.
Anyway.. the new library is here. https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/glcd_PCD8544.h?format=raw
And, I am very pleased that the demo from 2014 worked! No changes. I am pleased!
OK OK OK
You were right to test the operation, I have never used graphic displays always the old ones HD447870.
In fact I suspected that something was interfering but I am not able to understand.
Anobium you are truly a great person available and prepared.
My pleasure. Do enjoy!