Electronic – transition speed causing issue with jk flip flop

digital-logicflipfloplogic-gatesmicrocontroller

i'm using jk flip flop to latch on a state given by 2 switches to either stay ON or stay OFF, knowing that one of them could stuck on ON which is why i use one of them as the clock input for the 4027B which works fine on simulation but not in the real pcb

enter image description here

i've read that the transition time on this flipflop could cause a problem but i'm new to this so i was asking for help to why this won't work (all the circuit is revised and voltage is correct on all terminals of the 4027 but the output which sometimes output around 2 volts and other time doesn't)

link to a similar problem caused by the transition time Slow clock edge causing issues with D flip flop behavior

also i've achieved the same design using the 4013B which is a D flipflop, would the new one work? is there an easier alternative other than using a microcontroller ?

Best Answer

I don't understand what you're trying to accomplish (try using shorter sentences), but one glaring problem in your design is the fact that you have the J and clock inputs of your FF tied together. This means that the J input will be changing at the same time as the clock edge, which almost certainly violates the setup and/or hold time requirements of the FF. Why don't you just tie the J input high?