1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

in trouble with LCD (JHD162A)

Discussion in 'Microcontrollers' started by smileguitar, Dec 18, 2007.

  1. Jent Ching

    Jent Ching New Member

    Joined:
    Apr 4, 2011
    Messages:
    5
    Likes:
    0
    My LCD JHD162A cannot display any characters

    This is my LCD.asm file. Hope can get your help. Thanks..

    View attachment lcd.ASM
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    The PORTC define, shouldn't it be $1003 not $03 and DDRC should be $1007 not $07

    You can write

    PORTC PORTA+3
    DDRC PORTA+7

    Cheers Ian
     
  3. Jent Ching

    Jent Ching New Member

    Joined:
    Apr 4, 2011
    Messages:
    5
    Likes:
    0
    Because I wrote:

    LDX #PORTA
    LDAA #$FF
    STAA DDRC,X
    BCLR PORTC,X,$FF ; actually it is now with $1003 since LDX #PORTA

    My now problem is, it is just appearing one row black boxes on first line of LCD JHD162A...no matter how I change the initialization part, it also doesn't work!!
    And one more thing, the DDRAM address for line 1 of JHD162A starts from $80? line 2 starts from $C0?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK

    I apologize! I didn't see the indexed addressing!

    The ONE row of black boxes indicate initialization error, as you suggested. Your DDRAM figures are correct.


    Is you're LCD init array the wrong way round? You need to send the set function "0x38" first

    Cheers Ian
     
    Last edited: Apr 6, 2011
  6. Jent Ching

    Jent Ching New Member

    Joined:
    Apr 4, 2011
    Messages:
    5
    Likes:
    0
    My LCD JHD162A cannot display any characters

    Thanks Ian..

    I have set the Set Function as $38...now my LCD can display some characters but still existing error!!

    I intend to show "WELCOME", but my LCD just show "LLLLLLLLLLLLLLLLLLLLL" for the whole first line of my LCD, and the cursor repeat and repeat going through in the first line from right to left.

    is it my time delay problems? my coding as the asm.file
     

    Attached Files:

  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    Try it with a delay here

    Code (text):

    INI_LCD LDY #INITIAL    ;Initialize the LCD
    LOOP    LDAA    0,Y
        BEQ START       ;After initialize then go START
        BSR INS     ;Jump or branch to INS
            (delay here)...
        INY         ;Increment Y with +1
        BRA LOOP        ;Jump or branch to LOOP
     
    of about 16ms ok.

    cheers Ian
     
  8. Jent Ching

    Jent Ching New Member

    Joined:
    Apr 4, 2011
    Messages:
    5
    Likes:
    0
    But I have already delay 0.587 second for the instruction write into the LCD after jumping to INS. Is that still not enough?


    [​IMG]
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,163
    Likes:
    909
    Location:
    Rochdale UK
    1/2 a second is a bit long! these displays are (worst case ) 40ms and after init drops to around 40us. This is obviously not the problem!!

    My LCD init routine is 0x33 (40ms) 0x33 (40ms) 0x38 (16ms) then 0x0C (BF) 0x06 (BF) 0x01 (BF) BF = busy flag..

    Cheers Ian
     

Share This Page