Pumpkin User Forums
  TI's MSP430
  A question concerning delays.

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:   A question concerning delays.
ces
Junior Member
posted July 31, 2006 07:58     Click Here to See the Profile for ces     Edit/Delete Message   Reply w/Quote
Thank you, with the change you suggested and the removal of any references to the ISR my code works correctly. I'll see about finding where my error was in my interrupt code.

Thanks again,

Chuck

IP:

aek
Moderator
posted July 31, 2006 00:31     Click Here to See the Profile for aek     Edit/Delete Message   Reply w/Quote
I'll take a look at your code later ... but in general, problems with delays are due to the user incorrectly coding the ISR that calls OSTimer().

A quick way to prove / disprove this is to stop calling OSTimer() from an ISR and instead call it from main:

code:

int i = 500;
...
while (1)
{
if (--i == 0)
{
i = 500;
OSTimer();
}
OSSched();
}

While the time accuracy of such a scheme is not that of using an ISR, it avoids all interrupt-related issues and your delays will work, with a slight loss of accuracy. Try this and see what happens.

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

[This message has been edited by aek (edited July 31, 2006).]

IP:

ces
Junior Member
posted July 30, 2006 10:38     Click Here to See the Profile for ces     Edit/Delete Message   Reply w/Quote
Situation: I have been having problems with the reliability of my delays within Salvo. In order to solve this I added a very simple LED switching task based on the code provided in Project 1 for the CubeSat Kit to my project. I had hoped that this would let me find my error and resolve it, but unfortunatly that has not been the case.

Problem: When I step through the code it consistently switches the LED on and off for an indefinite amount of time. However, if I turn off my break points and let the code run at full speed it will complete 1 to 3 calls to my task and then idle indefinitely. What error on my part could be causing my code to operate correctly while stepping through it via a debugger, but fail to operate when allowed to execute at full speed?

I have included links to all of the relevant source code below:

salvocfg.h -> here
main.h -> here
main.c -> here
isr.h -> here
isr.c -> here

This code is part of a much larger project, but in trying to isolate this problem I have commented out or removed much of the other code.

Edit 1: Fixed the links.
Edit 2: Fixed some grammar.
Edit 3: Fixed more grammar.

[This message has been edited by ces (edited July 30, 2006).]

[This message has been edited by ces (edited July 30, 2006).]

[This message has been edited by ces (edited July 30, 2006).]

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