Rotary encoder with DT interrupts


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,175


    Did you find this post helpful? Yes | No

    Default Re: Rotary encoder with DT interrupts

    Mike, why your suggestion is not the same?

    Ioannis

  2. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Rotary encoder with DT interrupts

    Louis stated there was a STACK Underflow flag set in the PCON Register. I looked over his/her posted code and the only place I could find where a CALL/RETURN mis-match could occur was in the posted line of code. By specifying a "GOTO" there, the Stack would not be modified with a RETURN PC Address. I suggested a test to eliminate the possibility of the STACK Underflow condition being caused by that line of code.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,175


    Did you find this post helpful? Yes | No

    Default Re: Rotary encoder with DT interrupts

    The
    Code:
    then DoneRotEnc
    is exactly the same as
    Code:
    then goto DoneRotEnc
    or
    Code:
    @ goto DoneRotEnc
    Or not?

    Ioannis

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,720


    Did you find this post helpful? Yes | No

    Default Re: Rotary encoder with DT interrupts

    not to mention that mine ,same code same chip does not reboot
    Warning I'm not a teacher

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,175


    Did you find this post helpful? Yes | No

    Default Re: Rotary encoder with DT interrupts

    Then maybe a bad supply voltage, bad decoupling capacitors, bad breadboard connections...

    Ioannis

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,720


    Did you find this post helpful? Yes | No

    Default Re: Rotary encoder with DT interrupts

    would seem that way , although his dt_ints may be altered.
    only changes i made

    latc.6 = 1 ' reversed polarity tty
    serout2 PORTC.6,84,[13,10,"I'm Alive",13,10,10]





    although code has a few weird things they don't cause the problems, if i use a nice clean optical re the code fails to count up or down as per reply 9
    a filtered mechanical re also miscounts , no filter gives a semblance of functionality. i will keep to my code



    OPTION_REG.6 = 0 ' INTEDG set to interrupt on falling edge. ?
    ' OPTION_REG.6 = 1 ' INTEDG set to interrupt on rising edge.

    IOCBN = %01110000 ; REa portb.6, REb portb.5, REsw portb.4 neg edge trigger - falling edge only.
    why set the sw to cause an interrupt
    Last edited by richard; - 12th February 2021 at 08:33.
    Warning I'm not a teacher

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,175


    Did you find this post helpful? Yes | No

    Default Re: Rotary encoder with DT interrupts

    More responsive I suppose?

Similar Threads

  1. Rotary encoder subroutine
    By Fanias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th October 2018, 14:13
  2. Using an incremental rotary encoder?
    By keithv in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2016, 23:23
  3. Instant Interrupts for rotary encoder
    By fnovau in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th August 2014, 09:24
  4. New approach to Rotary Encoder
    By Ioannis in forum Code Examples
    Replies: 90
    Last Post: - 11th July 2013, 22:05

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