Dear All
This is reference to HD44780 LCD
I am not very clear function of DDRAM and DDROM and CGRAM and CGROM
I know that data in DR is transfer to DDRAM automatically
The Ascii data you pass to the lcds DR Data Register is read by the CGROM which converts the ascii character into a series of 5x8 dots or pixels.
The CGROM is pre-programmed with a specific font/s for whatever language the manufacturer specifies.
This info is then passed to the DDRAM, Data Display Ram which holds the whole message to be displayed on the screen.
The CGRAM Character Generator RAM is a small area of memory that is available to the user to create custom characters.
DDROM - not seen any reference to it on the hd 44780 datasheet ?
The pic chip only used Ones and Zeros ! Its your complier, be it Assembler or C that presents the data in various formats such as Characters, Decimal , Hex etc to make it easy for you to understand.
Many displays and Comms like RS232 generally only accept information in the international ASCII standard.
MPLAB Assembler Help has details of the full Ascii table
When you send a "character" 'A' to your lcd, the complier knows you mean an ascii code, so it converts it the Ascii binary value of '100 0001' - notice its only 7 bits long, the MSB , bit 8, is ignored - Ascii is a very old standard.
Here is a pic showing ascii A being saved to a file and viewed in a Watch window.
Now I know that the Ascii data we pass to the lcds DR Data Register is read by the CGROM which converts the ascii character into a series of 5x8 dots or pixels. ( this is happened, when we write to the LCD)
Can I know, when we read the LCD, then 5x8 dots or pixels convert to Ascii by CGROM and then pass to the DR ?
please help
assume a 1x16 display. you write the ascii data to each location in DDRAM.
programmers job is over with that.
it is the controller part inside the lcd controller reads each ascii data from DDRAM and convert it into dot pattern with the help of CGROM(Character generator ROM).
this process goes on continuously inside.
programmers can write data(ascii)--normal process.
if you read , you are reading the data from DDRAM only. CGROM does come into the link when reading.
---------- Post added at 20:06 ---------- Previous post was at 20:04 ----------
please read:
CGROM does come into the link when reading.
as
CGROM does not come into the link when reading.
Dear All,
Could you please provide to me a Table or relation ship between DDRAM address locations and LCD display Locations
This is related to 2x16 LCD
All these hd44780 type of lcds are basically 2 rows of 40 characters.
When you start to send out new data you must first send out the Address for the data, SET DISPLAY ADDRESS by means of a LCD_Command, then followed by LCD_Data.
Once done the Address in the lcd is automatically incremented so you just continue sending data to the end of the line. eg location decimal 16
If you want the data to continue onto the second row of a 2x16 display then you must send out a new address of 40 otherwise the data will be written to the locations 17 to 32 which is not visible
However if you look at code examples of the addresses 00 and 40 you will see that because its a command, bit 7 must be on , so your code typically shows 80 and C0
Code:
PutStr1 macro string1
movlw 0x80 ; add address for Top line
call lcd_c
call PutString
dw string1,0 ; null terminated in-line string table
endm
PutStr2 macro string2
movlw 0xC0 ; add address for bottom line
call lcd_c
call PutString
dw string2,0 ; null terminated in-line string table
endm