Working with Peggy2 Board.
Using the Truth Table on page 2 of datasheet, I get pins turning on that do not match the datasheet table.
I have Atmegga328P connected to Decoder CD74HC154 as shown on attached schematic.
Converting Pin connections to Arduino Pins:
ATMEGA Arduino 74HC154
2 0 23
3 1 22
4 2 21
5 3 20
74HC154 pins 18 and 19 are tied to ground.
Arduino code I am using to experiment with is:
int InputA0 = 0;
int InputA1 = 1;
int InputA2 = 2;
int InputA3 = 3;
void setup()
{
// initialize the control outputs
pinMode(InputA0, OUTPUT);
pinMode(InputA1, OUTPUT);
pinMode(InputA2, OUTPUT);
pinMode(InputA3, OUTPUT);
}
void loop()
{
digitalWrite(InputA0, LOW);
digitalWrite(InputA1, HIGH);
digitalWrite(InputA2, LOW);
digitalWrite(InputA3, LOW);
}
According to the datasheet table with A0,A1, A2 and A3 all set to L, H, L, L, output Y2 of CD74HC154 (pin 3) of 74HC154 should be low. When I check the outputs with multimeter pin 4 is Low not 3.
If I change A0 - A3 to different settings from the Truth Table, different pins on chip are activated but not matching data sheet.
Been chasing this for hours. I am sure there is a logical explanation. I cannot find it.
Peggy 2 LE Schematic.pdf (476 KB)