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.

How to access the cgram of lcd ?

Status
Not open for further replies.

newbie111

Member level 2
Joined
Nov 29, 2009
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
h.k
Activity points
1,609
cgram again

Hi,

I tried to access the cgram of my lcd

but nothing happened

Code:
LCDSCGA	    

               ANDLW  0x01

               iorlw   0x08
                call lcd_c
         
store
         movlw   0x40
         movwf  0x00        ;Load row 1 data
         call lcd_c   ;Send the data
         movlw  0x0E
         movf  0x01      ;Load row 2 data
         call lcd_d   ;Send the data
         movlw   0x0E
         movwf  0x02          ;Load row 3 data
         call lcd_d  ;Send the data
         movlw   0x0E
         movwf  0x03           ;Load row 4 data
         call lcd_d   ;Send the data
         movlw   0x0F
         movwf  0x04       ;Load row 5 data
        call lcd_d   ;Send the data
         movlw   0x00
         movwf  0x05        ;Load row 6 data
         call lcd_d  ;Send the data
         movlw   0x04
         movwf  0x06       ;Load row 7 data
         call lcd_d  ;Send the data
         movlw   0x00
         movwf  0x07        ;Load row 8 data
         call lcd_d ;Send the data
         return                 ;Return from routine

Actually I do not know how to make it work

I am poor in programming.

Would anyone kindly teach me how to store a font into cgram
?

Thanks
 

Re: cgram again

Which display driver are you using?
Is it a graphical display or a character based display?

For example, in the CGRAM of a HD47780 compatible display driver, the display font is fixed in ROM, and only a small RAM-space is left to define your own characters (only 8 characters can be self defined).

A simpler language for programming is e.g. C. If you look around on the internet, you can find several good libraries for communicating with an LCD display, written in C. These can safe you much time.
 

    newbie111

    Points: 2
    Helpful Answer Positive Rating
Re: cgram again

ihave a character based display

thanks for your answer

but my codes are all written in asm
 

Re: cgram again

Be aware that programming in assembler is often much harder than programming in a higher level language such as C. Personally, I would not write routines for driving a character display (with onboard display driver) in assembler, since the timing is not an issue, and some basic display-related stuff such as writing strings and integers to your display are not easy to write in assembler and will take a lot of programming time. In C, there are a lot of libraries available which can do all the hard work.

Is it a HD47780 based LCD display?
 

    newbie111

    Points: 2
    Helpful Answer Positive Rating
Re: cgram again

Is it a HD47780 based LCD display? Yes it is

i will look at c programming too

thanks a lot
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top