Go to Post We want people to exercise Gracious Professionalism® and play at their best, but also not really because we find this archaic rule to satisfy something related to inspiring students to pursue careers in science and technology.™ - PayneTrain [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-01-2008, 22:57
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Timers causing code errors?

Hey, i implemented a simple timer that dings every 25ms, for the purposes of differentiating an encoder signal. Before i implemented it, the code was working fine, but after i did i get code errors (red light of doom) that seem to be resolved by a simple press of the reset button... and then it doesnt return until i shut the robot down completely.

any suggestions/thoughts?

yes, i have downloaded master code v15 (i think its 15) to the robot and master controller.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
  #2   Spotlight this post!  
Unread 20-01-2008, 23:39
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,598
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Timers causing code errors?

Are you using a hardware timer? If so, which timer? Timer 0 is used by the Generate_PWMs() function in the standard IFI librarys. Trying to use it for your timer will play heck with things for certain.

If not, have you implemented your interrupt routine correctly? Are you not clearing the interrupts flag? Are you staying in the interrupt routine too long? Are you possibly corrupting some of your memory with your interrupt routine?
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #3   Spotlight this post!  
Unread 21-01-2008, 04:34
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Timers causing code errors?

im pretty sure im using timer 1, and im also certain that im not corrupting memory or taking too much time... i think.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
  #4   Spotlight this post!  
Unread 21-01-2008, 12:17
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Timers causing code errors?

Quote:
Originally Posted by Uberbots View Post
im pretty sure im using timer 1, and im also certain that im not corrupting memory or taking too much time... i think.
My vote would be that you're not clearing the interrupt flag in the ISR.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 21-01-2008, 19:40
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Timers causing code errors?

Check and make sure "#pragma ... save=" is saving all of the required registers. Which ones are dependent upon your interrupt service routine code and what is used.


Posting the #pragma and the ISR code pertaining to the timer would help.
  #6   Spotlight this post!  
Unread 21-01-2008, 19:59
Tim Skloss's Avatar
Tim Skloss Tim Skloss is offline
Dr. Skloss
FRC #0930
Team Role: Parent
 
Join Date: Jan 2002
Rookie Year: 2000
Location: Waukesha, WI, USA
Posts: 73
Tim Skloss is a jewel in the roughTim Skloss is a jewel in the roughTim Skloss is a jewel in the roughTim Skloss is a jewel in the rough
Re: Timers causing code errors?

We implemented the interrupt-based timer described in the IFI white paper.

It has worked fine for us without errors.
__________________
---------------
FIRST Mentor and Team Leader
C.O.R.E 2062 a NASA, GE Volunteers and Rockwell Automation FRC Team
  #7   Spotlight this post!  
Unread 22-01-2008, 02:10
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Timers causing code errors?

ok, ill post it next time i get my hands on the code (tomorrow probably)

and i think i am clearing the flag... the error only occurs when we do a hard reset of the robot, and a soft reset fixes it.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY

Last edited by Uberbots : 22-01-2008 at 02:12.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code error causing robot to go into programming mode. MJD Programming 14 30-10-2007 14:21
Code Errors With "Bells and Whistles" Ryan O Programming 2 31-01-2006 19:29
Timers MarkVH Programming 1 13-02-2005 11:30
Timers ? Gal Longin Programming 5 12-02-2005 06:15
Timers bludstayne Programming 1 19-01-2004 19:25


All times are GMT -5. The time now is 09:17.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi