Hi everybody!
I bought myself a bunch of SN74LVC4245A. This is an octal bus transceiver with integrated 3.3 to 5 V (and vice versa) level shifting capabilities. I want to use them to exchange data between my Arduino Due and my Z80 beadboard CPU. But before that, I just wanted to test the ICs and built a litte test circuit. I connected the 3.3V bus pins to P2-9 of the Due and the 5V bus pins to 8 LEDs (with resistors, of course ). I've uploaded the followig listing:
int i = 0;
void setup() {
 // put your setup code here, to run once:
for (i=2;i++;i<10)
 {
  pinMode(i,OUTPUT);
  digitalWrite(i, LOW);
 }
}
void loop() {
 // put your main code here, to run repeatedly:
for (i=2;i++;i<10)
 {
  digitalWrite(i,HIGH);
  delay(1000);
  digitalWrite(i, LOW);
 }
}
But it doesn't work. No LED lights up. When i use the following code, at least all LEDs light up as they should, so I guess the ICs themselves are okay:
int i = 0;
void setup() {
 // put your setup code here, to run once:
for (i=2;i++;i<10)
 {
  pinMode(i,OUTPUT);
  digitalWrite(i, HIGH);
 }
}
void loop() {
 // put your main code here, to run repeatedly:
}
So, my question is: why does the SN74LVC4245A doesn't react to logic level changes? I checked that the control lines (DIR and /OE) are both grounded as neccesary. Everything seems to be correct and the basic function also seems to work (all LEDs high or low). But why can't I change the logic level during the main program run?
Greetings,
Markus