Help Replacing BA634 flip flop with CD4013 - BOSS DD2/DD3

Started by ilcaccillo, January 15, 2017, 06:28:30 PM

Previous topic - Next topic

ilcaccillo

Hello
I have a non working Boss DD2. I was able to trace the problem back to the BA634 flip flop.
Troubleshooting was done using the help in this thread:
http://www.diystompboxes.com/smfforum/index.php?topic=91521.0

I would like to replace the old BA634 Single Flip Flop (is no longer manufactured) with a CD4013 Dual Flip Flop (cheap and easily available).

Never worked with flip flops before and Im not really sure how they work.
Could you please help me out on how to connect the CD4013 in place of the BA634 in this circuit?

here is the schematic part with the switching and the flip flops pinouts:


Cozybuilder

Some people drink from the fountain of knowledge, others just gargle.

ilcaccillo

Hi,
thanks for your reply.

I've read that thread and all the other BA634 threads in this forum before I posted, unfortunately they don't help me in this particular implementation or my knowledge is limited to understand how it works.

I need some help in what is the correspondent pins for both IC's when replacing in this circuit.

the BA634 says In,Out, Vcc (actually ground on the DD2) , Gnd (actually 9V on the DD2) and Reset
The 4013 has the pins named Q1, Clock, Reset, Data, Set ...


Cozybuilder

You need to read up on flip flops- in this case the Boss is using a T-flip flop, while the CD4013 is a D-flip flop. This article should give some ideas on how to proceed:

https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Seq/flip.html

Or maybe Paul will chime in
Some people drink from the fountain of knowledge, others just gargle.

PRR

> CD4013 Dual Flip Flop

That is a D, or Set-Reset, flipflop.

You want a T, Toggle, flipflop but with a Reset over-ride.

https://en.wikipedia.org/wiki/Flip-flop_(electronics)

The reset is not "essential" if you don't mind it coming-up off/on randomly at power-up. (Powerup, try, tap if needed.)

I'll have to dig in the old books to see what we used to do. Anybody else have a CD40xx T-flop reference handy?
  • SUPPORTER

PRR

Something happens to your memory. I forget what.

A T-flop is a D or SR flop with the outputs cross-wired to the inputs.

The BA634 can be found on eBay. I do not know if they are good.

The BA634 is more than a 'flop. Straight CMOS may not reliably "flip" with a mechanical switch. Switch-bounce may cause it to "see" 1, 2, or 44 transitions per mechanical tap. We really want at least a Schmitt input. Also the cross-wired SR 'flop has tied-up the Reset input, so we need another gate to work-in the reset from Q12.

It seems like utter over-kill, but CD4020 is interesting. You get 13 stages you do not need. But it does have Schmitt input, and a dedicated Reset. CD4020 Q1 is your alternate-action output. CD4020 Q2-Q14, just ignore. However *think* the Reset pulse must be inverted. One more transistor between (DD2) Q13 and Q12 can do that.
http://www.intersil.com/content/dam/Intersil/documents/cd40/cd4020bms-24bms-40bms.pdf

Mouser has thousands in stock, some with honest legs, for a half-buck. So the 13 extra stages are not budget-busting.
  • SUPPORTER

ilcaccillo

Quote from: PRR on January 15, 2017, 10:16:28 PM
I'll have to dig in the old books to see what we used to do. Anybody else have a CD40xx T-flop reference handy?

Hello PRR,
Nice to see you around here also.

I don't know if this is the reference you asked, but here it goes:

http://www.cedmagic.com/tech-info/data/cd4013.pdf

ilcaccillo

#7
Quote from: PRR on January 15, 2017, 11:10:51 PM
Something happens to your memory. I forget what.

A T-flop is a D or SR flop with the outputs cross-wired to the inputs.

The BA634 can be found on eBay. I do not know if they are good.

The BA634 is more than a 'flop. Straight CMOS may not reliably "flip" with a mechanical switch. Switch-bounce may cause it to "see" 1, 2, or 44 transitions per mechanical tap. We really want at least a Schmitt input. Also the cross-wired SR 'flop has tied-up the Reset input, so we need another gate to work-in the reset from Q12.

It seems like utter over-kill, but CD4020 is interesting. You get 13 stages you do not need. But it does have Schmitt input, and a dedicated Reset. CD4020 Q1 is your alternate-action output. CD4020 Q2-Q14, just ignore. However *think* the Reset pulse must be inverted. One more transistor between (DD2) Q13 and Q12 can do that.
http://www.intersil.com/content/dam/Intersil/documents/cd40/cd4020bms-24bms-40bms.pdf

Mouser has thousands in stock, some with honest legs, for a half-buck. So the 13 extra stages are not budget-busting.

Thanks for explaining that PRR, unfortunately I don't have enough know how to understand all what you've explained.
I will read the article Cozybuilder suggested to learn more on flip flops and them maybe I will understand it better.

C4013 are 50 cents, and I actually have some spare ones so I could change that and probably repair the pedal tomorrow, the BA634 is around 5euros plus shipping and I have to wait. Those were the initial decisions in changing. More the timing issue than the money as 5 euros is not a lot for an obsolete IC.

Anyway I though the change from BA634 to C4013 would be something easy, just a matter of different pinouts.
I see now that it's not that simple, that combined with the need of mouting the C4013 off board as it would not fit the DD2 board made me rethink the change and I will just get a BA634 off ebay and not complicate the repair.

Thank you





anotherjim

#8
I think you can hope the RC off the switch debounces well enough for 4013 as it did for the BA634.
Tie Data to /Q and tie Set high. *Error! Set is Low!
In is Clock
Out is Q
Reset is Reset. *Error! Reset needs inverting!
Unused F-F, tie all 4 inputs low.

