A partiular four bit counter

Discussion in 'The Projects Forum' started by bading, Apr 27, 2012.

  1. bading

    Thread Starter New Member

    Jan 18, 2012
    10
    0
    I have to create a circuit to control four relays in a cyclic manner, ie each time they change or the status of each pulse on the output you must turn on and off the previous one. The input signal is 0/5Vdc and comes from a PIC. The relays have a coil at 5 volts DC. When I turn on the circuit must be admitted in one of four configurations (for example, state 1).
    I was thought of using a 4-bit counter, giving the input of the appropriate sequences of pulses that can be created by software so that the output ports only in the following states:
    0001 to 1 - state 1
    0010-2 - 2 was
    0100-4 - State 3
    1000-8 - 4 was
    But, for example, to go from state 3 to state 4 I have to go through the configuration of the unintended output relay excited as I am, I do not think this solution is elegant, and I think the flip flop by connecting the problem could be solved , but I honestly do not know how!:confused:
    thanks
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,715
    4,788
    Look into rotate left/right commands or, if not supported (I think at least one is), look at the shift left/right commands.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,418
    3,355
    You can do this with a 4017 or 4022 counter chip.
     
Loading...