??? 06/22/06 13:43 Modified: 06/22/06 14:19 Read: times |
#118848 - Depends on your needs... Responding to: ???'s previous message |
Munaza said:
now im using 74HC595 (thnx to mr.kai klass)IN place of the 8255.can anyone tell me where to connect the two of its pins nmely shift register clk input & storage register clock input with the c51.for the 74HC597 SHall i connect the parallel load input pin with the ALE of c51????? Munaza, these 74HC595/7 is only an example of shift registers you could use. Take care, as Richard already mentioned these types of shift registers are a bit complex and allow you to do more than a standard shift register does. I only wanted to open your eyes, what you can expect from a modern shift register. Again, what kind of shift register is suited for you depends on your needs. Have a look for instance at 74HC597. It allows you to latch input values, while at the same time shifting the formerly latched input values. But if you don't need this option, means if you can latch the input values after having completely shifted the formerly latched input values, then you don't need a shift register with an additional input latch, you can load it directly into the shift register via parallel inputs. In such a case, you can use a 74HC165, which has direct overriding data inputs (8bit parallel) or you can use the 74HC166, which is nearly the same as 74HC165, but has synchronous data inputs, means data is latched synchronously to the clock input. The same with the serial-in-parallel-out shift registers: You can use a simple one, like 74HC164, then you have a shift register not providing an additonal output latch. This means, that during the whole shiftings the values at outputs are changing all the time. Only after the last bit was successfully shifted, you have stable outputs. In your case, this would mean, that during each shifting operation the traffic lights are flickering. In some applications, especially if the shifting is very fast this need not to be disadvantageous. But in your application I would recommend to use an additonal output latch, which keeps the output stable even during the shiftings. When all the shiftings are finished, then the data is latched into the output latch and a new set of data appears at the outputs going to the traffic lights. Such an additional output latch allows you to keep the shiftings "hidden". But even if you decide to use a shift register with an additional output latch, you can chose several different options: 74HC594, for instance, provides a direct clear of output latch. This option can be helpful to reset the output latch during a power on reset, to prevent ridiculous traffic light readings after a power-on. Or you can use the 74HC595, which has 3-state outputs, which can also be helpful in certain applications. Now to your questions: Munaza said:
now im using 74HC595 (thnx to mr.kai klass)IN place of the 8255.can anyone tell me where to connect the two of its pins nmely shift register clk input & storage register clock input with the c51. Connect one free port line to SER input. Toggle this port line to emit the data bits. Connect another port line to SRCK input. With each low to high transition the data being present at SER input is shifted by one bit. Connect another port line to RCK input. After all the shiftings, apply a low to high transition to store the data into the output latch. The shifting procedure is as follows: Apply the first bit of data to be shifted at SER, while SRCK and RCK are logic low. Then, toggle the SRCK input from low to high and from high to low again by suited instructions. Now, apply the next bit at SER. Again, toggle the SRCK input from low to high and from high to low. Do so, until the last bit was shifted. Then, toggle the RCK input from low to high and high to low, which makes the data to be stored into the output latch. I name these lines as follows: SER is DATA, SRCK is CLOCK and RCK is STROBE. Munaza said:
for the 74HC597 SHall i connect the parallel load input pin with the ALE of c51????? No, no, you confuse this. The ALE is needed for another task, for latching the low byte of the address during accesses to external memory. But that's a total different story and has nothing to do with the shift registers. Kai |