Friends,
I am working on a project, where PICAXE-14M2 is driving a model car control solution. Since there are many parameters that should be set up once with DIP switches per street coming into the crossing, I have lead all those to PCA9995 I/O expanders. Also, there are too many outputs to reasonably control from PICAXE of any size directly, so I'm switching some of those through PCA9995s as well. Two important inputs of reed switch and IR sensor per incoming street are led directly to PICAXE-14M2 for easier programming and faster response.
I am now doing baby steps on i2c. The first thing I want is just to blink a LED through I/O expander. I don't have the PCA9555 here, but I got hold of PCF8574. They are not exactly the same, but seem close enough.
I think I understand the addressing bit of the whole thing. What I don't understand at all is read and write commands hi2cout and hi2cin. The data sheet of PCF8574 claims there should be START and STOP conditions sent. Also, there seems to be a requirement to "set" inputs and outputs on PCF8574 before sending anything. The third mystery is the ACK or acknowledgement.
How do one program all of this with hi2cout and hi2cin after that? Any experience with the I/O expander family in question? Datasheets and schematics of the project attached (sorry if the latter is a bit confusing after adjustments during routing the PCB).
View attachment ICCU_v_3.1_noPSU.pdf
View attachment PCF8574_PCF8574A.pdf
Thank you for your time,
Edmunds
I am working on a project, where PICAXE-14M2 is driving a model car control solution. Since there are many parameters that should be set up once with DIP switches per street coming into the crossing, I have lead all those to PCA9995 I/O expanders. Also, there are too many outputs to reasonably control from PICAXE of any size directly, so I'm switching some of those through PCA9995s as well. Two important inputs of reed switch and IR sensor per incoming street are led directly to PICAXE-14M2 for easier programming and faster response.
I am now doing baby steps on i2c. The first thing I want is just to blink a LED through I/O expander. I don't have the PCA9555 here, but I got hold of PCF8574. They are not exactly the same, but seem close enough.
I think I understand the addressing bit of the whole thing. What I don't understand at all is read and write commands hi2cout and hi2cin. The data sheet of PCF8574 claims there should be START and STOP conditions sent. Also, there seems to be a requirement to "set" inputs and outputs on PCF8574 before sending anything. The third mystery is the ACK or acknowledgement.
How do one program all of this with hi2cout and hi2cin after that? Any experience with the I/O expander family in question? Datasheets and schematics of the project attached (sorry if the latter is a bit confusing after adjustments during routing the PCB).
View attachment ICCU_v_3.1_noPSU.pdf
View attachment PCF8574_PCF8574A.pdf
Thank you for your time,
Edmunds