Go Down

Topic: SN74LS164N don't work (Read 1 time) previous topic - next topic

dreamworker72

Hi to all, I'm Paolo an Electronic Engeneer from Italy. I decided to use Arduino for teaching microcontrollers programming to some students in private lessons. Usually all ideas are easy to create with Arduino, but now I have a problem.
I must use a shift register call SN74LS164N and it don't work neither with shiftOut function, nor with explicit use of digitalWrite construct on clock and data inputs, even if I wired properly the chip with datasheet. The  LEDS on OUTPUT pins remain off if I connect the data and clock on arduino pins choosed for this function, but if I connect the data INPUT directly to 5 volts all LEDS turned on.
My Oscilloscope is broken and I can't use it for testing the chip, before I construct a test circuit with NE555 someone can tell me something about SN74LS164N and his experience with this chip?
Regards
Paolo   

CrossRoads

http://www.ti.com/lit/ds/symlink/sn74ls164.pdf

You are holding the Clear/ line high, and B (or A) high, while you use CLK and A (or B) as the Serial Data in line?

You also have a 0.1uF cap on Vcc pin? (and not on any other control line)
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

DVDdoug

Do you have a schematic?  (I have no idea how it's connected or where your LEDs are connected, etc.)  I assume you've tried a 2nd chip?

Quote
My Oscilloscope is broken and I can't use it for testing the chip
If you run this thing slow enough and basically single-step it, you can use a multimeter check the input/output states.  Even with a 'scope, it would be easier to troubleshoot if you can check it while there's no clock and everything is static.

Techone

or he can use a logic probe, if the 555 is set to a slow frequency ( 5 Hz ).

I just check my parts... I do have that chip ( 4 of them, maybe more ...  ). I wonder thay still working...  :smiley-roll: 

A quick check the datasheet... and CrossRoads is right. A or B input for data, as long one of them is HIGH. The /MR is in my opinion, connect to the reset pin of the Arduino. A LOW will reset the chip also the Arduino. In my experiments with Flip-flops, you have to reset the FF. I did without reset the FF - connect to HIGH, and it did not work. I use the chip 74LS90 and also 74LS74. And a clock signal at the clock pin.

I don't know if the shiftOut() will work, but it is worth to try and see what happen. The "tiny" problem with this chip compare with the 74HC595 is the lack of a "latch".

CrossRoads

Lack of a latch just means the LEDs connected to the output will flicker as data goes thru.
The Clear/ line can be connected to an arduino output if the user needed to clear the chip under software control.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

dreamworker72

Thank you for the replies. I draw with Fritzing the circuit for clarity.
@CrossRoad: You link the datasheet that I use. I don't place the 0.1uF cap: Is This integrated  so sensitive to fluctuations ? I'll try with cap than.
@Techone:
Quote
or he can use a logic probe, if the 555 is set to a slow frequency ( 5 Hz ).
Infact this is the method I want to use, but I'll try the method of DVDdoug to learn something new.

dreamworker72

I created the test circuit  with period of 1 second, selecting properly the resistors and capacitors, and the IC work correctly. Then I guess there is some problem with the timing of LOW and HIGH voltage level.

MarkT

The (0.1uF) decoupling capacitor is never optional in digital electronics.
[ I won't respond to messages, use the forum please ]

dreamworker72

@MarkT:
Quote
The (0.1uF) decoupling capacitor is never optional in digital electronics.
I know that this are a good project rule, but in this simple case is not essential, however I try after the hint of CrossRoads but the problem is still present. Without Arduino and using NE555 and a switch the circuit work correctly. 

CrossRoads

Post your code, I bet there is something simple wrong.
I used an Octal Latch as a shift out register, same logic as the LS164 but with the connections made externally.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

dreamworker72

@CrossRoads:
my code
Quote

//first simple version
const int clock = 6;
const int data = 7;
void setup()
{
  pinMode(clock, OUTPUT);
  pinMode(data , OUTPUT);
  digitalWrite(clock, LOW);
  digitalWrite(data,LOW);
  shiftOut(data, clock, LSBFIRST, B10101010);
}
void loop(){}

After this attempt gone wrong I try with this
Quote

const int data = 7;
const int clock = 6;

void setup(){
  pinMode(data, OUTPUT);
  pinMode(clock, OUTPUT);
  digitalWrite(clock,LOW);
  digitalWrite(data,LOW);
}

int numero = 0;
void loop(){

  if (numero <= 255){
    numero++;
  }
  else{
    numero = 0;
  }

  scrivi(numero);
  delay(500);
}

void scrivi(byte dato){

  for (int i = 0; i <= 7; i++){
    digitalWrite(data, bitRead(dato, i));

    delay(100);
    digitalWrite(clock, HIGH);
delay(100);
    digitalWrite(clock, LOW);
  }
}

CrossRoads

That 2nd one is pretty much the shiftout() command.
Am surprised that isn't working.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Techone

Connect the /MR to the reset pin of the Ardiuno, and re-run the code and see what happen. I suspect the chip did not reset properly.

Try it and see what happen.

takao21106

you need cap for higher frequency, not always required
if you have additional caps already on the board.

when you get strange effect by touching the pins or the PCB,
then you need more decoupling caps.

Have you connected A and B inputs?

Also LS TTL is not really good, HC or HCT is better, works at voltage less than 5 volts.
I also have PIC related web domain.

dreamworker72

Excuse me for this late reply, but I had some problems. I seek the hints of Techone and I understand that the problem is the /MR pin. The funny thing is that if I include a resistor between Vcc and /MR pin the IC work corectly, however I pulled out one 74HC164 from an old PIC circuit and I was able to perform the lesson. Thank you to all for your effort :)

@takao21106: thank you for your reply, now I have the proof that the LS is not good for this kind of experiments ;)

Go Up