does anyone know of a device which can sit on the I2C Bus and can be addressed to give me a couple ( or more ) of Output ports?
i am building a water temperature, pump and Fan controller for my CNC Spindle motor and i have run ou of control ports to control it with my 18F SBC any ideas anyone?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just the Job .... Two Wire Clock and Data wit 8 ports I/O. Is the MCP23008 supported in GCB?
I have had a quick peek at the I2C PCF8574 Serial expander demo and the code is again way above my pay grade I think I'm going to need some help with the coding for this - in fact I KNOW I'm going to need some help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just realised. There is no demo for the MCP23008.
Here is the code.
//Includethelibrary#include <MCP23008.h>//DefinetheaddressoftheMCP,youcanmanydevices#DEFINE MCP23008_DEVICE 0X48/*Thereistwofunctionsmcp23008_sendbyte(inmcp23008_device,inmcp23008_instr,inmcp23008_data)mcp23008_readbyte(inmcp23008_device,inmcp23008_instr,Outmcp23008_data)Thesearetheconstantsdefined.MCP23008_IODIR0X00' DEFAULT IS INPUT 0= OUT 1= INMCP23008_IPOL0X01' INPUT POLARITY 0= NORMAL, 1= INVERTEDMCP23008_GPINTEN0X02' ALLOW INTERRUPT ON CHANGEMCP23008_DEFVAL0X03' DEFAULT VALUE BEFORE INTERRUPT [FOR EASY COMPARE]MCP23008_INTCON0X04' I/O EXPANDER CONFIGURATION .2 1= OPEN DRAIN [WIRE TOGETHER INTERRUPTS]MCP23008_IOCON0X05MCP23008_GPPU0X06' WEAK PULL UP RESISTORS [~100KOHHM] VERY HANDYMCP23008_ITF0X07' WHO DONE IT, THE INTERRUPTMCP23008_INTCAP0X08' SAVES THE EVENT THAT CAUSED THE INTERRUPTMCP23008_GPIO0X09' THE IO PORTMCP23008_OLAT0X0A' THE LATCH OF THE IO PORT SEE DOC*/' setup MCP23008mcp23008_sendbyte(MCP23008_DEVICE,MCP23008_IODIR,0x00)' turn all pins output' set ports status on MCP23008portsetvalue0=0mcp23008_sendbyte(MCP23008_DEVICE_1,MCP23008_GPIO,portsetvalue0)' turn all pins off' set ports status on MCP23008portsetvalue1=255mcp23008_sendbyte(MCP23008_DEVICE_1,MCP23008_GPIO,portsetvalue1)' turn all pins on to state' read ports status on MCP23008ug_data=0//Settozerotoensureyougetaresult.ug_datawillbethe8bitsoftheMCPdeviceseither0or1all8bits.mcp23008_readbyte(MCP23008_DEVICE_1,MCP23008_GPIO,ug_data)' read state
Hope this helps. It is really easy to use... but, it is currently only software I2C. If this needs to change the hardware I2C then let us know.
Enjoy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Searching. It's supported by gcb, i2c arduino nano so it's something you probably wrote.
All servos worked but the leg motion and a psu.. it got put on the shelf.
I found this.
does anyone know of a device which can sit on the I2C Bus and can be addressed to give me a couple ( or more ) of Output ports?
i am building a water temperature, pump and Fan controller for my CNC Spindle motor and i have run ou of control ports to control it with my 18F SBC any ideas anyone?
The PCF8574 is probably the most common with hobbyists but there are others just as capable. I think GCB has a library for the PCF8574.
Or the MCP23008 or MCP23017.
Just the Job .... Two Wire Clock and Data wit 8 ports I/O. Is the MCP23008 supported in GCB?
I have had a quick peek at the I2C PCF8574 Serial expander demo and the code is again way above my pay grade I think I'm going to need some help with the coding for this - in fact I KNOW I'm going to need some help.
MCP23008 ... it can be made to support you device.
I just realised. There is no demo for the MCP23008.
Here is the code.
Hope this helps. It is really easy to use... but, it is currently only software I2C. If this needs to change the hardware I2C then let us know.
Enjoy
I used 2 pca9685 boards to drive 18 rc servos using gcb.
Don't know if relevant.
Very relevent. :-)
Got any code to share?
Searching. It's supported by gcb, i2c arduino nano so it's something you probably wrote.
All servos worked but the leg motion and a psu.. it got put on the shelf.
I found this.
Last edit: stan cartwright 2023-01-12