Electronic – 9-Bit State Machine

clockflipfloppcbstate-machines

I am working on a state machine that will drive a state bus for a personal project. The state machine will have an output pattern like the following:

100000000
010000000
001000000
000100000
000010000
000001000
000000100
000000010
000000001
100000000

As you can see, the active bit shifts and wraps back around. I've put together the circuitry to do this; however, the results are really hit and miss. I accomplished the above with two octal flip flops, two line drivers, and a clock to change the active bit. The flip flops have the output of the line drivers going back into their input, shifted by one bit. The last bit goes back around and feeds the first bit.

My circuit only works about 1/4 of the time… the majority of the time, several bits will be high at once OR it will wrap around once and eventually the high bit will 'fade' away.

PCB circuit
Schematic

I am seeking any recommendations and/or changes that I can do to make this work. I understand that the circuit isn't very elegant.. I have just been trying what I know.

Some notes:

  • The PCB layout above is meant to go on one layer – the different colors are only to help me. Furthermore, there are a few jumpers in between wires… they are always directly across from one another.

  • The schematic does not include the line drivers, only the flip-flops

Best Answer

If your goal is to have one output at a time go high, you don't need a 9-bit state machine. You should probably either use a 4017 which has 10 outputs that are hit in sequence, and wire it so that it resets when the tenth output goes active, or else use a 4-bit state machine which will progress through nine states, along with a device that will output one of nine wires based upon the state of the 4-bit machine.

Alternatively, you could construct your machine so that a "1" will be shifted into an 8-bit latch only when all the other bits are zero. This could be accomplished using a 74HC688 and an inverter, or if you didn't mind having all but one of your wires be "1" (as opposed to all but one being "0") you could feed the output of your 8-bit latch into an 8-bit NAND gate.