Tim, To define a custom character on an HD44780 LCD, you send out a command to build the character followed by a sequence of characters just like any other string. Here are a bunch of routines that I use: movlw 0x40 ; create two custom designed characters from bitmaps at M5Start call SndLCDCmd ; set CGRAM address to character 0 movlw LOW (M5Start - M1Start) ; set pointer to start of string call SndLCDStr movlw 0x00 ; output 1st user defined symbol call SndLCDChr ; ------------------------------- ; Subroutines ; ------------------------------- SndLCDCmd ; send the command in w bcf PortLCD, RS ; drive RS low (command) movwf LCDTemp call PortNibble call PulseE swapf LCDTemp, W call PortNibble call PulseE call d20ms ; overkill as 1.64ms is worst- case spec return SndLCDChr ; send the character in w bsf PortLCD, RS ; drive RS high (character) movwf LCDTemp call PortNibble call PulseE swapf LCDTemp, W call PortNibble call PulseE call d20us call d20us return SndLCDStr ; w must contain the offset of the string to output movwf ChrCnt SndLoop call GetLCDChr ; return with character to output in w xorlw 0x00 ; test if it's zero btfsc STATUS, Z return ; return if character is 0x00 call SndLCDChr ; output character incf ChrCnt, F ; pointer for next character goto SndLoop PulseE bsf PortLCD, E ; take E high nop ; pause 1us. At least 450ns required. bcf PortLCD, E ; take it low return NybbletoASCII ; convert a Nybble in "w" to ASCII addlw 0x036 ; add '0' + 6 to Value btfsc STATUS, DC ; if Digit Carry Set, then 'A' - 'F' addlw 7 ; add Difference Between '9' and 'A' addlw 0-6 ; subtract 6 btfss Flags, SLZ ; return if Suppress Leading Zero flag is not set return addlw 0 - "0" btfsc STATUS, Z retlw 0x00 ; return 0 if SLZ set and character is a leading zero addlw "0" bcf Flags, SLZ ; After a non-zero character, turn off zero supression return PortNibble andlw 0xf0 ; iorwf PortLCD, F ; Use the lower four bits of PortLCD iorlw 0x0f andwf PortLCD, F return NybbletoASCII ; convert a Nybble in "w" to ASCII addlw 0x036 ; add '0' + 6 to Value btfsc STATUS, DC ; if Digit Carry Set, then 'A' - 'F' addlw 7 ; add Difference Between '9' and 'A' addlw 0-6 ; subtract 6 btfss Flags, SLZ ; return if Suppress Leading Zero flag is not set return addlw 0 - "0" btfsc STATUS, Z retlw 0x00 ; return 0 if SLZ set and character is a leading zero addlw "0" bcf Flags, SLZ ; After a non-zero character, turn off zero supression return PortNibble andlw 0xf0 ; iorwf PortLCD, F ; Use the lower four bits of PortLCD iorlw 0x0f andwf PortLCD, F return I think I got them all. If I missed anything, let me know. These routines also have a bunch of flags to select zero-supression. It might be easiest for you to ignore those. Andrew ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag ---- On , Tim Webb (tim_webb@AGILENT.COM) wrote: > Has anyone been successful at creating custom characters on an HD44780 > compatible LCD Display. > > I can not make any sense out of my Hitachi Data Sheet. > > Does anyone have any sample code, I am using 16F877. > > Best Regards, > > Tim > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics