Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Chris,

    For the examples, I simply used the timers overflow to TOGGLE a pin, so the duty cycle is always 50%. But then, it's just an example. If you increase the frequency of the timer Overflows, either by reducing the prescaler, or by re-loading the timer on each interrupt, or both, you can control the duty cycle within the interrupt handler. By incrementing a variable you can have it turn on for 10 interrupts and off for 246, or whatever resolution you want.
    <br>
    DT

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    Thanks for the clarifications.

    I'm not very familiar with bank switching, so at this time I didn't feel comfortable with dealing with that. You mention "CHK?RP" as an easy way to deal with the issue. I have no idea how to use this. I assume this is a macro that comes from somewhere. Could you please elaborate?
    Charles Linquist

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default

    CHK?RP is a PBP macro wich send you to the correct bank of a x register

    CHK?RP PORTA

    not much, using this one avoid you to read the x PIC datasheet to see where the x register is placed and do the bank switching yourself. Really handy stuff!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Nice work Darrel.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Bruce,

    Thank You, Thank You, Thank You!

    But I gotta ask.

    Have you tried it yet?
    Or does it just Look Cool?

    Apprehensively,
    &nbsp; Darrel

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,

    I've tested it on a Lab-X1 with 18F452. Timers 0, 1 and 3 hi-pri. USART rx
    low-pri, and it works as advertised...;o}

    P.S. I thought this was pretty slick;
    movff FSR#v(F)L, fsave#v(F)Pr
    movff FSR#v(F)H, fsave#v(F)Pr + 1
    Last edited by Bruce; - 13th July 2006 at 18:30.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Excellent!

    Thanks for that.

    And, yeah. The "Text Substitution" comes in pretty handy.
    A bit Cryptic looking, but it is "Slick". Finding more uses for it with each new program.
    <br>
    DT

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

Members who have read this thread : 5

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

Tags for this Thread

Posting Permissions

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