Go to Post ...remember RAID 0 is a trap. - Sperkowsky [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 06-04-2006, 23:44
Denz's Avatar
Denz Denz is offline
Registered User
FRC #0772 (Sabre Bytes Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Location: LaSalle, Ont, Canada
Posts: 66
Denz is on a distinguished road
Send a message via MSN to Denz
GTS Code Error (the red light of doom!)

A while ago I tried modifying Kevin's encoder code to work with gear tooth sensors. I had a test "robot" set up in my room, with basically a push switch on a digital in and every time I pressed it, it would trigger the interrupt and the count would increase by one.
It took a while to get working(since I'm pretty new at this) and with a little help from everyone on here (thanks guys!) I had it working fine with my practice setup. When we got to our regional, and I put it on the robot, I got a code error, the blinking red light of doom, and I don't understand why. It was working perfectly on the other processor. Any thoughts or comments?
I'll post the important parts of the code, maybe you guys can come to my rescue again.
772 is pending for ATL and we're probably going, so after scoring (very inconsistently) in autonomous maybe 1 sometimes the highest we got was 3, I would like to use the camera in combination with the GTS for better results.

If you have the time, I would really appreciate some feedback to what might be causing the code error. It worked fine at home, honest! lol. Thanks in advance...

Deniz
Attached Files
File Type: c encoder.c (10.5 KB, 35 views)
File Type: h encoder.h (4.0 KB, 29 views)
File Type: c user_routines_fast.c (8.2 KB, 32 views)
File Type: h user_routines.h (3.5 KB, 26 views)
File Type: c user_routines.c (17.5 KB, 39 views)
__________________
www.sabrerobotics.com
  #2   Spotlight this post!  
Unread 06-04-2006, 23:55
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,588
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: GTS Code Error (the red light of doom!)

Code:
//Putdata(&txdata);             /* DO NOT CHANGE! */
Putdata should not be commented out on line 317 of user_routines.c
  #3   Spotlight this post!  
Unread 07-04-2006, 00:30
TimCraig TimCraig is offline
Registered User
AKA: Tim Craig
no team
 
Join Date: Aug 2004
Rookie Year: 2003
Location: San Jose, CA
Posts: 221
TimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to behold
Re: GTS Code Error (the red light of doom!)

If you're using the 2006 controller, the one with the PIC 8722, don't forget to get and use the new libraries and other fixes from IFI. And be advised, they don't work in all cases, they certainly didn't for me.
  #4   Spotlight this post!  
Unread 07-04-2006, 01:28
Denz's Avatar
Denz Denz is offline
Registered User
FRC #0772 (Sabre Bytes Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Location: LaSalle, Ont, Canada
Posts: 66
Denz is on a distinguished road
Send a message via MSN to Denz
Re: GTS Code Error (the red light of doom!)

I didn't have any problems before, but I did get the fixes, accutally, that might be the problem, I don't remember if I tested the code at home with the fixes, I will look into that. And as far as the putdata, I have it called once above it. I'm not sure if that makes a difference or not, but I did comment it back in. I have no way to test (seeying as our robot is on it's way to ATL) but if anyone has any more suggestions, it is appreciated!
__________________
www.sabrerobotics.com
  #5   Spotlight this post!  
Unread 07-04-2006, 03:47
X-Istence X-Istence is offline
Melt the RC controller!
AKA: Bert JW Regeer
no team
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Montville
Posts: 151
X-Istence will become famous soon enoughX-Istence will become famous soon enough
Send a message via AIM to X-Istence Send a message via MSN to X-Istence
Re: GTS Code Error (the red light of doom!)

Quote:
Originally Posted by TimCraig
If you're using the 2006 controller, the one with the PIC 8722, don't forget to get and use the new libraries and other fixes from IFI. And be advised, they don't work in all cases, they certainly didn't for me.

Did not work for my team either, we had the new library and other stuff, and were still stuck on the field as a sitting duck, which was a bit of a shame.
__________________
My Blog!
  #6   Spotlight this post!  
Unread 07-04-2006, 08:09
neilsonster's Avatar
neilsonster neilsonster is offline
Registered User
AKA: Andrew Neilson
FRC #0772 (Sabre Bytes)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 188
neilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to all
Send a message via MSN to neilsonster
Re: GTS Code Error (the red light of doom!)

Deniz, it looks like you call Getdata and Putdata each twice (including the commented one) in Process_Data_From_Master_uP(). I'm just taking a guess but I believe there only has to be one call for each in Process_Data_From_Master_uP() (generally Getdata is called at the beginning and Putdata at the end). Anyways, that might be worth a shot.
__________________
Andrew Neilson - Team 772 Alumnus
University of Waterloo Computer Science, Class of 2010
  #7   Spotlight this post!  
Unread 07-04-2006, 09:36
Mike Bortfeldt Mike Bortfeldt is offline
Registered User
FRC #1126 (& 1511)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Rochester, NY
Posts: 119
Mike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud ofMike Bortfeldt has much to be proud of
Re: GTS Code Error (the red light of doom!)

Denz,

You've commented out the line that informs the compilier that the InterruptHandlerLow routine is an ISR. This is most likely the cause of your problem. Uncomment the following line and it will should at least get rid of the "red light of doom".

// #pragma interruptlow InterruptHandlerLow save=PROD,section(".tmpdata")


Mike
  #8   Spotlight this post!  
Unread 07-04-2006, 12:26
Denz's Avatar
Denz Denz is offline
Registered User
FRC #0772 (Sabre Bytes Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Location: LaSalle, Ont, Canada
Posts: 66
Denz is on a distinguished road
Send a message via MSN to Denz
Re: GTS Code Error (the red light of doom!)

Alright, I have no way to test all this, but they all sound like potential problems.
Andrew, yeah as far as calling those things twice, that's because I was being careless when I merged my code with the camera code, however I'm pretty sure that's not the problem, because in my other code I checked and I have the same thing, and we were using that all through the regionals. But I did change it so I call them only once (once at the beginning and the other one at the end, because it can't hurt).

