I have built a 2-line interface for a 2 x 16 LCD display (based on the old 74LS174), and it works fine, except for custom characters. I wrote the following simple program to create and then display a custom character, based on a program in the help file, but all I get is a blank screen. I have been able to verify that the array elements exist, but do not know why they are either not being copied to the LCD controller, or just not displayed. I am using what I believe is the most recent lcd.h file, dated 8-17-2014. Any help would be appreciated.
@Jack. A simple question. Can you confirm normal string handling works? I built a 74LS174 LCD solution last week and all was OK, but, I did not try LCDCreateChar. Please confirm normal operations is ok.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
HiAnobium.Thanksforthereply.Iaddedabittothecodetoshowstringhandlingworks,andthatIcanprintelementsofthearray.InotehoweverthatthesamecodeplacedaftertheLCDCreateCharcommandyieldsnothing.Infact,thescreenwon’tevenclearafterthatcommand.Isthisaclue?;Createanddisplayacustomcharacter#chip12F683,8;PIC12F683runningat8MHz#configmclr=on;resethandledmanually#configosc=int;useinternalclock#defineLCD_IO2#defineLCD_DBGPIO.0;shiftregisterdataonGP0,pin7#defineLCD_CBGPIO.1;shiftregisterclockonGP1,pin6DimTempArray(8)Dimcntasbyte'SetthearraytoholdthecharacterTempArray(1)=0b00011011TempArray(2)=0b00011011TempArray(3)=0b00000000TempArray(4)=0b00000100TempArray(5)=0b00000000TempArray(6)=0b00010001TempArray(7)=0b00010001TempArray(8)=0b00001110CLSPrint"A string works";ThisisseenontheLCDLocate1,0wait2sForcnt=1to8PrintTempArray(cnt);soaretheseNextwait2s'CopythecharacterfromthearraytotheLCDLCDCreateChar0,TempArray()CLSPrint"This one won't";Thisdoesn'tshowLocate1,0wait2sForcnt=1to8PrintTempArray(cnt);NordotheseNextwait2sCLS'DrawthecustomcharacterLCDWriteChar0;Nordoesthis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Anobium,
I think I may have figured out why custom characters do not work on a 2-wire LCD setup; RW is grounded, thus cannot be used for read/write operations. Am I on the right track?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have built a 2-line interface for a 2 x 16 LCD display (based on the old 74LS174), and it works fine, except for custom characters. I wrote the following simple program to create and then display a custom character, based on a program in the help file, but all I get is a blank screen. I have been able to verify that the array elements exist, but do not know why they are either not being copied to the LCD controller, or just not displayed. I am using what I believe is the most recent lcd.h file, dated 8-17-2014. Any help would be appreciated.
Last edit: Anobium 2014-10-16
@Jack.
This solution is 'based on the old 74LS174' approach. What is the configuration so I can build something similar?
:-)
@Jack. A simple question. Can you confirm normal string handling works? I built a 74LS174 LCD solution last week and all was OK, but, I did not try LCDCreateChar. Please confirm normal operations is ok.
I have tested on a LCD_IO 4 and all is good.
Please try this. Let me know the results. Add this to your program. It will redirect the method while we determine the root cause.
~~~~
define LCDCreateChar myLCDCreateChar
'Create a custom character in CGRAM
sub myLCDCreateChar (In LCDCharLoc, LCDCharData())
end sub
Hi Anobium,
I think I may have figured out why custom characters do not work on a 2-wire LCD setup; RW is grounded, thus cannot be used for read/write operations. Am I on the right track?
That is probably the answer!!
Well done.
I will add to Help File.
We learn something new every day.
:-)