Skip to main content
8 votes

for loop running infinitely

After a chat with OP, it turned out this was a more complex issue, probably a memory overrun. This cannot be seen in this small snippet, but the whole program is using memory extensively (global ...
jfpoilpret's user avatar
  • 9,132
5 votes
Accepted

Is there a way to shift through sensors

As I mentioned in the comments, one way to do this is to use a multiplexer. You haven't said which temperature sensors you are planning to use, so I'll illustrate this example using the TMP36 ...
sempaiscuba's user avatar
  • 1,032
4 votes
Accepted

More than 500 pins

You don't connect shift registers as a tree. That would be awfully slow. Instead, you connect them as chains. Shift registers are meant to be chained by connecting the serial out of one register to ...
Edgar Bonet's user avatar
  • 43.1k
4 votes
Accepted

Seamlessly loop through LED's - Shift Register

You mean something like this? (untested): void loop() { // use static or global variables to remember positions (these are initialized only once): static uint8_t hi_pos = 0; // where HIGH should ...
KIIV's user avatar
  • 4,752
4 votes
Accepted

Are the output pins on the 74HC595 shift register protected against shorting?

In this data sheet it says: When the output-enable (OE) input is high,the outputs are in the high-impedance state. However on page 3 you will notice that the *OE pin controls all outputs at the ...
st2000's user avatar
  • 7,325
4 votes

Is there a way to shift through sensors

Have you looked at OneWire temperature sensors? You connect them to a bus IC and the bus IC to your Mcu. This allows you to multiplex many sensors. You can also forego the master bus IC and just ...
RubberDuck's user avatar
4 votes
Accepted

Weird output from chained 74HC595 shift registers

You should change your capacitors. You only have 0.1µF instead of 1µF for the bulk capacitor (which really wants to be 10µF). In addition you should add 0.1µF (100nF) capacitors directly across the ...
Majenko's user avatar
  • 105k
4 votes
Accepted

Overheating Shift-Register(74HC595)

I can only think about two things: (least probably): the entrance (VCC) voltage is too high. (most probably): the resistors to the LEDs are (too) low .. Recalculate the values and check the max ...
Michel Keijzers's user avatar
4 votes
Accepted

74HC595 to 4 Digit 7 Segment using SevSegShift Library

Finally able to fix it with the help of @PeterPaulKiefer, I was able to find the problem. The problem is in the code itself (schematic is alright. No changes there) and this is the updated code. #...
fireblazer10's user avatar
4 votes
Accepted

if(Serial.available()>0) VS while(Serial.available()>0)

I figured out why while(Serial.available()>0) and if(Serial.available() > 0) would or would NOT work in terms of my shift register code. It has to do with the serial monitor line feed and ...
Kuan's user avatar
  • 71
4 votes
Accepted

How can I SPI "Latch" (LE/CS/SS) for a specific number of SCLK cycles?

I've achieve this by "bit-banging" via a modified shiftOut() of ArduinoCore-avr/cores/arduino/wiring_shift.c, essentially allowing for two data lines on the same clocking: void keyedShiftOut(...
George Kerwood's user avatar
3 votes

Weird output from chained 74HC595 shift registers

I have forum post about the 595 chip and a question and answer about SPI. You can use SPI to do the transfer. This is faster and simpler than shiftOut. Also you need to bring the latch low before ...
Nick Gammon's user avatar
  • 38.2k
3 votes
Accepted

DS3231 AT24C32 IIC making digital outputs not work

This looks like a classical case of pin conflicts when merging several sketches. In this case it is hidden by the fact that TWI SDA and SCL are separate pins on the Arduino Leonardo. But they are ...
Mikael Patel's user avatar
  • 7,969
3 votes
Accepted

Using SPI and 2 shift registers WITHOUT libraries

The main problem you seem to have is how to implement shiftOut. Well, that's actually quite simple once you understand how shiftOut actually works. You already know how to set a pin HIGH or LOW - all ...
Majenko's user avatar
  • 105k
3 votes
Accepted

Having trouble with 74HC595 and Uno

Serial.read() is going to give you ASCII codes. So when you send 1 from the serial monitor the Arduino receives 49. Note that the ASCII code for a digit is the same as the digit plus 48, so that ...
Delta_G's user avatar
  • 3,270
3 votes
Accepted

What value of resistance to put between the output of a 74hc595 and the LEDs?

You are correct that a lower resistance would offer higher brightness. The more current through the LED, the brighter it will be. The current is calculated by dividing the voltage across the resistor ...
Randy's user avatar
  • 407
3 votes
Accepted

Read the value of a register in arduino

To convert my comments to an answer: You can use the register names directly. They are defined in the boards/chips core. To read them, simply use the names in your calculations. Write to the ...
chrisl's user avatar
  • 16.3k
3 votes
Accepted

Is the shiftOut code depending on the (low) speed of an Arduino?

Some time ago, I timed digitalWrite() and direct port write commands by looping over 10,000 executions of each and timing them with millis(). I made both tests on a 16MHz Atmega 328p at 16MHz. For ...
JRobert's user avatar
  • 15.3k
3 votes

Cant make the second 74HC595 to start counting

Solved using https://arduino.stackexchange.com/a/17093/37827 By removing the custom shiftOut function and changing my shiftOut(dataPin, clockPin, 0); shiftOut(dataPin, clockPin, col); with shiftOut(...
Feeds's user avatar
  • 163
3 votes

What's wrong with this code..?

I can't add comment to your question so I post as an answer even though this is not much an answer. This is just a hint to solve your problem. 8x8 led matrix and 595s are pretty low-level stuff, so I ...
SimonVu14's user avatar
  • 124
3 votes

How often should we poll the 74HC165 if we wish to detect 'button' presses?

For this you can employ the nyquist-shannon theory for signal sampling. In short it states that "to sample a signal frequency of X you need at least 2x X samples per second". So if you know ...
Majenko's user avatar
  • 105k
2 votes
Accepted

Advanced I/O shifting bits

For the 74HC595 in combination with the Arduino, the best way to check is to use the default example by Arduino: ShiftOut With the ShiftOut you can shift the bits into the IC which will make the ...
Michel Keijzers's user avatar
2 votes
Accepted

ATmega328P SPI Slave

You have control over when you place a byte in the TX buffer and control over when you read a byte from the RX buffer. You don't have control over when the master sends data to you, though, so ...
Majenko's user avatar
  • 105k
2 votes

Strange behavior on 74HC595 Shift Register IC when its GND pin is used

Disconnecting the ground pin was not a solution. It is hard to be certain from video but the resistor values are likely too small because I can't see any color on the bands. They are 100? Look ...
jdr5ca's user avatar
  • 1,385
2 votes
Accepted

Maintaining pull down on a relay with a shift register

You have misunderstood how shift registers work - and one of the main reasons they exist in the first place. Shift register ICs have a common 'latch' pin which latches the data present at the input ...
CharlieHanson's user avatar
2 votes

Can I power my shift register with a 12V external power supply and connect only the data, strobe and clear pins to the Arduino digital pins?

No. CD4k devices reference their high and low voltages to a (mostly) fixed ratio of Vdd, so there will be no way for the Arduino to operate the device. Consider using a TPIC6C595 instead, which ...
Ignacio Vazquez-Abrams's user avatar
2 votes
Accepted

How do I choose proper diodes for a 74HC595 shift register with a wired OR connection?

For this, almost any diode will work. Searching, it turns out that the 1N4148 is a popular ubiquitous choice. But don't go out of your way to obtain this particular diode. Maximum rated forward ...
st2000's user avatar
  • 7,325
2 votes
Accepted

Is the ShiftOut tutorial on the official Arduino website really wrong regarding the capacitor?

That tutorial, as with a number on the Arduino site, is wrong. Yes, the capacitor should be across Vcc/GND - it is a decoupling capacitor used to absorb the current surges when you turn LEDs on and ...
Majenko's user avatar
  • 105k
2 votes
Accepted

What shift register would I need for input OR output?

since you already have input, use an 74HC165 8-bit parallel-in/serial out shift register. They are cheap. another cheap option with I/O is an expander like the PCF8574, which are almost cheap
dandavis's user avatar
  • 1,037

Only top scored, non community-wiki answers of a minimum length are eligible