User avatar
coreywi
Posts: 17
Joined: Thu Dec 31, 2015 6:56 pm
Location: Calgary, Canada

interfacing to 74x595 controlled LED displays

Wed Feb 03, 2016 3:38 am

Hello All,

I'm having a devil of a time interfacing my RPi Model B+ to a Sure Electronics 4", 2-digit LED board.

So I post to the forum if anyone has any suggestions on what I might try to diagnose my problem. I'm thinking/hoping this might be a simple 74x595 problem, but I'm not sure if how I'm using the RPi might be causing the grief.

I could really use some assistance since I cannot get recognizable characters/digits to display.

Here's the board.

http://store3.sure-electronics.com/de-dp22911

(there's a doc link on that site as well, if you are inclined - search for DE-DP004)

I looked at the board schematic and each 7-segment display is driven by on-board, serial 74x595 chips, each with a ULN2003 that drives the displays. The board input signals consist simply of:
  • +12VDC,
    +5VDC,
    GND,
    CLK IN (goes to 595 PIN 11,12, active HI),
    DIMM IN (goes to 595 PIN 13, active LO)
    DATA IN (595 PIN 14).
Standard configuration: the QH' of the first 74x595 cascades into the next 74x595 in the line.

Using the awesome WiringPI library, I designated 3 GPIO pins in output mode, and I'm writing to the pins using the same library. I also needed a logic level converter that takes the 3.3V out of the GPIO and converts it to 5V to control the display board. I verified the HI levels as +5V coming out of the logic level converter.

So this is what I'm doing:

Set DIMM HI, which blanks the display.
I shift in 16 LO signals (each clocked by sending CLK LOW, then CLK HIGH). This should initialize the 595's?
Set DIMM LO, nothing displayed. Ok.

So I then shift in 0xee, just like I do above (one bit at a time on DATA IN, with CHK LOW, CLK HIGH for each DATA bit) which according to the docs, is supposed to display a 'a' character, but it displays garbage. Consistent garbage, mind you, but garbage. Sending in several different, recognized data patterns all give me repeatible, scrambled results.

The display came with a 'demo' board which happily counts up and down on the display, so at least I know the board is working.

The Chinese vendor has tried to be helpful, but no luck communicating my problem with the language barrier.

I've tried inserting a 25ms pause between each signal change, and no difference.

Any advice on where I might look would be VERY appreciated.

ghp
Posts: 1498
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: interfacing to 74x595 controlled LED displays

Wed Feb 03, 2016 5:36 am

Sending in several different, recognized data patterns all give me repeatible, scrambled results.
Hello,
perhaps the mapping of bits to segments in docs is not matching reality. Try to send in bytes where only one bit is set at a time, and build your own mapping table from bit position to segment.
Good luck,
Gerhard

User avatar
Burngate
Posts: 6302
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: interfacing to 74x595 controlled LED displays

Wed Feb 03, 2016 5:28 pm

Further to ghp's suggestion, it's possible that you're sending the bits in reverse order?
It appears the two clock signals are driven in parallel. That being so, if you slow your clock right down - say 250ms or 500ms instead of 25ms between changes - you should see the bits march round the display, in some sort of order

I wasn't happy with the pdf - it didn't give a table I could understand - so I drew my own.
Perhaps it might help?
decode.png
decode.png (14.55 KiB) Viewed 607 times

User avatar
coreywi
Posts: 17
Joined: Thu Dec 31, 2015 6:56 pm
Location: Calgary, Canada

Re: interfacing to 74x595 controlled LED displays

Thu Feb 04, 2016 7:53 pm

Hi there.

Thanks so much! It turns out the problem was I was using a much too high clock rate AND the documentation did not match reality. I slowed the clock rate down by introducing a 175ms delay for shift propagation and things started working repeatably.

And I took ghp's suggestion of only shifting in 1-HI bit at a time in a byte and watching the bit 'march around' that I was able to more easily determine what's happening in the 74x595 chips.

Serves me right for trusting documentation. Go figure.

Cheers from Calgary, Canada.

Return to “Interfacing (DSI, CSI, I2C, etc.)”