Pumpkin, Inc.

Pumpkin User Forums

Salvo disable intterupt in certain moments

If you can't make Salvo do what you want it to do, post it here.

Salvo disable intterupt in certain moments

Postby Jonas » Wed Sep 01, 2004 9:06 am

I want to use TMR0 overflow interrupt on PIC16F877 for buzzer. But Salvo disable interrupts in certain moments, and this lead to terrible buzzer sound. In the backround work all program on the Salvo. OS_Delay's and semaphore is used. Is this possible to make, that salvo doesn't disable interrupts?

Thank you,

Posts: 6
Joined: Mon Nov 24, 2003 12:00 am

Re: Salvo disable intterupt in certain moments

Postby aek » Wed Sep 01, 2004 9:22 am

Hi Jonas.

Salvo (and every RTOS) needs to disable interrupts during critical sections.

If you have Salvo Pro, what you can do is do a source-code build, and change the interrupts that Salvo is controlling so that it doesn't disable your TMR0 interrupt.

Salvo must always disable any interrupt sources that call Salvo functions, e.g. OSTimer(). Otherwise your application will break.

So, for PIC16, do a source-code Salvo Pro build of your project. In your salvocfg.h, #define your own OSEi() and OSDi() so that all interrupt sources that call Salvo services like OSTimer() are disabled by OSDi() and re-enabled by OSEi(). Then rebuild your project.

For example, if you only call OSTimer() from the TMR2 ISR, then set OSDi() to disable TMR2IE, and OSEi() to enable TMR2IE. Then, after rebuilding the source-code Salvo Pro project, when Salvo is in a critical section, it will only prevent the TMR2 ISR from happening, and won't affect TMR0 ISRs.

You can see the defaults for OSDi() and OSEi() in salvoincportpicc.h. You can override them by #define'ing new ones in your project's salvocfg.h.

N.B. Salvo LE and Lite users cannot change the default behavior (Salvo disables interrupts globally) because it requires changes to the Salvo source code.


Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest