Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

I2C PCF8575 and Netduino Plus - input and output


  • Please log in to reply
7 replies to this topic

#1 GrZeCh

GrZeCh

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationPoland

Posted 31 October 2012 - 08:55 AM

Hello, does someone has tried to use Netduino Plus with I2C PCF8575 I/O extender? I'm wondering how I can use this extender for having additional input ports. I've found this blog entry: http://blog.codeblac...d-with-I2C.aspx but it describes usage for different PCF. Regards

#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 31 October 2012 - 12:27 PM

you have to read the datasheet for the 8574. its very simple how to interface it. best is to connect the interrupt pin from it to an interrupt-port on you netduino. when this interrupt occurs you than read the the states of the pins and compare it to a pin-state list you defined before. you have to set all pins to true to act as inputs. you drive its inputs per gnd (so gnd at pin means input happens)

#3 GrZeCh

GrZeCh

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationPoland

Posted 31 October 2012 - 02:22 PM

Thank you for responding. Just one more question: is this possible to have input and outputs on one PCF or I can have only inputs or outputs?

#4 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 31 October 2012 - 03:23 PM

it is possible to have both, but you have to be a little creative. imagine: an input changes just a few before you write an output, now you will write the output for the inpuit port too (to false) and its no more input port. you could add a variable to your ports to check if its output or input, and just write all inputs true (so they stay inputs) i added the code i use (does not support input/output at one chip) feel free to change it to make it work

Attached Files



#5 GrZeCh

GrZeCh

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationPoland

Posted 31 October 2012 - 04:09 PM

I'll check your code but I'm not sure if you've noticed because I was asking about PCF8575 (16 I/O). I will also have probably situation where more than one PCF8575 will be connected to I2C bus.

#6 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 31 October 2012 - 04:17 PM

you are right i didnt notice that 75 :P its still the same, just instead of 8 ports 16. you can use up to 8 of this devices on your i2c bus. //edit i just looked through the datasheet, it would need very minor changes, like make the port array 16 instead of 8, and do a second run on bitshifting for the last 8 bits, and than send 2 bytes instead of one

#7 GrZeCh

GrZeCh

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationPoland

Posted 02 November 2012 - 09:35 AM

I hope I will capable of handling it :).

#8 NitinSontakke

NitinSontakke

    New Member

  • Members
  • Pip
  • 6 posts
  • LocationPune, Maharashtra, India

Posted 12 November 2015 - 04:39 PM

Hello,

 

Apologies to rekindle this thread. I am struggling to have PCF8575 16bit io expander (Sparkfun) working and was wondering if GrZeCh has managed successfully implement it, could please be helpful to share the code.

 

Thanks in advance.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.