VMLAB users forum
http://www.amctools.com/cgi-bin/yabb2/YaBB.pl
General discussion boards >> Contributors /  User-defined Components Repository >> 74HC595-like 8 bit shift register
http://www.amctools.com/cgi-bin/yabb2/YaBB.pl?num=1259959989

Message started by justinlove on 12/04/09 at 20:53:09

Title: 74HC595-like 8 bit shift register
Post by justinlove on 12/04/09 at 20:53:09

8-bit shift register.  I was simulating a 74HC595, but I make no guarantees that it is fully emulated.  I wrote it some time ago.

Xsr0 _74HC595 sr_mr sr_ck sr_st VSS sr_d
+ xl0 xl1 xl2 xl3 xl4 xl5 xl6 xl7
+ do0

Xsr1 _74HC595 sr_mr sr_ck sr_st VSS do0
+ xl8 xl9 xl10 xl11 xl12 xl13 xl14 xl15
+ do1

Title: Re: 74HC595-like 8 bit shift register
Post by ThVortex on 12/06/09 at 20:25:32

Hey, not bad. I looked over the code and I had two comments.

First, when you handle the OE pin, it would be better to define Q0 through Q7 as bidirectional pins and then use SET_OUTPUT() to enable or tri-state the output pins. Calling SET_LOGIC(..., UNKNOWN) results in a full strength drive of 2.5V. If you plot these pins while another device tries to output on them, then you'll notice that the voltage no longer swings between 0V and 5V because the two outputs fight each other.

Second, from the datasheet: "If both clocks are connected together, the shift register will always be one clock pulse ahead of the storage register." However, if sh_cp and st_cp change in the same time step, then VMLAB seems to always report the sh_cp change first (I guess because it's a lower pin number?). Therefore, in this component the shift and storage registers would always mirror each other if clocked simultaneously.

The solution to the second problem might be to either swap the order of these two pins (if indeed VMLAB reports the changes in pin order), or to use a boolean flag and delay the shift until the On_remind_me() function.

Title: Re: 74HC595-like 8 bit shift register
Post by justinlove on 12/09/09 at 17:50:38

I had only implemented what I needed.  But things are a bit slow at the moment.

I assume by SET_OUTPUT you meant SET_DRIVE.  This was pretty easy to implement.

I implemented the delayed-shift method, since I didn't want to have to edit the project files for things long done.

Title: Re: 74HC595-like 8 bit shift register
Post by Evgeniy on 05/21/10 at 13:51:23


justinlove wrote on 12/04/09 at 20:53:09:
8-bit shift register.  I was simulating a 74HC595, but I make no guarantees that it is fully emulated.  I wrote it some time ago.

Xsr0 _74HC595 sr_mr sr_ck sr_st VSS sr_d
+ xl0 xl1 xl2 xl3 xl4 xl5 xl6 xl7
+ do0

Xsr1 _74HC595 sr_mr sr_ck sr_st VSS do0
+ xl8 xl9 xl10 xl11 xl12 xl13 xl14 xl15
+ do1


justinlove, could you please explain the parameters of your component? I've downloaded the datasheet of 74hc595, but there are other pin names: SHIFT CLOCK, RESET, LATCH CLOCK, OUTPUT ENABLE, A, Qa - Qh, SQh. I can propose that sr_d is the serial input (A in my d-s) and xl0 - xl7 are Qa-Qh. Also VSS is attatched to OUTPUT ENABLE, I think and do is SQh (serial data output) And what are the other parameters?

Title: Re: 74HC595-like 8 bit shift register
Post by justinlove on 05/21/10 at 15:07:03

I pulled an example from the project which used it.  Using the signal names from the CPP file, (which mostly follows the Phillips datasheet) it would be:

Xsr0 _74HC595 MR SH_CP ST_CP OE DS
+ Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7
+ DO

It looks like the main departure from the datasheet is DO instead of Q7'

Title: Re: 74HC595-like 8 bit shift register
Post by Evgeniy on 05/21/10 at 19:12:33

Oh, thank you. I used another version of datasheet, the ON's one (first in row at alldatasheet.com site). Now I see what parameter is what pin =)

VMLAB users forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.