AMcTools Forum 
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
74HC595-like 8 bit shift register (Read 12023 times)
justinlove
YaBB Newbies
*
Offline

I love YaBB 1G -
SP1!

Posts: 12

74HC595-like 8 bit shift register
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
Back to top
 
  IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: 74HC595-like 8 bit shift register
Reply #1 - 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.
Back to top
 
 
WWW   IP Logged
justinlove
YaBB Newbies
*
Offline

I love YaBB 1G -
SP1!

Posts: 12

Re: 74HC595-like 8 bit shift register
Reply #2 - 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.
Back to top
 
  IP Logged
Evgeniy
YaBB Newbies
*
Offline

AVR & Dance

Posts: 4
Moscow, Russia
Gender: male
Re: 74HC595-like 8 bit shift register
Reply #3 - 05/21/10 at 13:51:23
 
[quote author=5F4046415C5B595A4350350 link=1259959989/0#0 date=1259959989]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
[/quote]

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?
Back to top
 
 
440234235   IP Logged
justinlove
YaBB Newbies
*
Offline

I love YaBB 1G -
SP1!

Posts: 12

Re: 74HC595-like 8 bit shift register
Reply #4 - 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'
Back to top
 
 
  IP Logged
Evgeniy
YaBB Newbies
*
Offline

AVR & Dance

Posts: 4
Moscow, Russia
Gender: male
Re: 74HC595-like 8 bit shift register
Reply #5 - 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 =)
Back to top
 
 
440234235   IP Logged
Pages: 1
Send Topic Print