[En-Nut-Discussion] discussing changes in hd44780.c for a 4x20 display

Tim Lapawa lists at lapawa.net
Sat Mar 5 22:19:00 CET 2005


Hello Harald and Ole,
the mentioned displays work with some odd character adressing.
The displays controller is used in the two line mode and the lines
switch over after the 20th character.
But the second half of the first addressed line is displayed at the
third line on the display and the second half of the second line
is printed on the fourth line of the display.
With this scheme you get 4 lines with 20 characters but not in a
ccontinuous adressable way.
And the cruel addressing does not fit into the current hd44780.c and term.c
scheme.

My first solution idea was a new device driver. For example hd44780_204.c.
This could handle this special case of adressing.
But perhaps it would be a better way to add some general 
"cursor-space" to adress-space calculations into the actual hd44780.c file.
Currently I've got a working device with some changes in the LcdInit function.
It decides by the dcb_term.dcb_nrows value if the display must be driven in
2-line mode.

>    /*
>     * Function Set: 4 bit interface, 2 line display, 5x7 dots characters 
>     */
>    if(((TERMDCB*)dev->dev_dcb)->dcb_nrows==2)
>      LcdWriteCmd(0x28, short_delay);
 
The LcdSetCursor function is affected, too. I've just changed it to calculate
the lcd address from the cursor address. 

I am wondering about the functionality of term.c. Is it necessary to procude the
 addresses in the TermPut() function.  Wouldn't it be cleaner to let the device driver decide about the address.
Perhaps you have an idea which way would be better.

Cheers
  Tim Lapawa

-- 
                \\\///   
  Tim Lapawa    (o  -)   tim at lapawa.net
-------------oo0-(_)-0oo----------------------
   ,ooo0                 Where do you want
  (     )         0ooo,     to go tomorrow?
---\   (---------(     )----------------------
    \ _ )         )   / 
                 ( _ / 



More information about the En-Nut-Discussion mailing list