Hi,
I'm trying to interface expander PCA9555 with IMX233. it uses a 16 bit memory address.using i2ctool,"i2cdetect" can see it in address (0x20)
what i understand from data sheet of PCA9555 is that If I want to control the Port-Expander i set The register with the address 0x06 which will controls the direction (input/output) of all Port-0 pins and The register with the address 0x02 will controls the level of all port-0 pins.
by using #i2cset 0 0x20 0x06 0x00 command it set all pins in port 0 to low
my question is how to set and control each pin in the expander ?
and I read somewhere that I cannot use a 16-bit memory address (e.g. 0xFFFF) with i2cset or i2cget. Is that true?
if there is any tutorial or information about this subject please help me .
thanks in advance
Are you on BSP kernel or mainline kernel?
I naturally suggest to use the kernel driver instead of messing with i2c-tools from user space. The module is called gpio-pca953x.ko IIRC and supports the PCA9555 for ages. However I don't know if this available in the BSP kernel.
HTH,
Harald
Thanes for your replay
actually I don't have many experience with Kernel. How do I Know if it is BSP kernel or mainline kernel or how I know if there is a driver in-tree for PCA9555?
Quote from: Rana on May 26, 2018, 10:43:23 AM
How do I Know if it is BSP kernel or mainline kernel or how I know if there is a driver in-tree for PCA9555?
Well, where did you get your kernel from? If it is the official image from olimex, then it would be the BSP kernel.
(And I have no idea where the source for that is, but probably Olimex could tell you that.)
However if you have no specific reason to use the BSP kernel, then maybe switching to mainline kernel would be a good idea anyway. Personally, I use the imx233 (mxs) images provided by OpenWRT: https://downloads.openwrt.org/releases/17.01.4/targets/mxs/generic/
The package containing the driver is called kmod-gpio-pca953x, you would need to enable the driver in device tree.
HTH,
Harald
problem solved
First I tried the hard way by set the address directly.
I recommended to use this instruction and of course data sheet of PCA9555::
http://en.gnublin.org/index.php/Port_Expander_PCA9555 (http://en.gnublin.org/index.php/Port_Expander_PCA9555)
It worked for me.
Quote from: lambda on May 26, 2018, 07:07:24 PM
However if you have no specific reason to use the BSP kernel, then maybe switching to mainline kernel would be a good idea anyway. Personally, I use the imx233 (mxs) images provided by OpenWRT: https://downloads.openwrt.org/releases/17.01.4/targets/mxs/generic/
The package containing the driver is called kmod-gpio-pca953x, you would need to enable the driver in device tree.
I have no reason to use official image from olimex so I switch to openwrt image and it was easer
thank you for your help