0

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.

Caspar Kleijne
  • 176
  • 1
  • 10
  • Related (and pretty much enough to explain): https://electronics.stackexchange.com/questions/358620/74ls-vs-74hc-series-ics-for-ben-eaters-8-bit-computer , see the top answer – fraxinus Feb 12 '21 at 19:19
  • Google with quote marks, it means "search precisely for this and not a letter different". What voltage are you running at? – Ilya Feb 12 '21 at 19:23
  • 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. – TimWescott Feb 12 '21 at 19:23
  • 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. – Ilya Feb 12 '21 at 19:24
  • 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. – Justme Feb 12 '21 at 19:40
  • Although Google might have trouble distinguishing the part numbers, Mouser and Texas Instruments have no problem. I have Mouser set as a custom search in Chrome. I copied the part numbers from your question into a Mouser search, which brought up a link to the official datasheets from TI. (I really only needed that to see that it's a shift register; I learned the hard way as a high-school student in the 1980s the difference between the LS and HC series chips.) – Theodore Feb 12 '21 at 21:15

2 Answers2

4

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.

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
  • 74LS will accept a 3.3V CMOS output as valid however, so if they can drive the LEDs they would work with 5V power. – TimWescott Feb 12 '21 at 19:21
  • 2
    @TimWescott Yes, output only and with changes it might work. But LSTTL does not source current very well as you get close to Vcc. – Spehro Pefhany Feb 12 '21 at 19:23
  • 1
    That's what I was alluding to with "if they can drive..." I was too lazy to write it out. – TimWescott Feb 12 '21 at 19:24
  • @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? – Caspar Kleijne Feb 12 '21 at 19:34
  • 1
    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. – Spehro Pefhany Feb 12 '21 at 20:15
3

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.
Wouter van Ooijen
  • 48,407
  • 1
  • 63
  • 136