avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #16125] HD44780 data bit assignment restrictive


From: anonymous
Subject: [avr-libc-dev] [bug #16125] HD44780 data bit assignment restrictive
Date: Sun, 19 Mar 2006 00:19:40 +0000
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.9.2

URL:
  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=16125>

                 Summary: HD44780 data bit assignment restrictive
                 Project: AVR C Runtime Library
            Submitted by: None
            Submitted on: Sun 03/19/06 at 00:19
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
        Percent Complete: 0%
        Originator Email: address@hidden
             Open/Closed: Open

    _______________________________________________________

Details:

As written, the four data bits of a HD44780 are restricted to bits 0 - 3. A
small change can allow the low bit to be set to anywhere from bit 0 to bit 4
(with the other three bits just above the low bit). The four bits will still
be restricted to being consecutive and sequential, but since this is the
logical thing to do, it shouldn't be a problem.

The code would need to be changed in two places:

In hd44780_outnibble(), the line:

  x = (HD44780_PORTOUT & ~HD44780_DATABITS) | (n & HD44780_DATABITS);

should be changed to:

  x = (HD44780_PORTOUT & ~HD44780_DATABITS) | ( (n << HD44780_D4) &
HD44780_DATABITS);

and in hd44780_innibble(), the line:

  return x & HD44780_DATABITS;

should be changed to:

  return x >> HD44780_D4;

It might also be wise to only allow the definition of the low bit, since the
others are forced in relation to it anyways. If this is done, then the line:

  #define HD44780_DATABITS \
  (_BV(HD44780_D4)|_BV(HD44780_D5)|_BV(HD44780_D6)|_BV(HD44780_D7))

would have to be changed appropriately (and possibly some sanity checks).



    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
koshchi --AT-- shaw --DOT-- ca      | Originator Email




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=16125>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]