This article describes how to use logic gates or presets to generate a ring counter functionality through the use of Logic gates and/or presets. A “ring counter” is also known as a circular shift register, and permits the use of a single input trigger to “circulate” through multiple actions. This is typically used to provide access to multiple functions from a single button. A common example would be to scroll through background sources using a single momentary-action push button or switch.
Ring counter using presets
- Create a configuration as in the image below.
- Create four presets: one for each source selected.
- Each preset will contain the Source Selector block, set to select the required source; and the Preset Button block, having the next desired preset assigned.
- Every time the Logic Input is actuated (by an external push button or switch, for example) a Preset will be triggered, selecting the next source and changing the assignment of the Preset Button so is ready to recall the next Preset at the next push of the external switch.
Ring counter using logic gates
- Add two Flip Flop, two NOT gate, and four AND gate as per the layout below.
- Connect the logic output of the AND gates to the desired logic input of the Source Selector.
- Connect the logic Output to the desired LED drive.