Buffer as homebrew SPI

11 Feb 2012

I am trying to use a 74hct573 (i also have 574's and 541's with me at the moment, any will work)with spi. Technically Im trying to read the values of 8 switches in (the reason for this is I need the values to come in in order,long story), however right now I have it hooked up to send the values to 8 leds for troubleshooting, if i can get it working one way im sure i can get it working the other. Whether reading switches lighting leds its always just returns 255, or lights all 8 led's.

I have done this exact same same thing before with no problems(in the direction of lighting LEDs, not reading switches) but I learned programming microcontrollers in assembly and on an older motorolla chip, so im not use to having these premade libraries where you aren't controlling and setting everything from scratch.

Has anyone tried making a homebrew SPI device with the premade spi library? Im beginning to think there is some underlying issue with doing this in the way the premade library functions. Im down to do it without any premade libraries, but couldn't readily figure out how to go about doing everything manually (as in configuring and reading registers myself).

12 Feb 2012

I dont understand what you are trying to do. The 573, 574s are 8bit parallel latches. SPI is used for shiftregisters. I have used SPI with 74595s for outputs and you can use 74165 or 74597 for inputs.

12 Feb 2012

Yeah you just run the output of the first to the next input etc no need for a specialized chip. Its really not that complicated a thing to do, but with all this premade library stuff where you can't really tell whats going on. I just ran across some mentions of lpc17xx.h, I haven't messed with it yet but I think thats what I was looking for to be able to just do it all from scratch.