Pumpkin, Inc.

Pumpkin User Forums

OSDelay, interrupt disable

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

OSDelay, interrupt disable

Postby Benoit Braud » Wed Sep 11, 2002 5:31 am

Hi,

In my application (PIC18C452), i have external interrupt at 5kHz. Sometime i lose some interrupt. It appends when one of my task call OSDelay (from OS_DELAY) : at the beginning of OSDelay, interrupts are disable and at the end of OSDelay interurpts are enable. But sometime OSDelay call a function named 'OSInsPrioQ' : this function spend lot of time (more than 800 instruction cycles). So, with a clock of 16MHz, the ODDelay duration can be 220 us (850 to 900 instruction cycles). During this time the interrupt are disable, so l lose some interrupt.
I would like to known if i am wrong.
How many instruction cycles the interrupt may ne disable by Salvo function ?

Thanks.

------------------
Benoit B.

Benoit B.
Benoit Braud
 
Posts: 10
Joined: Wed Jul 03, 2002 11:00 pm
Location: Avrillé, France

Re: OSDelay, interrupt disable

Postby Salvo Tech Support » Wed Sep 11, 2002 7:29 am

Hi Benoit.

What you are seeing is correct behavior for Salvo with its queueing model when you have multiple tasks in the eligible or delayed queues. It takes time to traverse the queue and place the new element in it. It sounds like in the case you are looking at, either the task has a low priority or the delay is very large compared to other delayed tasks.

On the PIC18 series, the best way to avoid this is to have Salvo services called from only one interrupt level, and leave the other free for your higher-priority interrupts. You will need Salvo Pro to take advantage of this, though, because Salvo LE disables both low- and high-priority interrupts during critical sections. You can change that with Salvo Pro ...

------------------
--------
Salvo Technical Support
Please request all tech support through the Forums.

--------
Salvo Technical Support
Please request all tech support through the Forums.
Salvo Tech Support
 
Posts: 173
Joined: Sun Nov 19, 2000 12:00 am


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest