www.8devices.com
View unanswered posts | View active topics It is currently 27 Apr 2024, 16:59



Reply to topic  [ 1 post ] 
 i2ctools and pcf8575 
Author Message

Joined: 24 Apr 2012, 10:46
Posts: 15
In case anyone is interested. To make the PCF8575 work with i2cget and i2cset a little trick is needed.

In my board I have a PCF8575 only using the first eight ports, 4 outputs and 4 inputs.

To disable/clear the 4 outputs
i2cset -y 0 0x20 0xf0 0x00

To set the first output
i2cset -y 0 0x20 0xf1 0x00

To set all the outputs
i2cset -y 0 0x20 0xff 0x00

The trick is that the byte used in the "command" parameter of the i2cset command after the i2caddress is the first byte sent to the pcf8575.

Hope it helps.


22 Mar 2013, 11:16
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.