Mike, I uncommented, and I'm hoping for the best in ATL, maybe I'll grab another processor again and try it on there.

Thanks guy, I hope it works!
__________________
www.sabrerobotics.com
  #9   Spotlight this post!  
Unread 07-04-2006, 12:58
Matt Krass's Avatar
Matt Krass Matt Krass is offline
"Old" and Cranky. Get off my lawn!
AKA: Dark Ages
FRC #0263 (Sachem Aftershock)
Team Role: Mentor
 
Join Date: Oct 2002
Rookie Year: 2002
Location: Long Island, NY
Posts: 1,187
Matt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond reputeMatt Krass has a reputation beyond repute
Send a message via AIM to Matt Krass
Re: GTS Code Error (the red light of doom!)

I hate to nitpick but this is starting to become a growing problem...

Code:
*	COMMENTS:	You are free to use this source code for any non-commercial
*				use. Please do not make copies of this source code, modified
*				or un-modified, publicly available on the internet or
*				elsewhere without permission. Thanks.
He's explained his reasoning several times already, and I know you did not mean harm but it would probably be best to only post the relevant parts (i.e. your changes from the supplied versions) in the future.

As far as your problem, how repeatable is it? Does the code error happen immediately? If so it may not be a problem with the interrupts, since they wouldn't get called unless you spun a wheel. Except I believe the ISR is shared between the digital IO interrupts and the communication interrupts with the camera, so check your pragma.

Also, try this #pragma in it's place:
Code:
#pragma interruptlow InterruptHandlerLow save=PROD,section("MATH_DATA"),section(".tmpdata")
That tells it to save more than what your line saves, we had some red-light problems when our interrupts were overwriting data we needed because the ISR didn't preserve it.
Good luck!
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!

I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
  #10   Spotlight this post!  
Unread 07-04-2006, 17:39
Denz's Avatar
Denz Denz is offline
Registered User
FRC #0772 (Sabre Bytes Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Location: LaSalle, Ont, Canada
Posts: 66
Denz is on a distinguished road
Send a message via MSN to Denz
Re: GTS Code Error (the red light of doom!)

The error was immediate, as soon as the program loaded, I got the red light. As soon as I restarted I got the red light.
I'll try what you suggested though. Thanks.
As far as posting Kevin's code...
I read Kevin's reasoning behind not wanting it being posted, I didn't mean any harm, but I did alot of deleting to the encoder.c, so it would be kind of hard to show the changes without showing the whole thing. (it's alot easier to look at the code as a whole, for my at least)
I posted it because I needed help, not to distribute, it's easier to look over the code and find my errors instead of guessing.
That's just my reasoning for what I did, if it was wrong, then I'm sorry.
__________________
www.sabrerobotics.com
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
program light blinks red and green JBabbie Programming 3 02-03-2004 09:19
Please...no more steenkin' light! Andrew General Forum 37 17-04-2003 23:06
light visibility Erinn888 General Forum 30 17-02-2003 15:56
Important info about light Jay Lundy Technical Discussion 10 12-04-2002 11:37
Program Code for Light Sensors...etc Jimbo Programming 1 08-01-2002 00:36


All times are GMT -5. The time now is 23:01.

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