+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2010
    Posts
    8

    Default Paralel switches with a Rotary encoder

    Hi
    I have the car radio volume turned by a rotary encoder.
    I want to put in parallel two switches with 12F675 for up and down volume, from Satellite control wheel.
    Can you help me with a code to simulate the encoder output?
    Thanks
    Attached Images Attached Images  

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,254

    Default Re: Paralel switches with a Rotary encoder

    I would pull down GP4 and 5.

    Google 2 bit rotary encoder tutorial, they are also called gray code I believe.

    Robert


    Edit: that is a weird rotary encoder, mine had power in. Yours seem to pull down the 2 lines, bizarre.
    Last edited by Demon; - 17th June 2014 at 14:33.

  3. #3

    Default Re: Paralel switches with a Rotary encoder

    @Demon I guess your's has power in so the pullups can be internal?

    George

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,254

    Default Re: Paralel switches with a Rotary encoder

    I used pulldowns on both encoder outputs, I never got into using pullups on PIC inputs.

    Robert

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,190

    Default Re: Paralel switches with a Rotary encoder

    With everything tied together at your "pin to the processor from radio" connection how do you think the direction will be determined? This schematic doesn't look quite right..
    You need to have separate "A' and "B" lines so as to determine the knob direction as well as control it. Quadrature...
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    1,716

    Default Re: Paralel switches with a Rotary encoder

    if you look at the current in the circuit there are 4 possible states
    1. 0
    2. v/r3
    3. v/r4
    4. v/(r3+r4)paralleled
    for the op's idea to work the original re must always come to rest (detent ) where the a b contacts are both o/c .
    the pic must also leave the outputs in a high impedence state (ideally with pullups disabled) or the pic will interfere with the re action.
    a cro image of the re pins at rest, rotating cw and rotating acw would make things easier

Similar Threads

  1. New approach to Rotary Encoder
    By Ioannis in forum Code Examples
    Replies: 90
    Last Post: - 11th July 2013, 21:05
  2. Calculate Distance Using Rotary Encoder
    By guanerrr in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 4th May 2012, 16:40
  3. Decoding rotary switches
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 29th March 2009, 10:26
  4. Automotive quality rotary encoder
    By d1camero in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th October 2004, 15:46

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts