Pumpkin User Forums
  PICmicro MCUs
  18F452 build "tut6" builds with change to "TMR0"

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   18F452 build "tut6" builds with change to "TMR0"
aek
Moderator
posted October 26, 2005 14:02     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
Hi Floyd.

Sorry to hear you're having problems -- that code has been updated to read:

code:
#elif defined(SYSE)

#pragma interrupt ISRHigh save=PROD,section(".tmpdata")

void ISRHigh( void )
{
if ( INTCONbits.TMR0IE && INTCONbits.TMR0IF ) {
INTCONbits.TMR0IF = 0;
TMR0L -= TMR0_RELOAD;

OSTimer();
}
}


If OSTimer() is being hit, then tasks with delays and/or timeouts will run. Generally, am inability to break on a task with MPSIM may be a by-product of the simulator / debugger not properly associating the line you've set a breakpoint on with the actual code line.

Is <counter> ticking upwards?

We use MPSIM extensively to test Salvo code, and have no problems getting the breakpoints to work ...

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

IP:

floydg
Junior Member
posted October 26, 2005 13:27     Click Here to See the Profile for floydg     Edit/Delete Message   Reply w/Quote
TMR0 in isr.c is not defined. TMR0L and TMR0H is defined in p18f452.h

Isr.h does perform remapping of TMR0 to TMRL for "SYSP" build control flag:

#if defined(SYSP)
#define TMR0 TMR0L
#endif

So I added the following:

// FRG Added this code.
#if defined(SYSE)
#define TMR0 TMR0L
#endif

But I do not get any breakpoints to get hit/triggered in the three tasks that should be running, when using the simulator.

I lowered the timer reload value, to attempt to get the system to hit faster.

//FRG to speed up simulator #define TMR0_RELOAD 156 /* for 100Hz ints @ 4MHz */
#define TMR0_RELOAD 3


Still no break points are hit in the three tasks. The timer isr "ISRHigh() does get hit, and the reload value is applied.

IP:

All times are ET

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Pumpkin Home Page

2000-2008 Pumpkin, Inc. All Rights Reserved. Pumpkin and the Pumpkin logo, Salvo and the Salvo logo, The RTOS that runs in tiny places, CubeSat Kit and the CubeSat Kit logo are all trademarks of Pumpkin, Inc. All other trademarks are the properties of their respective owners.


Ultimate Bulletin Board 5.46a