Disable/Enable DT interrupt


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default Disable/Enable DT interrupt

    Hi all, I need help in understanding how I can disabile temporarely the DT interrupt on the serial receive (RX_INT) and Enable it as soon as the special event is ended.

    Anybody has faced such a need before?

    Cheers

    Al.
    All progress began with an idea

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,383


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    You can use the macro's
    @ INT_ENABLE RX_INT
    @ INT_DISABLE RX_INT


    or

    set / clear the pie1.rcif bit yourself (usually pie1.5) but check your data sheet

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    Thank you Richard for the prompt answer. Just what I was looking for!

    Cheers

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Jun 2015
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    From a newbie - Where can I download virgin copies of the latest DT-Ints-18 AND ReEnterPBP-18? I've searched everywhere, can't find ReEnterPBP-18 at all. Using PBP3, PIC18F67K90 in a smart battery. Thanks...

  5. #5
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    You can tray at this link:

    http://www.picbasic.co.uk/forum/showthread.php?t=19638

    Cheers

    Al.
    All progress began with an idea

  6. #6
    Join Date
    Jun 2015
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    Thanks - that's just what I was looking for. Now the fun part...! Wish Darrel was still around. I'm trying to create I2C control commands in PBP3 for an interrupt handler (similar to CCS's C-code I2C_ISR_STATE, I2C_READ, I2C_WRITE).

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    Matthews I never used the Darrel I2C interrupt so I cannot help you. I did something with I2C few years ago, and I posted a working snippet in this thread http://www.picbasic.co.uk/forum/showthread.php?t=10141. In the thread you will find also some code using DT I2C interrupt that could help you to start with your new project.

    Longing to see your working code posted!

    Cheers

    Al.
    All progress began with an idea

  8. #8
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    You can use the macro's
    @ INT_ENABLE TMR1_INT
    @ INT_DISABLE TMR1_INT
    I have a chunk of time critical bit banging code for driving WS2811 LEDs so I cant allow it to be interupted.

    If I do the following.....
    Code:
    @ INT_DISABLE    TMR1_INT
    {whole chunk of time critical code}
    @ INT_ENABLE    TMR1_INT
    Would TMR1 be able to flag an interrupt that would then be picked up when I re-enabled the DT Interrupt or would I miss that event completely ?

    Thanks in advance.

    Keith
    Keith

    www.diyha.co.uk
    www.kat5.tv

  9. #9
    Join Date
    Aug 2011
    Posts
    408


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    In general yes, but that depends on the version of DT-INTS you're using. Some of the ones I've seen clear the IF bit in INT_ENABLE, others don't.

    Might be easier to just set/clear the TMR1IE bit yourself (It's normally bit 0 of PIE1). If the TMR1IF bit is set when you set TMR1IE it'll generate an interrupt.

  10. #10
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    Keith, I did the exact same thing when I wrote code some years ago for the WS2811 LEDs. That is the reason I switched to using the APA102C led's as they are SPI based and there is no need to disable the interrupts. In fact I just finished a table lamp for my daughter using 204, APA102C's and 29, 5.25 inch hard disk platters.
    Attached Images Attached Images  
    Dave Purola,
    N8NTA
    EN82fn

  11. #11
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default Re: Disable/Enable DT interrupt

    Thanks Tumbleweed, will do some experimenting when I get home.

    Love the lamp Dave. Looks really cool.

    I am using WS2801, WS2811, APA102 and some PL9823 LEDs in a project. Will post pictures once its complete.
    Keith

    www.diyha.co.uk
    www.kat5.tv

Similar Threads

  1. Disable/Enable in Interrupts
    By Ioannis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th June 2015, 08:47
  2. 4x40 LCD Display Enable Pin
    By rsocor01 in forum General
    Replies: 2
    Last Post: - 10th August 2011, 03:50
  3. PIC 16F616 Interrupt Enable/Disable?
    By Tobias in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 17th May 2009, 09:17
  4. Enable and Disable in Interrupts
    By stevecrunch in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th October 2007, 02:10
  5. ENABLE command not always mandatory?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd October 2006, 19:11

Members who have read this thread : 2

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