I'm try to find a easy way to control a pca9698 ? I have tried a few diff lib but none are setup to handle all 40 bits. PLEASE HELP!
what is a pca9698?
do you have a datasheet or other link?
So what libraries have you tried ?
Some links would be helpful. If there are libraries that successfully work with this chip then extending those to work with all the IO may not be such a difficult thing.
I get the xio working but you have to call the io pin to a output and back to a input or it will stay high.
I get the xio working
What is an xio?
but you have to call the io pin to a output and back to a input or it will stay high.
Please post your code.
Are you using one of these?
I2C-XIO: I2C 40-Channel Digital I/O Expander
MRB-XIO: 40-Channel MRBus Digital I/O Node
With code from here?
XIO Arduino Library and Examples
The I2C-XIO: I2C 40-Channel Digital I/O Expander.Do still want to see the code?
new1111111:
Do still want to see the code?
Yes please.
it's not pretty this is what I used to test NPX PCA9698 (OM6281)
#include <XIO.h>
#include <Wire.h>
XIO xioBoard;
void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
Wire.begin();
xioBoard.begin(LOW, LOW, LOW, -1, -1);
//xioBoard.xioPinMode (XIO_PIN_D0, OUTPUT);
xioBoard.xioPinMode (XIO_PIN_D1, OUTPUT);
}
void loop()
{
do
{
xioBoard.refreshIO(); //RESET PIN TO OFF
xioBoard.xioDigitalWrite(XIO_PIN_D1, HIGH);
delay(1250);
xioBoard.xioDigitalWrite(XIO_PIN_D1, LOW);
delay(250);
xioBoard.refreshPinModes();
} while(1);
}
When you post code you should put it between code tags, use the </> icon. Read the how to use this forum sticky.
Why the do .... while structure? It is totally unnecessary.
Where did you get the XIO.h library, I found one but it also had an other file to include, is it available in one place?
At a guess I would say the code should be this, but without the library I can't tell for sure:-
#include <XIO.h>
#include <Wire.h>
XIO xioBoard;
void setup()
{
// initialize serial communications at 9600 bps:
Serial.begin(9600);
Wire.begin();
xioBoard.begin(LOW, LOW, LOW, -1, -1);
//xioBoard.xioPinMode (XIO_PIN_D0, OUTPUT);
xioBoard.xioPinMode (XIO_PIN_D1, OUTPUT);
}
void loop()
{
xioBoard.xioDigitalWrite(XIO_PIN_D1, HIGH);
xioBoard.refreshIO(); //RESET PIN TO OFF
delay(1250);
xioBoard.xioDigitalWrite(XIO_PIN_D1, LOW);
xioBoard.refreshPinModes();
delay(250);
}
Note it is not all stuffed with blank lines.
OK, I looked every where trying to find how to post the code thanks. it had a serial read of some port pins there. I had some problems switching from bank to bank sorry about the blank lines the setup this chip is large.What is the name of the other file?