PDA

View Full Version : Disable/Enable DT interrupt



aratti
- 10th June 2015, 12:10
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.

richard
- 10th June 2015, 13:08
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

aratti
- 10th June 2015, 16:34
Thank you Richard for the prompt answer. Just what I was looking for!

Cheers

Al.

HKMathews
- 11th June 2015, 21:34
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...

aratti
- 12th June 2015, 07:25
You can tray at this link:

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

Cheers

Al.

HKMathews
- 12th June 2015, 19:43
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).

aratti
- 13th June 2015, 16:35
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.

keithdoxey
- 15th June 2018, 19:41
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.....


@ 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

tumbleweed
- 16th June 2018, 11:49
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.

Dave
- 16th June 2018, 16:41
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.

keithdoxey
- 16th June 2018, 16:50
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.