So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By sprinkfitter
#71822 Sounds like a great idea. It is looking like I need 10 digital pins that I am looking at 74hc595 shift register and a total of 5 analog pins with a mcp3008 on a SPI setup. I was looking to do this with a Wemos mini. What do you guys think of this setup. I will be switching 2 relay on and off at the same time. I wonder how much delay would there be turning 2 relay on at the same time with the shift register? Thanks for all the help
User avatar
By sprinkfitter
#71850 I was wondering since I need to turn on 2 relays at one time would it be better doing it by SPI and do the analog pins by i2c. I did a breadboard with i2c and a 74hc595 and read there is a delay between the shifts. Would that have any affect on trying to turn 2 relays on at the same time. Or can you write a code to help with the delay. Thanks for the help
Ray
User avatar
By lethe
#71852 The output of the shift register only change, when you pulse the latch line (RCLK on 74HC595), so it does not matter how fast or slow you shift out your data, all outputs will change at the same time.

You can use SPI to drive the shift register, the only difference is that instead of pulling a chip select line low during the transfer, you pulse the latch after all bits are shifted out. This won't interefere with other SPI devices on the bus, as long as you don't assert their chip select line.
Talking to other devices on the bus will change the internal state of the shift register, but that's not an issue, since the outputs won't change.
User avatar
By sprinkfitter
#71930
lethe wrote:The output of the shift register only change, when you pulse the latch line (RCLK on 74HC595), so it does not matter how fast or slow you shift out your data, all outputs will change at the same time.

You can use SPI to drive the shift register, the only difference is that instead of pulling a chip select line low during the transfer, you pulse the latch after all bits are shifted out. This won't interefere with other SPI devices on the bus, as long as you don't assert their chip select line.
Talking to other devices on the bus will change the internal state of the shift register, but that's not an issue, since the outputs won't change.

Wow interesting. So what you are saying I can use the spi bus add both digital and analog pins. So use the 74hc595 for digital and a mcp3008 for analog pins.