Go Down

Topic: PCA9698  (Read 4455 times) previous topic - next topic

new1111111

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!

robtillaart

what is a pca9698?
do you have a datasheet or other link?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

new1111111

www.nxp.com/documents/data.../PCA9698.pdf

Headroom

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.
http://trippylighting.com

http://ledshield.wordpress.com/

new1111111

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.

Grumpy_Mike

Quote
I get the xio working
What is an xio?

Quote
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.


new1111111

#7
Jun 14, 2015, 07:21 pm Last Edit: Jun 14, 2015, 07:24 pm by new1111111
The I2C-XIO: I2C 40-Channel Digital I/O Expander.Do still want to see the code?

Grumpy_Mike


new1111111



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);
}

Grumpy_Mike

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:-
Code: [Select]
#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.

new1111111

#11
Jun 19, 2015, 01:31 am Last Edit: Jun 19, 2015, 01:35 am by new1111111
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?

Go Up