Using gpioled on a 16x2 LCD

I am attempting to use Andriry's driver on a i2c controlled 16 Character LED with 2 Lines.
The driver source is one file and I have copied it to a BeagleBone where I have a working i2c bus on /dev/iic1


I copied this source file into /usr/src/sys/dev/gpio/ on a Beaglebone with FreeBSD 13.1-RELEASE on eMMC.
Still need to compile it.

I have enabled pfc8574(4) per AVG's instructions:

I created an overlay for it after using i2c -s -f /dev/iic1 to determine the i2c address in use by my module.
Code:
     / {

         ...
         pcf8574@27    {
             compatible    = "nxp,pcf8574";
             reg = <0x27>;
         };
     };

So what now?

Do I need to create an overlay for the 16x2 display?

This seems like they created a combined dts with pfc8574 i2c controller and hd44780 display.

Any thoughts? Do I need the overlay for hd44780 or will gpioled suffice?

What about I2C bus speed. I might enable another bus. I am using ds1307 now for test.
Should I use the fast bus overlay for the pfc8574? 400K or 100K clock freq?
 

Andriy

Developer
Just a note, gpiolcd is not a driver, it's a very simple command line utility (although with not much of documentation). It works with gpio. You should have gotten a new gpio device if pcf8574 attached correctly.
Hope that helps.
 
Thank You so Much for this hint:
You should have gotten a new gpio device if pcf8574 attached correctly.

I now have something showing on the Raspberry Pi3.
DS3231 RTC on iic0 (pins gpio2 and gpio3) and pcf8574 on iic1 (pins gpio28 SDA0 and gpio29 SDL0)
Code:
gpio2: <PCF8574 I/O expander> at addr 0x4e on iicbus1

New gpioc2 bus showed up:
Code:
# gpioctl -f /dev/gpioc2 -lv
pin 00: -1      <>, caps:<>
pin 01: -1      <>, caps:<>
pin 02: -1      <>, caps:<>
pin 03: -1      <>, caps:<>
pin 04: -1      <>, caps:<>
pin 05: -1      <>, caps:<>
pin 06: -1      <>, caps:<>
pin 07: -1      <>, caps:<>

Recon Sentinal // Rock64 LCD is showing up as 3f and using an pcf8574A.
That threw me for a loop.

My pcf8574.dts:
Code:
/dts-v1/;
/plugin/;

&i2c1 {
        status = "okay";

        pcf8574@27 {
                compatible = "nxp,pcf8574";
                reg = <0x27>;
                clock-frequency = <400000>;
                };
};
dtc -O dtb -o pcf8574.dtbo -b 0 -@ pcf8574.dts

The Pi uses sysutils/rpi-firmware port for pre-compiled binaries for overlays.
Binary overlays go in /boot/msdos/overlays/
Configured with config.txt
Code:
dtparam=i2c_arm=on,i2c0=on,i2c1=on,i2c_arm_baudrate=400000,spi=on
dtoverlay=i2c0
 
Last edited:
Top