??? 04/05/05 04:33 Read: times |
#91014 - Works here Responding to: ???'s previous message |
Vusi Masuku said:
I am able to write the text in the first line but when I try to write it on the second line, it does not write. Using the same POSITION subroutine to write text the way it is shown in the LCD tutorial, it works. It doesn't work when I try to use my way of using DPTR. Vusi, I tried your program here and it worked fine on both LCD line 1 and line 2. The only change I made is that my data bus is on P1 (not P0) and my three control lines are on P3 (not on P2). Make sure you don't have any shorts between P0.7 and one of the other lines. I once had a problem writing to the second line of the LCD and the culprit was a short on the most significant data bit such that it was always low. Since the line couldn't be driven high due to the short, I couldn't write any byte to the LCD with a value above 7Fh. Also, if you're using P0 make sure you have pull-up resistors if necessary. Regardless, review Erika's suggestion. The jump to WRITE_TEXT from DSPL_STR is very strange and messy. Just call WRITE_TEXT and let WRITE_TEXT return with a RET. I also see no reason for the PUSH and POPs of DPH and DPL--the value of DPTR doesn't seem to be changed in the routines so why are you protecting DPTR? Regards, Craig Steiner |
Topic | Author | Date |
Can not write second line on LCD | 01/01/70 00:00 | |
Since you do not believe in comments | 01/01/70 00:00 | |
Comments | 01/01/70 00:00 | |
what would you rather | 01/01/70 00:00 | |
Untidy | 01/01/70 00:00 | |
Code with comments | 01/01/70 00:00 | |
what happened | 01/01/70 00:00 | |
Did you check the second line address? | 01/01/70 00:00 | |
How to post code - detailed instructions | 01/01/70 00:00 | |
neatly formatted, yes but | 01/01/70 00:00 | |
0xC0 is correct | 01/01/70 00:00 | |
Can write anywhere | 01/01/70 00:00 | |
cal which calls which calls which calls | 01/01/70 00:00 | |
Works here | 01/01/70 00:00 | |
timing, maybe... | 01/01/70 00:00 | |
Timing?![]() | 01/01/70 00:00 | |
I am sure! | 01/01/70 00:00 | |
I am not sure now! | 01/01/70 00:00 |