Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Function settings to the LCD #44

Open
timgray opened this issue Jul 4, 2024 · 3 comments
Open

Send Function settings to the LCD #44

timgray opened this issue Jul 4, 2024 · 3 comments

Comments

@timgray
Copy link

timgray commented Jul 4, 2024

I have a 20x4 LCD that got sent by another library the function settings that it is a 16X2 and now it only acts like that type. Is there a way with this library to send the HD44780 function bytes to set the controllers expected rows and cols?

@timgray
Copy link
Author

timgray commented Jul 4, 2024

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
== === === === === === === === === ===
Clear Display 0 0 0 0 0 0 0 0 0 1

Return Home 0 0 0 0 0 0 0 0 1 *

Entry Mode Set 0 0 0 0 0 0 0 1 I/D S

Display ON/OFF 0 0 0 0 0 0 1 D C B

Cursor and Display Shift 0 0 0 0 0 1 S/C R/L * *

Function Set 0 0 0 0 1 DL N F * *

Set CG RAM address 0 0 0 1 A5 A4 A3 A2 A1 A0

Set DD RAM address 0 0 1 A6 A5 A4 A3 A2 A1 A0

Read busy flag and address 0 1 BF A6 A5 A4 A3 A2 A1 A0

Write data to CG or DD RAM 1 0 D7 D6 D5 D4 D3 D2 D1 D0

Read data from CG or DD RAM 1 1 D7 D6 D5 D4 D3 D2 D1 D0

Basically I want to set function set command, setting the col and rows the controller will accept.

@bperrybap
Copy link
Contributor

I'm not clear on the actual issue you are having.

There is no such thing as row or column in the hd44780 instruction set or inside the chipset.
row/column is an artificial thing of convenience supported and implemented by library code.
The raw hd44780 chip set only knows DDRAM address.
It doesn't know the physical geometry of the LCD nor how the chipset is wired up to the physical display.
i.e. It has no idea if the chip set has been wired up to a 20x4 or 16x2 LCD.

Also, there is no state information retained across power cycles.
i.e. each time the hd44780 chipset is powered up it comes up in the same default state.

If you are experiencing unexpected things related to LCD geometry happening when using API functions,
likely the LCD has not been properly initialized by the sketch due to the sketch tell the library an incorrect geometry.

The LiquidCrystal API (which the hd44780 library supports) configures the library API row and column values with the begin() call.
i.e. begin(cols, rows)

See the hd44780 API documentation for more details on the API:
https://github.com/duinoWitchery/hd44780#api-summary

@bperrybap
Copy link
Contributor

Actually there is one bit of geometry information in the hd44780 instruction set.
The chipset does have configuration/state bit to indicate if the chipset has been wired to a 1 line display or something else.
It is the N bit in the function set instruction.
It set appropriately by the library code when begin(cols, rows) is called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants