reading data to hc164

HI
I have painted myself into a corner by offering to fit 3 bigger led displays to a friends machine that has 2 inch 7seg displays.
The displays I have are 7x5 alphanumeric unfortunatley driven by MAX7219..

The orig display has 3 x HC164 latchless shift registers, and I must leave this working, so I can tap into the data and clock feeds.

I bought home one of the displays and knocked up a test jig to send segment patterns with shiftout ( with no latch ) which works fine, but I have no idea what data rate is used in situ ( and I had to sell my scope :frowning: )

#define data 18
#define clock 17
int delaytime = 500;


//  I got these patterns from the existing wiring between the chips and the 7seg led displays
byte zero  = B10001000;
byte one   = B11101011;
byte two   = B01001100;
byte three = B01001001;
byte four  = B00101011;
byte five  = B00011001;
byte six   = B00011000;
byte seven = B11001011;
byte eight = B00001000;
byte nine  = B00001001;


void setup()
{
  pinMode(clock, OUTPUT); // make the clock pin an output
  pinMode(data , OUTPUT); // make the data pin an output3
}
void loop()
{  //  shiftOut(data, clock, LSBFIRST, B01000000);
  shiftOut(data, clock, LSBFIRST, zero);
  delay(delaytime);


  // shiftOut(data, clock, LSBFIRST, B01000000);
  // shiftOut(data, clock, LSBFIRST, zero);
  //  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, one);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, two);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, three);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, four);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, five);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, six);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, seven);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, eight);
  delay(delaytime);
  shiftOut(data, clock, LSBFIRST, nine);
  delay(delaytime
       );
       }

I seem to be stuck just thinking about how to convert the 3 lots of serial bytes back into something I can use in a switch case routine to refer to my 5x7 matrix array patterns.

Its not a simple serial read, with its clock and data signals, and I cannot get shift(in) working.

Any suggestions ? I think my 73 years are catching up with me !

Can you put the machine clock on an Arduino interrupt pin and use micros to tell you how fast it's running?

Maybe read the data line at the same time.

I think I will have to make a plan like that, it is at in a factory and I will have to balance my laptop on top of the machine ( and me :slight_smile: )

Perhaps I can just have an interrupt on the falling clock pin to read the data, and save it in bunches of 8, or something.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.