LCD Problem
idbruce
Posts: 6,197
Hello
When I reboot the Propeller chip, the top row of my 2 X 20 LCD displays 20 black boxes instead of the intended text. If I start the Propeller chip normally, the LCD works just fine. I am using the LCD_16x2_4bit object, which is attached below. I have tried clearing the LCD before the reboot, and I have also tried a WAITCNT before reboot, with no success. I am using the following code:
Thanks
Bruce
When I reboot the Propeller chip, the top row of my 2 X 20 LCD displays 20 black boxes instead of the intended text. If I start the Propeller chip normally, the LCD works just fine. I am using the LCD_16x2_4bit object, which is attached below. I have tried clearing the LCD before the reboot, and I have also tried a WAITCNT before reboot, with no success. I am using the following code:
IF MonitorStartButton == TRUE LCD.Clear ELSE LCD.Clear WAITCNT(CLKFREQ + CNT) REBOOT
Thanks
Bruce
Comments
Robert
I am simply calling reboot with no power cycling as shown above. Additionally, there is 3 second WAITCNT following the call to the Start method to the LCD object.
Bruce
I still have your object tucked safely away. If I can't resolve this, I will definitely be trying yours. However, it would now be quite time consuming.
Bruce
There really isn't a whole lot of PUB methods with this driver, but I don't need anything complicated. I am only using the following public methods.
- Start
- Clear
- Move
- Dec
- Str
I appreciate the offer, however I wouldn't want you to go through that just for me. I don't really need to reboot, it was just an easy option for reinitializing my variables and going back to the beginning of program execution. I think I could write the code to eliminate the reboot, but as you know, stuff like that takes time. Since it is my project, I think it would be better if I used my time, instead of wasting yours.Bruce
here's the deal: I wrote it, you test it ;o)
It's hacked together from the driver you have and from the demo-code of my driver and it's totally untested, I only checked that it compiles.
I have to leave soon, so if you find bugs I can fix them in 1 or 2 hours.
PS: The only thing you have to change in your code is to call start with the base of the used pins.
Standard Hitachi compatible LCD initialize on power up.
When initialized it will display the first row as observed.
( This is the time you adjust your back-light )
This is all internal initialization and uses various time delay to accomplish this.
Your initialization software needs to wait for this power up initialization.
The problem occurs when the propeller is resetted by a software reset. The LCD should not do a power up in this case.
With my driver everything is fine and there the PINs are also floating during reboot.
The INIT is done in a way that only works if the display is in 8 bit mode, which is the default after power-up.
@bruce:
I tested my code now and it works as posted above. I also tried the reboot instructions and I don't have a problem with my display.
http://web.alfredstate.edu/weimandn/lcd/lcd_initialization/lcd_initialization_index.html
http://ecee.colorado.edu/~ecen2120/Manual/LCD/lcd-doc.html
In my LCD projects I always put a pull-down on the E line as this is what allows transfer to/from the LCD. The other lines can be allowed to float on reset, but not this one.
I was gone for a bit. I will answer some of this in a moment.
Bruce
@vaclav_sal - There is at least 12 seconds between LCD initialization and first output, that should be an ample waiting time. Like I said there is no problem when started normally, just during reboot.
@MagIO2 - I have not checked it out yet, but I will be looking into that now.
I was thinking I could just add your sample within your object as PUB methods, that way it is all in one place. Do you foresee any problem with that?
Bruce
It appears to me that I need consecutive pins for you object, and if I remember correctly, that is why I opted for the other one.
Here is my pin assigments for the LCD:
These are consecutive, but unsure of correct order.
EDITED: Pin order looks correct
Those were some nice references, thanks for the links.
Bruce
Yea I just checked it also. Okay I am now going to add your test code as PUB methods to the original object and give it a try. Thanks for your time and effort on this. I truly appreciate it.
Bruce
That worked perfectly! Problem eliminated!
Thanks a lot Andreas. I appreciate your time and effort.
Bruce
Where is BenkyLCDdriver?