Problem using LCDdemo in Object Library
kenmac
Posts: 96
Hi folks,
I wanted to test the use of a 2 x 16 LCD on the Prop, so I tried the object that seemed most suitable, although it was really intended for a 4 x 16 LCD.
I used DemoLCD.spin/LCDdemo.spin from the library.
With everything connected correctly and using a known "OK" LCD, I couldn't get any response at all.
Although the program was meant for 4 line LCD's, it should have displayed something.
So, I had a closer look at the LCDdemo.spin and found a couple of what looked like errors.
First was in the CON block, defining the data group - it didn't match the actual connections!
According to me, it should read msb = 0, lsb = 3 (data bits were reversed)
"
The second was in the 'PUB init' block - I cross-checked with some Picbasic code which does the same job, and found that another command was required.
The following command line should be inserted above the current first command line:
commandOut(40) '4bitmode, 2lines, 5x7 format.
I edited the file accordingly, and loaded the main file - result is a working LCD!
The original file was more designed to show off the functions of an LCD, rather than a basic test.
I have made a simplified version for myself to just display text on the two lines to confirm the operation is OK.
It is named testLCD_2x16_4bit.spin and should be attached to this post.
kenmac
I wanted to test the use of a 2 x 16 LCD on the Prop, so I tried the object that seemed most suitable, although it was really intended for a 4 x 16 LCD.
I used DemoLCD.spin/LCDdemo.spin from the library.
With everything connected correctly and using a known "OK" LCD, I couldn't get any response at all.
Although the program was meant for 4 line LCD's, it should have displayed something.
So, I had a closer look at the LCDdemo.spin and found a couple of what looked like errors.
First was in the CON block, defining the data group - it didn't match the actual connections!
According to me, it should read msb = 0, lsb = 3 (data bits were reversed)
"
The second was in the 'PUB init' block - I cross-checked with some Picbasic code which does the same job, and found that another command was required.
The following command line should be inserted above the current first command line:
commandOut(40) '4bitmode, 2lines, 5x7 format.
I edited the file accordingly, and loaded the main file - result is a working LCD!
The original file was more designed to show off the functions of an LCD, rather than a basic test.
I have made a simplified version for myself to just display text on the two lines to confirm the operation is OK.
It is named testLCD_2x16_4bit.spin and should be attached to this post.
kenmac
Comments
Try modifying this object:
Debug_LCD Test.spin
It works just fine on my 4 X 20 LCD
but the 2 x 16 may have a completeky different protocal.
If I were you, I would just call Parallax on the phone.
Richard
It was just luck that I picked that particular file to try.
The Library file was actually DEMOLCD.zip, which holds the files that were used.
I'm happy that I managed to get it working, to prove the method of using the Prop.
The LCD can now be incorporated into a small project that I am planning.
kenmac
All I have is a spin file for the parallax lcds... Interesting... [noparse]:([/noparse]