In theory this should be simple - build a divide by two circuit with a JK flip flop using a push switch for its clock... but it's not working out that way. is is my circuit, as breadboarded/prototyped...
**broken link removed**
When I turn the circuit on, I expect to find the LED either on or off, and for a button press to toggle it (though I realise that the switch needs debouncing too). What I actually get is the LED flickering a half brightness. When I hit the switch it either goes off or gets brighter (a seemingly random decision as to which).
To make sure it wasn't something to do with the switch itself, I removed the lead from the bace of the transistor to the IC and the LED went out. I also connected the base of the transistor to both Q and !Q outputs on the IC, and the same thing happens on each - flickering at half brightness and random brightening or going off on pressing the switch.
I then reduced the value of the collector resistor to 1k, and placed a 1k resistor between the base of the transistor and pin 15. This stopped the LED flickering, but the circuit still did not toggle the output of Q and !Q (pins 14 and 15).
On removing the 1k resistor from the collector while the circuit was live, I noticed that the LED remained on at the same half brightness, and so I removed the transistor and LED, replacing them with a voltmeter...
**broken link removed**
While the switch is open, pin 15 (Q) supplies between 2.2v and 2.4v at the voltmeter, and pin 14 (!Q) supplies between 2.6v and 2.8v
While the switch is closed, pin 15 (Q) supplies 0v at the voltmeter, and pin 14 (!Q) supplies 5v
Both Q and !Q are supplying roughly the same voltage. While the switch is closed, Q is always low, and !Q is always high. While the switch is open, both Q and !Q supply 2.2 - 2.4v and 2.6 -2.8v respectively.
I've even tried replacing the IC, but that also has the same behaviour.
Any help would be greatly appreciated, because I'm more than a little confused by this.
... leaving me with no idea what's going on. I've even tried a replacement IC.