Question about using ASM interupt with PBP


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Talking Wow!

    So much learned here!

    Now I get what PRx is for. Sort of feel a little Doh over that. I prolly would have gone years without seeing it. And its so much more intuitive. (number of cycles - 1) THANK YOU!

    I love the toggle replacement

    Not only did you answer my original question, but you also did the work for me. To be sure, I will not be going crazy in the ISR, in fact the only thing it needs to do is PORTC = PORTA. the rest is for debugging and will not be in the final program. I may keep a counter in there for something.
    Is it safe to assume DT_INT cost about 20 cycles when not used with PBP handler? This is just good to know.

    I must admit, I'm not sure I get the rules for using LATx, but easy enough to just not use it at all. I suppose you are saying LATx=something is fine, but not much else.

    I think I am most excited about the PRx knowledge.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    Is it safe to assume DT_INT cost about 20 cycles when not used with PBP handler? This is just good to know.
    With the 16F1's that's about what it takes to get IN and OUT of DT_INTS.
    I didn't count it to the exact number of cycles. It can change depending on the setup.

    I must admit, I'm not sure I get the rules for using LATx, ...
    Throughout the manual you'll find this statement frequently ... "Pin is automatically made an input" or output.
    So those commands will try to set the TRIS bit each time it executes.

    When you give it a PORTx.x pin, PBP finds the TRISx.x bit by adding $80 to the ports address.
    Here's the .LST from a LOW PORTA.0
    Code:
                          00194 ; C:\ISIS\5US_INTS\ASMCNCGUY5US.PBP     00076   Z0001D  LOW PORTA.0
    001F                  00195 Z0001D
                          00196         LOW?T   _PORTA??0
    001F   100C               M         bcf     PORTA,  000h
    0020   0021               M         movlb   (((PORTA) + 80h)) >> 7
      00000001                M PREV_BANK = (((PORTA) + 80h)) >> 7
    0021   100C               M         bcf     ((PORTA) + 80h), 000h
    But if you give it LATA.0, adding $80 makes it point to ANSELA instead of TRISA.
    The TRIS bit doesn't get set, and the ANSELA gets changed.



    I think I am most excited about the PRx knowledge.
    And now you know why not to use LATx.x as a pin.

    Knowledge is Power, and Power is intoxicating ...
    Please drink responsibly.
    DT

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Awesome stuff Darrel. THANK YOU!!

    BTW, I find it quite inpossible not to Think and drive, so I best check my BAC before going out
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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