Pumpkin, Inc.

Pumpkin User Forums

TU5 OS-Delay() not running

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®).

TU5 OS-Delay() not running

Postby jtnum » Wed Jun 28, 2006 1:09 am

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.

jtnum
 
Posts: 6
Joined: Sun Jun 25, 2006 11:00 pm
Location: Woodinville, WA, USA

Re: TU5 OS-Delay() not running

Postby aek » Wed Jun 28, 2006 1:53 am

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.

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

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

Re: TU5 OS-Delay() not running

Postby jtnum » Wed Jun 28, 2006 10:00 am

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?
jtnum
 
Posts: 6
Joined: Sun Jun 25, 2006 11:00 pm
Location: Woodinville, WA, USA

Re: TU5 OS-Delay() not running

Postby aek » Wed Jun 28, 2006 10:21 am

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.

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

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

Re: TU5 OS-Delay() not running

Postby jtnum » Wed Jun 28, 2006 11:15 am

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)
jtnum
 
Posts: 6
Joined: Sun Jun 25, 2006 11:00 pm
Location: Woodinville, WA, USA

Re: TU5 OS-Delay() not running

Postby aek » Wed Jun 28, 2006 11:20 am

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.

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

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


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 1 guest

cron