12864 GLCD - Dummy read? When? Once?

Discussion in 'Electronics Resources' started by atferrari, Aug 21, 2009.

  1. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,644
    759
    To the Administrator: please move this to the right forum. Sorry!!

    The datsheet of the KS0108 mentions the need of a dummy read whose results should be discarded.

    My questions:

    A) This dummy read is to be done:

    Just the first time I read RAM data, after a reset?

    Every time I want to read data from RAM?

    The first time after reset and the first time after any write?

    B) What materializes the second reading? In other words: just bringing the E pin high and then low again, generates the second reading?

    Gracias for any help.


     
    Last edited: Aug 22, 2009
  2. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Looking at the data sheet, it appears you need to do the extra read cycle every time you want to read display RAM (but not when reading the control registers).

    The way it's described, there is a latch between the RAM data and CPU bus. The first read copies the RAM to the Latch (and gets whatever was previously in the latch), then the second read gets the 'real' RAM data.

    The internal address counter increments on a read or write, so I'd guess if you are reading successive locations, each cycle reads the present data and latches the next byte.

    Accessing the display is very slow compared to internal operations with most processors etc., if at all possible keep an image of the display memory in CPU RAM and only ever write to the LCD (after checking the busy line), it will work much better overall.
     
  3. atferrari

    Thread Starter AAC Fanatic!

    Jan 6, 2004
    2,644
    759
    After rerading for nth time the datasheet I realized the differences in speed, Robert. Anyway I want to have this clear should the need of reading arises later.

    NOt having tested anything yet it seems that the first time (after changing the counter - or (only?) after a RESET), reading the latch is bound to get garbage.

    Have to check that and clear the doubt once for all.

    Gracias for replying.
     
    Last edited: Aug 22, 2009
  4. rjenkins

    AAC Fanatic!

    Nov 6, 2005
    1,015
    69
    Ok, but don't forget the address counter is also used for writes.
     
Loading...