church that dispenses mini liquor bottles

When posting these pictures please include the MCU and connections to the power supply so that it is a complete system. Your test sketch is also relevant.

Your blue wires are wrong. The SER IN pin of the first TPIC is to be connected to the MCU. The SER OUT of the first TPIC is connected to the SER IN of the second TPIC. The SER OUT of the second TPIC is connected to the SER IN of the third TPIC etc.

The CLR pin is active low and you have it connected directly to GND. That holds the TPIC in "clear all registers" mode.

I have the feeling that you haven't downloaded the datasheet for the TPIC. Please do so and you'll find a section "typical application" in it where you can see how two devices are to be connected.

Dang I can't it. Every time i look at a datasheet or the internet, I get it wrong! I need a beer.

tperry724:
Dang I can't it. Every time i look at a datasheet or the internet, I get it wrong! I need a beer.

Ok, glad you've simplified it a bit.

The blue jumper across the bottom should be running between +ve and +ve, not +ve and GND.

You have the green jumper between the Uno and the IC, but it is connected to the SER OUT on the IC. It should be connected to the SER IN.

Assuming you have the LEDs the right way around, I reckon that should be it. Don't forget to post your sketch.

Crossroads,

This look right? I cannot get any of the TPCIC6595s to work. Following good advice and starting with just one. Still doesn't work however.

I hope I'm getting closer with the TPIC6C595s. Using them seems much harder than the 74s. I can't get any of the LED's to light. However, I'm using only old 74 code and perhaps that's the issue. Will different code help?

To turn on LEDs with TPIC6x595, you need +5 to LED anode, to resistor, to an output pin.
Shift in a 1, the output goes Low, the LED turns on. The outputs do not source current, they can only sink current to Gnd.

In your last schematic, the LEDs to the left of the chips are oriented correctly, but the common anode needs to go to +5.
The LEDs on the right need to be flipped around so they can have a common anode, and then connect the anode to +5.

CrossRaords,

Got your code working finally. Takes me a while becuase

CrossRoads,

Got your code working. It took some time as I’m not that strong on the coding side. Variables needed declared, and some syntax needed touched up. Sounds like my code now that I think about it.

#include <SPI.h>


unsigned long bottlePickArray [] = {
0x00000000, // none on
0x00000001, // #1 on
0x00000002, // #2 on
0x00000004, // #3 on
0x00000008, // #4 on
0x00000010, // #5 on
0x00000020, // #6 on
0x00000040, // #7 on
0x00000080, // #8 on
//etc up to
0x400000000, // #31 on
0x800000000, // #32 on
};

void setup() {
  // put your setup code here, to run once:

int ssPin;
int byte0;
int byte1;
int byte2;
int byte3;




//Then you have a counter that keeps track of where you are
byte counter = 1; // first bottle

//To turn off a relay:
digitalWrite (ssPin, LOW);
// break the unsigned long into bytes
byte0 = (bottlePickArray[counter]) & 0x000000FF; // should give 8 lower bits
byte1 = (bottlePickArray[counter>> 8]) & 0x000000FF; // bits 9-16
byte2 =  (bottlePickArray[counter>> 16]) & 0x000000FF; // bits 17-24
byte3 =  (bottlePickArray[counter>> 24]) & 0x000000FF; // bits 25-32
SPI.transfer (byte0);
SPI.transfer (byte1);
SPI.transfer (byte2);
SPI.transfer (byte3);
digitalWrite (ssPin, HIGH); // outputs update on this rising edge


//So turn on one for some amount of time, then send out all 0s to turn it off.


}

void loop() {
  // put your main code here, to run repeatedly:

}

Best,

Tony

Not I, hardly even we, got it going. Below is a link to all 32 leds cycling on and off. The TPIC6C595s are o the board. It working with the 74HC595s too. I had help from a young man - that sounds odd. A techie kid helped me out. I’m 52 so anyone under 30 is a kid. That little code he wrote to test my breadboarding skills was a great idea. It also revealed another wiring error. I need stronger cheaters.