GLCD Timing Problem

Discussion in 'The Projects Forum' started by Utku, Dec 17, 2014.

  1. Utku

    Thread Starter New Member

    Dec 14, 2014
    10
    0
    Hello,

    I am trying to use a GLCD, a WDG0151-TMI-V#N00 and I think I have a timing problem. I have to write my code in AVR assembly language and although I made the delay time 5 micro seconds between signal enable/disables (as in the tutorial in here), still nothing shows up on the screen. Might it be because I am using a development board and it takes a long time for the signal travel from the MPU to GLCD? I would be very grateful if you could help me. Thank you very much in advance.

    Regards
     
  2. ericgibbs

    AAC Fanatic!

    Jan 29, 2010
    2,503
    380
    hi Ut,
    Have you read the other users problems on that link.?
    There are some noted drawing and programming errors.

    If you post your assembly code we can look it over.
    E
     
  3. Utku

    Thread Starter New Member

    Dec 14, 2014
    10
    0
    Thanks. I am posting my assembly code.
     
  4. ericgibbs

    AAC Fanatic!

    Jan 29, 2010
    2,503
    380
    hi,
    Have you read the other users problems on that link.?
    There are some noted drawing and programming errors.
     
  5. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,694
    904
    It would be helpful if you posted your routines. This set of routines came from Pommie, who is a frequent helper here. Any credit belongs to him. I changed only a very few things. Most notably, Pommie uses a routine called WaitNotBusy for timing. I simply inserted some NOP's. You will see a section with four. That was done while trouble shooting some issues. Two NOP's will usually work. The enable set and clear has one NOP. At 4 MHz, that is probably not necessary. At 8 MHz, which I am using, it may not be necessary either. There is a comment at that point.

    John

    EDIT: Code = MPASM
     
    Last edited: Dec 17, 2014
  6. Utku

    Thread Starter New Member

    Dec 14, 2014
    10
    0
    But which assembly is it? I am using an ATmega32 so I am using AVR Assembly. All routines I use are in the code by the way.
     
  7. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,694
    904
    The code I added is MPASM. Your code may use different mnemonics, but the processes should be quite similar, because the GLCD controllers are the same.

    John
     
  8. Utku

    Thread Starter New Member

    Dec 14, 2014
    10
    0
    4 nops don't work. Actually I have tried even like 30 nops but still doesn't work.
     
  9. Utku

    Thread Starter New Member

    Dec 14, 2014
    10
    0
    For some reason, only a very large delay loop works but erroneously. That loop is as below. It introduces a delay of approx. 1ms.

    Code (Text):
    1. GLCD_PULSE_DELAY:
    2.     ; Introduces a delay to send the command to the GLCD.
    3.     ldi temp, 15
    4.     mov dly1, temp
    5.     ldi temp, 255
    6.     mov dly2, temp
    7.     ldi temp, 1
    8.     ldi temp1, 0
    9.     PULSE_DELAY_LOOP:
    10.     SUB dly1, temp
    11.     SBC dly2, temp1
    12.     BRCC PULSE_DELAY_LOOP
    13.     ret
     
Loading...