Go Down

Topic: having trouble with 4 pcf8574 i2c (Read 343 times) previous topic - next topic

carbondudeoxide

hello, i have designed an arduino powered nixie tube clock and it worked fine on the breadboard version but now that i have had the board produced and i have finished soldering it together i ran a i2c scanner to make sure that all 5 chips were detected on the i2c bus and all five were: 0x38, 0x39, 0x3A and 0x3B are the pcf8574 and 0x68 is my time keeping ic so it has detected all of the i2c bus.

during the programming stage i have a normal arduino with 4 jump leads from 5v,GND,A4,A5 jumping to my built circuit board as my design has a stand alone arduino but no usb host to program kit on s i ahve to program it on an ordinary arduino then transfer the chip once it is working.

the problem is when i am trying to write to the port expanders in order to control the tubes and no mater what i put into the port expanders over the i2c bus all the outputs are on. i have tried numerous times to get this working but it does not seam to want to work...

the ode that i currently have is design to display 4 sets of the same random number on all of the tubes.

(each port expander has 8 outputs 4 of which go to one nixie driver and the other 4 go to a second nixie driver and they act as BCD lines which is how i control them.

here is my code:
Code: [Select]
#include <Time.h>
#include <Wire.h>


void setup() {
  Wire.begin();
  Serial.begin(9600);
  //setTime(0,0,0,1,1,2013);
}

void loop() {

  delay(1000);

      int hou = random(0, 99);
      int i = hou/10;
      int j = hou-i*10;
      int displaynum = (i*16);
      displaynum = displaynum + j;
      int expanderWriteHour(byte(displaynum));
      int expanderWriteMin(byte(displaynum));
      int expanderWriteSec(byte(displaynum));
      int expanderWriteMSec(byte(displaynum));
      Serial.println(displaynum);
}


void expanderWriteHour(byte _data ) {
  Wire.beginTransmission(0x38);
  Wire.write(_data);
  Wire.endTransmission();
}
void expanderWriteMin(byte _data ) {
  Wire.beginTransmission(0x39);
  Wire.write(_data);
  Wire.endTransmission();
}
void expanderWriteSec(byte _data ) {
  Wire.beginTransmission(0x3A);
  Wire.write(_data);
  Wire.endTransmission();
}
void expanderWriteMSec(byte _data ) {
  Wire.beginTransmission(0x3B);
  Wire.write(_data);
  Wire.endTransmission();
}


and this is the schematic:



Go Up