retromuz
retromuz

Reputation: 799

Raspberry Pi - Interfacing HD44780 based 20x4 LCD via PCF8574 IOExpander

Thanks to ufux I got above setup working fine with Python. https://gist.github.com/ufux/6094977

However I would like the same to be implemented in C. I am pretty new to C programming. Could you guys help me get this done. I tried writing some C code. I used wiringPi library since I thought it would be easier.

I'm unable to get it working. Code I had written so far is here.

Even I cannot get the LCD initialisation to work. Could anybody help me to get this working? Thanks in advance.

UPDATE

All issues fixed and the complete C based library for raspberry pi (to drive HD44780 via PCF8574) is here.

Upvotes: 0

Views: 2782

Answers (1)

retromuz
retromuz

Reputation: 799

Latch command "lcd_probe" was not being called as required by the HD44780. The older code didn't have this properly implemented.

By calling these commands correctly the LCD started working.

I have added few more features such as handling signal SIGINT (=Ctrl + c on keyboard).

Thanks to @leppie I got encouraged to look back into the code and identify the issue. :-)

UPDATE: I wrote a library based on C++ which can even used by Python. Download and try it out. https://github.com/karunadheera/lcdpcf8574

Upvotes: 1

Related Questions