![]() |
LCD - Custom Character Display
Hi,
I am trying to write a program to display custom character on LCD using CGRAM. I am using 68HC11 MCU and 20x2 LCD for this purpose. I attached my code in attachment. I don't seem to get anything on LCD. The HEX pattern, CC, is supposed to look like a speaker. Any help would great. Code:
ORG $6000 |
Re: LCD - Custom Character Display
How does
Code:
00000110How does the MCU know to start executing the program at $7000? I'm not a 68HC11 expert but I've done a bit of PIC programming and you need to put a jump at the start of program memory if that's not where the start of the program is. Obviously ignore this if the 68HC11 starts at $7000. LDAA 0,X - OK, I guess this reads the 06 ff ff etc since X is initialised to #CC. LDAB 0,Y - So what does this do? Y is initialised to #$40. |
Re: LCD - Custom Character Display
1 Attachment(s)
I am sorry that is definitely not speaker look alike. It is supposed to look like a battery. But the my it doesn't make difference to the problem.
Answering your question one at a time. Once the program is loaded. Using a BUFFALO monitor program I would type go 7000 to run the program, Where 7000 is a hex and address from where my main subroutine starts. Your second question, LDAB #$40, is the instruction that will initialize CGRAM. $40 corresponds to first row of 5x8 pixel map. So, $40~$47 for 8 rows. Last row is 00 for cursor. I am newbie but I have some assembly and now trying to play around. I tried following the instruction in the website below but its for different MCU. w w w.8051projects.net/lcd-interfacing/lcd-custom-character.php |
Re: LCD - Custom Character Display
> Your second question, LDAB #$40, is the instruction that will initialize CGRAM. $40 corresponds to first row of 5x8 pixel map. So, $40~$47 for 8 rows. Last row is 00 for cursor.
Um, sorry I'm being thick. Where's the instruction that writes to $40~47? |
Re: LCD - Custom Character Display
Hmm its alright. You see first Index Register Y is initialized to $40. Then it is incremented using INY. It is also stored in $1400 LCD Control Register, which tells the address in CGRAM to right hex pattern.
|
| All times are GMT +5.5. The time now is 12:35. |