Pages: [1] 2   Go Down
Author Topic: SN74LS164N don't work  (Read 1225 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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   
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

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.

Offline Offline
Edison Member
*
Karma: 23
Posts: 1173
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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".
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* breadboard.jpg (119.58 KB, 914x485 - viewed 44 times.)

* schematic.jpg (45.05 KB, 800x643 - viewed 55 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10523
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The (0.1uF) decoupling capacitor is never optional in digital electronics.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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. 
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* Octal_latch_shift_register.jpg (72.86 KB, 720x960 - viewed 43 times.)
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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);
  }
}
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 444
Posts: 23861
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That 2nd one is pretty much the shiftout() command.
Am surprised that isn't working.
Logged

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.

Toronto, Canada
Offline Offline
Edison Member
*
Karma: 2
Posts: 1234
"Keep it R.E.I.L. - "Research, Experiment, Investigate and Learn"
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

IRL
Offline Offline
Full Member
***
Karma: 0
Posts: 146
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I also have PIC related web domain.

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

@takao21106: thank you for your reply, now I have the proof that the LS is not good for this kind of experiments smiley-wink
Logged

Pages: [1] 2   Go Up
Jump to: