Custom characters for hd44870

Discussion in 'Programmer's Corner' started by Jns, Oct 15, 2008.

  1. Jns

    Thread Starter New Member

    Oct 15, 2008
    3
    0
    Hi I'm trying to make my own custom characters for a HD44780 LCD display
    My current(part) of the code looks like this...
    First it addresses the CG RAM and then it writes data to the 00000000 character code
    4 bit interface should be mentioned
    Can't get this to work even though I'm pretty sure I'm doing it right, can you guys see any wrongs in the code?


    Code ( (Unknown Language)):
    1. char    movlw    0x40        ;CG RAM
    2.         movwf    portb
    3.         call    enable
    4.  
    5.         movlw      0x11        ;rad 1 - Schackrutor
    6.         movwf    portb
    7.         call    enable
    8.         movlw    0x15
    9.         movwf    portb
    10.         call    enable
    11.         movlw    0x10        ;rad 2
    12.         movwf    portb
    13.         call    enable
    14.         movlw    0x1a
    15.         movwf    portb    
    16.         call    enable
    17.         movlw      0x11        ;rad 3
    18.         movwf    portb
    19.         call    enable
    20.         movlw    0x15
    21.         movwf    portb
    22.         call    enable
    23.         movlw    0x10        ;rad 4
    24.         movwf    portb
    25.         call    enable
    26.         movlw    0x1a
    27.         movwf    portb    
    28.         call    enable
    29.         movlw      0x11        ;rad 5
    30.         movwf    portb
    31.         call    enable
    32.         movlw    0x15
    33.         movwf    portb
    34.         call    enable
    35.         movlw    0x10        ;rad 6
    36.         movwf    portb
    37.         call    enable
    38.         movlw    0x1a
    39.         movwf    portb    
    40.         call    enable
    41.         movlw      0x11        ;rad 7
    42.         movwf    portb
    43.         call    enable
    44.         movlw    0x15
    45.         movwf    portb
    46.         call    enable
    47.         movlw    0x10        ;rad 8 - Shackrutor
    48.         movwf    portb
    49.         call    enable
    50.         movlw    0x1a
    51.         movwf    portb    
    52.         call    enable
    53.  
    The enable routine looks like this:
    Portb is connected t the LCD-display on my board and portb,5 is used to send the data

    Code ( (Unknown Language)):
    1. enable    bsf        portb,5
    2.         call    waitms
    3.         bcf        portb,5
    4.         call    waitms
    5.         return
     
    Last edited: Oct 15, 2008
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Have you been able to get it to display any characters? Start with the vanilla stuff before you go for the exotic.
     
  3. Jns

    Thread Starter New Member

    Oct 15, 2008
    3
    0
    Yup I have got the display to display any predefined character anywhere I want on the display, I have also made a counter that goes from 0-999. So I'm already familiar with the display.
     
Loading...