Page 1 of 1

TU5 OS-Delay() not running

PostPosted: Wed Jun 28, 2006 1:09 am
by jtnum
The USE_INTERRUPT macro used in isr.c controls whether or not the interrupt handler is included, but in main.h Init() for SYSE, enables the TMR0 int, without regard to the USE_INTERRUPT macro.

I am sure it is a hassle keeping up with all the revisions of the IDE and compiler versions, but I am using the latest (or within a month or so) from Microchip....IDE v7.40 and C18 v3.03. I reverted to using the 18F452 for compatibility.
Still have the issue that OS_Delay()....which very well could be pilot error, due to the changes in the project build options that were required to get it to build. Anyway will keep working with it...it looks like a good product.


Re: TU5 OS-Delay() not running

PostPosted: Wed Jun 28, 2006 1:53 am
by aek
quote:
Defined TMR0 TMR0L, as in prev posts, but
TaskBlink() runs once, which results in the lsb to toggle on, but does not blink.
Inspecting INTCON[7]...GIE/GIEH is 0, which would explain why TaskBlink() would only run once, as the call to OSTimer, only occurs once. Is there something else that should re-enable the global int enable?
For MPLAB-C18, the status of the GIE/GIEL bits is restored after every Salvo service call. So if they were not originally (explicitly) enabled, they will be never be re-enabled in the application. Set them explicitly, and trace through a Salvo system call (in Disassembly window if necessary).

One more thing -- Salvo for use with MPLAB-C18 does _not_ currently support local auto variables (see the forums), and their use often messes up the GIE/GIEL bit. That may be the root of your problem.

------------------


Re: TU5 OS-Delay() not running

PostPosted: Wed Jun 28, 2006 10:00 am
by jtnum
Defined TMR0 TMR0L, as in prev posts, but
TaskBlink() runs once, which results in the lsb to toggle on, but does not blink.
Inspecting INTCON[7]...GIE/GIEH is 0, which would explain why TaskBlink() would only run once, as the call to OSTimer, only occurs once. Is there something else that should re-enable the global int enable?

Re: TU5 OS-Delay() not running

PostPosted: Wed Jun 28, 2006 10:21 am
by aek
I have to ask -- are you building these projects from scratch, or just running them using the projects as provided ... because the projects build and run just fine out-of-the-box, as long as one deals with the fact that the current MPLAB is much newer than the MPLAB that the projects were built for, and some of the project options may have been lost.

------------------


Re: TU5 OS-Delay() not running

PostPosted: Wed Jun 28, 2006 11:15 am
by jtnum
I had difficulty running these projects, as provided. 1st item was the version control issue, 2nd was that when the project was open, the files were not located in the same directories as they were installed. Also the compiler was installed in my D: drive, so the project options had to be changed.
What about the issue of TMR0 and TMR0L for SYSE?
What about Init() in the 1st couple of tutorials that don't use TMR0? (the ints weren't being handled)

Re: TU5 OS-Delay() not running

PostPosted: Wed Jun 28, 2006 11:20 am
by aek
Yeah, if they're not in the default directory (c:salvo as the root) then you can / will have a variety of problems.

See http://www.pumpkininc.com/ubb/Forum17/HTML/000118.html for the TMR0 / TMR0L issues.

The Init() is controlled by the defined symbol USE_INTERRUPTS, which is not defined until tu5.

------------------