What's the difference between writing to DDRAM and CGRAM? Instead of sending the clearscreen command as in the example, send the correct command to access CGRAM and then the data.
/Henrik.
What's the difference between writing to DDRAM and CGRAM? Instead of sending the clearscreen command as in the example, send the correct command to access CGRAM and then the data.
/Henrik.
The question is in following. Say, first character RAM starts at $40. And this is address for top line, right? and address for next line is $41 ? I mean, if I do code, where $40 will be incremented by 1 in loop for 7 times, all lines will be written properly?
is such structure correct?Code:LCDOUT $FE, $40+A,
The adress pointer in the 44780 is incremented automatically so if you set it to $40 and send 5 bytes of data they will end up at adress $40-$44 automatically. Just as they would when you write to the DDRAM, you (for example) clear the screen which sets the adress pointer to 0 (first char on first line). Each byte received from there on will end up at "the next" location, right? There's no difference in writing to CGRAM. So if you prefer your idealistic way over using the STR modiferAt least give it a try and see if it does what you're asking.Code:LCDOUT $FE, $40 ' Set adress pointer to first location of CGRAM For i = 0 to 7 ' Send 8 bytes of CG data LCDOUT Graph[i] NEXT
/Henrik.
The problem is, that I want sent data byte by byte, not all together, but with small delay.
I mean, I want to send one byte into 1st line of 1st char, then send 1 byte into 1st line of 2nd char and so on.
So say this code:
Will send $12 to 1st line of 1st char and $15 to 1st line of 2nd char, but if I call the LCDOUT $FE, $40, $12 again, it will be written into 2nd line of 1st char, right?Code:LCDOUT $FE, $40,$12 LCDOUT $FE, $48,$15
I'm sorry but your comments doesn't make any sense to me. I don't understand what it is you're actually asking or trying to do. Either I'm stupid or you don't make a very good job of explaining yourself - it's probably the former....
First you said you DON'T want to put characters on the screen with LCDOUT and now you're talking about first character on line 1 and line 2. Writing to CGRAM won't put characters anywhere on the screen, it will however update any instances OF the character no matter WHERE on the screen they are.
Then you say you want a delay, which you can just do with a PAUSE within the FOR-NEXT loop.
Code:LCDOUT $FE, $40,$12 ' Write $12 to CGRAM 0 LCDOUT $FE, $48,$15 ' Write $15 to CGRAM 8 LCDOUT $FE, $40,$12 ' Write $12 to CGRAM 0 (again) LCDOUT $13,$14,$15 ' Write $13, $14, $15 to CGRAM 1, 2, 3 (because the previous command wrote to location 0) LCDOUT $FE, $49, $16, ' Write $16 to CGRAM location 9Code:LCDOUT $FE, $40+A ' This will set the adress pointer to CGRAM location 0+A For i = 0 to 7 LCDOUT Graph[i] ' Send a byte to CGRAM location 0+A+i PAUSE 100 NEXT
Yes, I know how CGRAM character works.
I asked two questions:
1. Can I any time access any CGRAM address?
2. Can I use variable for accessing that address?
Bookmarks