0
\$\begingroup\$

I worked out how to drive a ledmatrix (8x8) width monochrome leds with 2 SN74HC595N on a STM32F103C8 over SPI. It works. (Un) fortunately I got my hand on a free a bag of SN74LS595N's.

I tried to drive the leds with that, because I think that should be possible.

However, when I simply replace the SN74HC595N with the SN74LS595N, things "do not work". That is, no led will power on. However, in the datasheet, I cannot find any difference in pinout, but only in clock speed. I tried to lower that, but still no led startded.

Googling etc. is really hard, since google cannot distinguish SN74LS595N from SN74HC595N, and goes mostly for usable results for the SN74HC595N.

So my question is: what are the differences between the SN74HC595N and the SN74LS595N in respect of the STM32F103C8, and what are specific settings to keep in mind.

\$\endgroup\$
6
  • \$\begingroup\$ Related (and pretty much enough to explain): electronics.stackexchange.com/questions/358620/… , see the top answer \$\endgroup\$ – fraxinus Feb 12 at 19:19
  • \$\begingroup\$ Google with quote marks, it means "search precisely for this and not a letter different". What voltage are you running at? \$\endgroup\$ – Ilya Feb 12 at 19:23
  • \$\begingroup\$ Schematic, please. We don't know what your exact problem is without it. It's probably either the VCC voltage or how the chip is hooked to the LED, so you can try with just that section first. \$\endgroup\$ – TimWescott Feb 12 at 19:23
  • \$\begingroup\$ Yeah I thought right away it's the voltage or pulse timings. Pulse timings seem similar enough in datasheet. And I think we already figured it out. The older (replacement in your case) chip runs on 4.5V-5.5V, not on 3.3V. \$\endgroup\$ – Ilya Feb 12 at 19:24
  • \$\begingroup\$ LS chips work at 5V supply. But more important is how they are connected to the LEDs? They can't be used as high side drivers. Post schematics. \$\endgroup\$ – Justme Feb 12 at 19:40
4
\$\begingroup\$

STM32F103C8 is a 3.3V chip. The 74LS TTL series requires 5V. There are consequences to having a mixed voltage system that are not really worth explaining here. You should get the actual part unless you want to read and understand all the differences and make accommodations (spoiler: it will be more trouble than getting the correct parts). There are also significant differences in how the outputs work that may or may be relevant depending on the circuit.

\$\endgroup\$
5
  • \$\begingroup\$ 74LS will accept a 3.3V CMOS output as valid however, so if they can drive the LEDs they would work with 5V power. \$\endgroup\$ – TimWescott Feb 12 at 19:21
  • 2
    \$\begingroup\$ @TimWescott Yes, output only and with changes it might work. But LSTTL does not source current very well as you get close to Vcc. \$\endgroup\$ – Spehro Pefhany Feb 12 at 19:23
  • 1
    \$\begingroup\$ That's what I was alluding to with "if they can drive..." I was too lazy to write it out. \$\endgroup\$ – TimWescott Feb 12 at 19:24
  • \$\begingroup\$ @SpehroPefhany, so if I understand you correctly, in respect of the STM32F103C8 the 74LS TTL "will not work unless" because of the voltage differences, and a mixed voltage circuit is not worth the efford/costs. Better get the CMOS for a few cents instead of the "free" TTL? \$\endgroup\$ – Caspar Kleijne Feb 12 at 19:34
  • 1
    \$\begingroup\$ That's my suggestion, based on your information. Of course if you really want to learn something instead of just getting on with it you can actually study the datasheets and probably make something work, but I did not get that impression from your post. \$\endgroup\$ – Spehro Pefhany Feb 12 at 20:15
3
\$\begingroup\$

Some points:

  • LS chips are 5V only, you will need a stable 5V supply, not 3.3V.
  • LS chips are far less forgiving in power supply issues. You might need (much) better Vcc decoupling than you needed with the HC's, at the very least one 100 nF cap per chip.
  • LS chips require TTL (5V) input; the 2.0V for high is probably not a problem, but their inputs require some sunk current for a logical 0. I think this will not be a big issue, but if you had series resistors you will need to remove them.
  • the voltage margin for a logical 0 is much less for TTL than for CMOS, so ground bounce (ground pin voltage raised due to a high current) might be an issue
  • If you used a chain of 595's: that is a marginal situation. There is a clock/data race between the (shared) clock and the data output from one chip to the next. Feeding the clock from the far end sometimes helps. With HC's a clock delay is sometimes created by including series resistor(s). This might not work well with LS chips.
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Samll edit done. In some cases the LSTTL input sink requirement for low might be more of a problem than the 2.0V for high. \$\endgroup\$ – Wouter van Ooijen Feb 13 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.