wiring J-k onto pins, power switching chip

See attached for my test schematic.

Its a standard dual j-k toggle setup based on the data sheet. I only needed one j-k for my design so rather then leave half a chip un-used I'm trying to add optional functionality.

Button S2 set up for your basic rising edge trigger on release, Q1(S-SELECT) goes to feed backed op-amp as an LED indicator and a enable pin on a switch/multiplexer chip. The voltage divider (A1/A2) is obviously to get the 5V to an acceptable level for a 3.3V tolerant input.

On the second j-k, front half is also set up for rising edge trigger, but a optional bridge to pin D4. The 1K resistor is to prevent the possibility of having a dead short to ground should D4 be HIGH(5V) while pushing the button which goes to ground.

If D4 is LOW(0V), this creates a divider of 0.45V (from the 5V) on the clock pin, which still considered logic LOW so no issue there. If D4 is HIGH(5V) then you have double pull ups and the 1K will be the current limiter. (arduino pin is the limiter in all likely hood)

I think this design works, but its always nice to have second eyes before building.

Advanced Question: see attached for design, you will need to read the data sheet to have any chance of answering

This is probably unanswerable here but I might as well ask. I'm looking into alternate power switching chips options to replace the current comparator/fet for USB and external power. The TPS2111 is the simplest one I have found so far and I think the logic works based on its truth table.

The data sheet states that your suppose to have a minimum amount of voltage present on both inputs depending on what's on the other pins for proper switching. Do you think this is just a soft rule and it will probably work, or is this min voltage a requirement to properly run some mosfet logic/comparators?

Because its such a small smt chip I don't have the option of just wiring it up and testing it out.

You can not use mechanical switches on the clock input without some debounce circuits.
A switch can bounce 2-100 times for every push and reelese leaving JK in either state.

A simple RC filter (100-330 kohms and 0.1 uF) can fix it BUT do not use a circuit from Thoshiba, NXP works! Texas?

Why not use a small uC and do all debounce in software? A small 6 or 8 pin.

Pelle

Hi, I don't understand what you are trying to achieve, you have all the J and K inputs tied to 5V and gnd.
The clk input clocks the changes to the J K inputs, if they are constant, what do you want the outputs to do?

Have you tried it out on a protoboard to see what happens?

Tom....... :slight_smile:

Pelleplutt:
Why not use a small µC and do all debounce in software? A small 6 or 8 pin.

That's what I thought, but then it appears "harddrive123" is using this as an attachment to an Arduino system, so this begs the question as to why add unnecessary complexity when the function could be better performed (with debouncing because this circuit would never work without) by the MCU already present?

TomGeorge:
Hi, I don't understand what you are trying to achieve, you have all the J and K inputs tied to 5V and gnd.
The clk input clocks the changes to the J K inputs, if they are constant, what do you want the outputs to do?

Toggle. You didn't look at the datasheet! The "K" inputs are inverted; if you connect them together you have a "D" flip flop. Connecting J high and K low permits toggling.

I'm using hardware button/toggle because it's controlling a multiplexer for USB lines into the chip. There will be up to 2 USB connections on my board and hardware switching is the only reasonable method. This is not an attachment design but a board modification where it's milled and soldered together.

If I didn't do this I would need to permanently tie up 1-3 pins and have code to run it in every sketch. Vs just pushing a button with an option on specific projects to pin control.

I think did about a debounce but it's rarely been a issue on other projects and trying to reduce parts, I'll add it in though.

See attached for modified design, including all relevant connections just to make it clear whats being attempted.

Leaving the second j-k open for optional connections later off board.
Added a cap for basic debounce circuit with a solder jumper for control with a I/O pin if wanted.

Don't worry about the S_SELECT going to that half deleted chip (in picture) its just to represent that the j-k Q is controlling a enable pin, and a led on a op-amp.

I'm fairly sure this will work as intended, I can't think of any reason why it wouldn't.

harddrive123:
Added a cap for basic debounce circuit with a solder jumper for control with a I/O pin if wanted.
...
I'm fairly sure this will work as intended, I can't think of any reason why it wouldn't.

OK, so you are going to clock a flip flop with a really slowly rising and somewhat unsteady voltage for "debounce".

Lotsa luck!

I'm fairly sure this will NOT work as intended, I can think of TWO reason why it wouldn't.

The debounce are 10 times (at least) to fast.
The debounce makes the risetime of the clocksignal slow . This do not work with all manufactors.

Well, I'm here in Sweden and can't do anything to your decission.

Pelle

Ya didn't think about the rise time requirement for the j-k.

It recommends 500ns, which means the cap needs to be ~30-50pF., because I would like to keep my 10K unchanged. I'm not adding a schmitt trigger, that would be a waste of space/money.

I think this focus over debounce is a little over exaggerated, its really a matter of application.
If it was a mechanical relay that triggered ever 2 sec on an assembly line and had to be correct 100% of the time then ya, you better get that right.

If you plan to push it only once every 1-24h to switch the incoming USB lines and it 1 in 20 times doesn't flip, your not going to be hard pressed to have to press it once more.

Is there anything aside from the debounce issue that you would notice to be logically wired wrong?

I think it does not flip 10 times of 20 and next press on the button are 50-50%, and next...............

Good luck. You asked for a second opinion but ...........

Pelle

But........ I asked for a second option about the entire logic.

You addressed the debounce issue, I made it clear that I was trying to solve it, that I wasn't overly worried.

You keep bringing it up like its the end of the world, OMG!!! it didn't flip.

From the very first post:

Because its such a small smt chip I don't have the option of just wiring it up and testing it out.

You "asked for help" instead of testing yourself.
I answered with my experence (about 35 years of professional hardware constructing) (I have several constructions with pushbuttons AND 74HC109).

You must just wiring it up and testing it out.

Pelle

I'll figure out the debounce issue, let it go....

Every thing else is done correctly apparently, it's always nice to get the feedback even if it's by reverse analysis.