Q12 is power-on reset and Reset appears to be active high for both devices, which is lucky. So the 4013 should power up with the Q output low every time.

*I correct errors (I hope) in later post!

ilcaccillo

Hi Anotherjim thank you, I will wire a 4013 as you've suggested and try it out.
This info will be useful also in the future, because with the supply of BA634 being over people will really need to replace that in different circuits.

What do you mean by "tie set high"?
It means I should connect 9v there?
Al also what means "tie all 4 inputs low"?


This is what I was able to understand:

In pin1 to clock
Out Pin2 to Q
Vcc (ground on DD2) pin3 to ???
GND (9V on DD2) Pin4 to Set ?
Reset pin5 to Reset

Data linked to /Q
F unused

Thank you


duck_arse

some digital speak:

tie = connect to
high = supply, V+, 1
low = ground, 0, 0V
inputs = R, S, D, clock, CLK, reset, data, set
outputs = Q, bar Q, Q bar, Q with a line over the top

whenever Q is high, barQ will be low, the bar indicates 'inverted'. it sometimes appears over 'reset', as well.
" I will say no more "

anotherjim

54 68 61 74 20 69 73 20 63 6f 72 72 65 63 74 20 61 73 20 44 75 63 6b 73 20 68 61 73 20 69 74 2e 20 49 74 27 73 20 61 6c 77 61 79 73 20 61 20 67 6f 6f 64 20 69 64 65 61 20 74 6f 20 74 61 6c 6b 20 64 69 67 69 74 61 6c 20 2d 20 20 65 78 63 65 70 74 20 69 74 20 64 6f 6e 27 74 20 77 6f 72 6b 20 6f 6e 20 74 68 65 20 6d 69 73 73 75 73 2e 0d 0a
:)

ilcaccillo

Quote from: duck_arse on January 16, 2017, 09:11:33 AM

high = supply, V+
low = ground, 0v
inputs = clock, reset, data, set
outputs = Q, Q bar
whenever Q is high, barQ will be low, the bar indicates 'inverted'. it sometimes appears over 'reset', as well.

Thank you duck_arse

If Clock, Reset, Data and Set are the inputs.
And if Connect "Clock" to input , and "Set" to 9V, like anotherjim suggested.
What are the 4 inputs I should connect to Low?

"tie all 4 inputs low"

Also on the BA634 the GND pin is connected to 9V and the Vcc pin is connectd to 0V (ground)
Do I need to do the same on the 4013? Connect 9v to Vss instead of ground, and gnd to Vdd instead o positive voltage?

thank you

Les Turnbull

In a recent job lot i got a Logic Probe , Would these be used to set / check pin high or low .

ilcaccillo

Here are some drawings I did so I could show my doubts,
anotherjim is this what you suggested?

Thank you




Cozybuilder

#15
I think you have pins 3 and 4 reversed on your BA634 drawing. The schematic snippet shows 3 is ground and 4 is +9V.
Some people drink from the fountain of knowledge, others just gargle.

slacker

You've got the power for the CD4013 reversed, VDD is 9 volts VSS is ground, set should go to 9volts. Connect pins 8, 9, 10 and 11 to ground to disable the unused flip flop.

anotherjim

!First: me make mistake earlier. SET needs to be tied Low. Also, Reset needs inverting!

See the frequency divider on this page...
http://reviseomatic.org/help/e-flip-flop/4013%20D-Type%20Flip%20Flop.php
Which is this...


It needs to have an output that alternates between on (High) & off (Low) for each press of the bypass button. It also needs the output to be off when the pedal is powered on.

Dtype flip-flop only has 2 outputs, these are called Q and /Q (say "Q" and "Not Q"). Whatever state Q is, high or low, then /Q is the opposite state.
Each flip-flop has 4 inputs.
Set: If High, then Q is forced High. /Q will be Low.
Reset: If High, then Q is Forced Low. /Q will be High.
Data: What this does depends on Clock input.
Clock: When this changes from Low to High, The State on the Data input is copied to the Q output and /Q to opposite state. When Clock changes from High to Low, nothing happens. It only responds to a "positive edge trigger".

By tying the /Q to Data, everytime the Clock input pulses High from a button press, then Q will change to opposite state and stay that way until either there is another button press, or the reset goes High to force Q Low.

You don't need the Set input, so that is tied Low.

Q12 is an inverter and makes the High reset pulse from Q13 go Low during reset. We need it to go High during reset. Simple, take the 4013 Reset input from Q13 collector instead of Q12 collector.

All unused inputs in a CMOS device should be tied either Low or High or they can cause erratic behaviour. Pin 8 through 11 are unused, so tie them to 0volt.

BA634 is probably made with P-channel transistors. Convention for that was to name the power pins as if for Positive ground power supplies. Most circuits are negative ground, so the power connections appear to be reversed. We also have BBD delay chips that need the same treatment. Like so...


ilcaccillo

Quote from: Cozybuilder on January 16, 2017, 01:24:00 PM
I think you have pins 3 and 4 reversed on your BA634 drawing. The schematic snippet shows 3 is ground and 4 is +9V.

The BA634 drawing is from the datasheet:
http://shop.strato.com/WebRoot/StoreES2/Shops/62070367/MediaGallery/Datasheets/BA634.pdf

In the BA634 datasheet there's also some circuit schematics that show pin4 connected to ground.

Although the way it was used on the DD2 has Pin3 connected to ground and Pin4 connected to 9V

PRR

> Pin3 connected to ground and Pin4 connected to 9V

This is correct.

Don't go by "Vcc". This chip was apparently sold to positive-ground systems. Go by the schematic on page 2 of the sheet. Note transistor and diode polarity. It only makes sense if pin 4 is more-positive and pin 3 is more-negative. Which is "ground" is up to the user.
  • SUPPORTER