JohnDoneth / hd44780-driver

Implementation of the embedded-hal traits for the HD44780.
MIT License
37 stars 40 forks source link

Which pin mode to use for output pins? #17

Closed fuchsnj closed 4 years ago

fuchsnj commented 4 years ago

The example in the Readme is creating pins using into_open_drain_output, which creates an output pin that can either pull the line low, or let it float. I had issues using a pin mode like this, but fixed it by using into_push_pull_output (allow the pin to bring the line high or low).

This might not be the case for all board / lcd combinations. I tried to find which pins on the HD44780 are supposed to have pull-up resistors attached, but it seems like there are so many clones that it's pretty hard to tell without testing your setup. For mine, it seemed like either the register select or clock enable pins did not have a pull up resistor.

Is there any reason to not change the example in the readme to use push/pull pins to prevent issues for others? For what it's worth, I checked the Arudino LiquidCrystal library, and it's using the equivalent of a push/pull output pin.

JohnDoneth commented 4 years ago

I don't have any reason not to use push/pull instead of open_drain. I would happily accept a PR for this.