Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: ejasoft on May 05, 2011, 06:58 pm

Title: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 05, 2011, 06:58 pm
hello, i want to do this shifting out to add more pins
http://www.arduino.cc/en/Tutorial/ShiftOut

i have search all over electric parts stores and i cant find this ic 74HC595

what is the trade name for this ship, is hc595?

and if there are any replacement or any project can add more output pin please help me


thank you
Title: Re: 74HC595 Equivalent for shiftout
Post by: Grag38 on May 05, 2011, 07:08 pm
try www.Farnell.com

with 74HC595 there is some ic !
Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 05, 2011, 07:35 pm
thank you sir but there are no egypt branch for them,
if there are some ic replace to this ic please tell me
anyway thank you
Title: Re: 74HC595 Equivalent for shiftout
Post by: CrossRoads on May 05, 2011, 08:39 pm
There are plenty of shift registers, or other parts can be wired to act like shift registers.
For example, an octal latch like '374 can be wired up to act like a single stage shift register.

What are your choices for incountry suppliers?
Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 05, 2011, 08:54 pm
hello, thank you for reply
i have found alot of this http://focus.ti.com/lit/ds/symlink/sn74ls245.pdf
some say it's can use i dnot know how to use it,
if it's can use like the hc595 how to connect it to arduino?

i our country it's too hard to find this parts, i can find some transitors or caps but ic's i can find some amplifirer ic's power, not digital and microconttroler related ic's , atmega328 is not found i have order it form ebay

anyway i will keep search for it, thank you so much
Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 05, 2011, 09:02 pm
i found this part http://pdf1.alldatasheet.com/datasheet-pdf/view/11973/ONSEMI/MC14094.html
it's  8-Stage Shift/Store Register with Three-State Outputs

can i use it ?
Title: Re: 74HC595 Equivalent for shiftout
Post by: CrossRoads on May 05, 2011, 09:17 pm
LS245 is just a buffer , no latching capability.
The MC14094 description sounds good. (I can't get  the datasheet to open, network issue on my end.)
Or if you could get 74AC299PC from newark.com, that's a nice part. 24 mA source & sink capability.
Shift-in , shift-out, shift left or right also. Lots of functionality.
Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 06, 2011, 12:33 am
thanks CrossRoads,
i have upload photo about pin assignment from pdf file for MC14094

can you tell me how to connect it to arduino like
http://arduino.cc/en/uploads/Tutorial/ShftOutExmp1_2.gif
http://www.arduino.cc/en/Tutorial/ShiftOut

thank you
Title: Re: 74HC595 Equivalent for shiftout
Post by: CrossRoads on May 06, 2011, 06:55 am
This one is easy.
You will define 3 output pins:
data_pin, connect to pin2
serial_clock, connect to pin3
storage_clock, connect to pin1
connect pin15  high to enable the output drivers.
You will define a variable 'data_byte' which will hold your data to be shifted out

To load up data, you  will do this:
data_byte = next_data_to_be_shifted_out;   // up to you to set that up

shiftout (data_pin, serial_clock, MSBFirst, data_byte); // the 8 bits are loaded into input stage of shift register
digitalWrite (storage_clock, HIGH); // setup to latch the output data
digitalWrite (storage_clock, LOW); // clock going Low latches data into the output stage

check the reference page to make sure the correct letters are capitalized.
Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 06, 2011, 05:13 pm
thank you crossroads it's work very nice,
but is there any way to connect another one to same pin from arduino like
http://arduino.cc/en/uploads/Tutorial/ShftOutExmp2_1.gif

i have two ic of MC14094 , thank you so much
regards
Title: Re: 74HC595 Equivalent for shiftout
Post by: CrossRoads on May 06, 2011, 05:50 pm
Yes, you connect them in series.
Connect serial_clock, storage_clock, and output lines together.  << Sorry, output_enable   
\
Connect Q's, or Qs, from device 1 to SER pin in device 2.
(typically one inverts the data, the other does not - experiment a little).
Then do 2 shiftouts:

shiftout (data_pin, serial_clock, MSBFirst, data_byte2); // goes into 2nd in line part
shiftout (data_pin, serial_clock, MSBFirst, data_byte1); // goes to 1st on line part
digitalWrite (storage_clock, HIGH); // setup to latch the output data
digitalWrite (storage_clock, LOW); // clock going Low latches data into the output stage

Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 07, 2011, 03:59 pm
thank you mr crossroads,
i will try it soon, but i want to ask about blink some led on some pin of the shiftregister
eg pin 2 i use this code and led not blink it's on all the time

Code: [Select]
//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;



void setup() {
  //set pins to output so you can control the shift register
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {


    byte outVal = 0; // Define output data
    bitSet(outVal, 2); // Set bit 2
    digitalWrite(latchPin, LOW);

    shiftOut(dataPin, clockPin, MSBFIRST, outVal);

    digitalWrite(latchPin, HIGH);
   
    // pause 
    delay(1000);
// }
}


what is the problems in my code or if there are simple way to high a pin without this

Code: [Select]

    byte outVal = 0; // Define output data
    bitSet(outVal, 2); // Set bit 2
    digitalWrite(latchPin, LOW);

    shiftOut(dataPin, clockPin, MSBFIRST, outVal);

    digitalWrite(latchPin, HIGH);




i will use the shiftregsiters to control a 16 rely

----------------------

on the scend one of the shift register
when i want to high one pin like 1 or two
the code will
Code: [Select]


    byte outVal = 0; // Define output data
for the pin two one the scend register it's will 8+ 2 ?

    bitSet(outVal, 10); // Set bit 2

    digitalWrite(latchPin, LOW);

    shiftOut(dataPin, clockPin, MSBFIRST, outVal);

    digitalWrite(latchPin, HIGH);

thank you so much
Title: Re: 74HC595 Equivalent for shiftout
Post by: CrossRoads on May 07, 2011, 06:49 pm
Try the Strobe line in the order I suggested:

shiftout (data_pin, serial_clock, MSBFirst, data_byte); // the 8 bits are loaded into input stage of shift register
digitalWrite (storage_clock, HIGH); // setup to latch the output data
digitalWrite (storage_clock, LOW); // clock going Low latches data into the output stage


Strobe LOW is what latches the data.
Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 08, 2011, 03:50 pm
thank you mr crossroads,
i have do alot of serach and found this http://www.pauloricca.com/index.php?a=blog&project=ExtraOutputs
it's very easy, but i will try yours and try to understand it,
thank you
regards
Title: Re: 74HC595 Equivalent for shiftout
Post by: CrossRoads on May 08, 2011, 04:54 pm
Okay, just keep in mind that Your part, MC14094, requires a  Low signal to hold the output data, while the 74HC595 uses a clock signal going from Low to High to latch the data.
Title: Re: 74HC595 Equivalent for shiftout
Post by: ejasoft on May 08, 2011, 09:19 pm
thank you very much, mr crossroads,
i have ordered some 74c595 and arrived, and now i play with it and try to understand the shiftout,
thank you so much you are very helpfull sir,
regards