Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I am not very clear of DDRAM and DDROM and CGRAM and CGROM

Status
Not open for further replies.

PA3040

Advanced Member level 3
Advanced Member level 3
Joined
Aug 1, 2011
Messages
883
Helped
43
Reputation
88
Reaction score
43
Trophy points
1,308
Activity points
6,936
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

please help
 
Last edited:

Hi,

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 ?


See this tutorial for details.

http://www.epemag.wimborne.co.uk/resources.htm
 
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
DDROM - not seen any reference to it on the hd 44780 datasheet ?

DDROM is may mistake


Dear wp100 your commence helped me to read and understand the tutorials

can I know that the RD can read only Ascii data, but I sent to the LCD character data like 'A' in assembly


Thanks again and again
 

can I know that the RD can read only Ascii data, but I sent to the LCD character data like 'A' in assembly


Hi,

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.
 

Attachments

  • ScreenShot002.jpg
    ScreenShot002.jpg
    12.1 KB · Views: 96
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear wp100

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.
 
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
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

Please help
 

Hi,

Have a look at this pdf and also those EPE ones I posted earlier.
ftp://bencom.co.nz/Data-Sheets/2sort/lcd1/20x4%20LCD%20Module/Digi-Key%208-bit%20A-N%20Initialization.pdf

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
 

Dear WP100 Thanks for the reply and help

If I need to Display Letter 'A' on Location two of LCD of First row

Code:
movlw  0x02   ;shell two of DDRAM in first row
call      Command_write
movlw  'A'
call      data_write

Now I need to send Letter 'B' to LCD location 2 of row two
Code:
movlw  0x41
call       command_write

movlw 'B'
call       data_write

The 'B' does not display

Code:
movlw  0xc1
call       command_write

movlw 'B'
call       data_write

This command will display in the correct location

Please advice

Thanks in advance
 

Hi,

Letter A in address 02h of row 1 of a 16x2 lcd


RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

Set DD RAM address 0 0 1 A A A A A A A

So thats 02h plus command bit 7 on = 82h


For B on to row2 location 02h thats row 2 start address of 40h plus location 02h = 42h, then plus command bit 7 = C2h
 

Attachments

  • 2013-02-07 10_31_00-ftp___bencom.co.nz_Data-Sheets_2sort_lcd1_20x4 LCD Module_Digi-Key 8-bit A-N.jpg
    2013-02-07 10_31_00-ftp___bencom.co.nz_Data-Sheets_2sort_lcd1_20x4 LCD Module_Digi-Key 8-bit A-N.jpg
    29.7 KB · Views: 81
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Dear WP100,
Thanks for the reply
I got it.

Thanks
PA3040
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top