bugAVR C Runtime Library - Bugs: bug #16125, HD44780 data bit assignment...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #16125: HD44780 data bit assignment restrictive

Submitter:  None
Submitted:  Sun 19 Mar 2006 12:19:39 AM UTC
   
 
Category:  Library Severity:  3 - Normal
Priority:  7 - High Item Group:  None
Status:  Fixed Assigned to:  joerg_wunsch
Percent Complete:  0% Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  None
Fixed Release:  None

Sun 19 Mar 2006 12:19:39 AM UTC, original submission:  

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).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Follow 6 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-10-08 joerg_wunsch StatusNone Fixed
    Open/ClosedOpen Closed
2006-09-04 joerg_wunsch Priority3 - Low 7 - High
2006-04-19 joerg_wunsch Priority5 - Normal 3 - Low
    Assigned toNone joerg_wunsch
2006-03-19 None Carbon-Copy- Added koshchi --AT-- shaw --DOT-- ca

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code