Instant Interrupts for rotary encoder


Results 1 to 8 of 8

Threaded View

  1. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts for rotary encoder

    OPTION_REG.6=0 ;Int on falling edge. Is it possible?
    no this option is for INT/int

    having
    INT_Handler RAC_INT, _ENCODERA, PBP, yes
    INT_Handler RAC_INT, _ENCODERB, PBP, yes
    won't really work as there is only one rac_int ,you only need one isr for it

    your isr needs to
    1 determine state of enca and encb
    2 compare this state to the previous (old_state)
    3 determine if the move is forward ,backwards or invalid (bounce) and inc or dec the counter as req
    4 save the current state to "old_state"
    5 clear the rac interrupt flag (the auto flag clear does not always work for rac int)

    having pauses and lcd outputs in isr will lead to tears , make isr's as short as possible is best practice


    after thought
    add capacitors to ground across the enca/b pins (try 0.1 uf) to minimise contact bounce
    Last edited by richard; - 10th August 2014 at 14:50. Reason: after thought

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. Rotary encoder help (not 'counting steps)
    By Elnino in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th October 2009, 22:03
  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 : 1

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