Go to Post I'm unconvinced that this thread itself is not a performance art piece. - DCA Fan [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-12-2006, 07:27
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Printf has just entirely failed to do anything

I started with the default camera code from Kevin Watson a few weeks ago, and I have been making my modifications happily--that is, until yesterday. First, I added two of my own files, which did all the camera calls, consolidating them into a single Camera Update function. Then, I pulled the camera update function calls out of user_routines.c and put my camera update function call into Process local IO. I had something like this working last week, but it refuses to send any bytes out the serial port now.

Things I have tried:
-tested my serial link. It is good-I can send programs down + read them back with device reader. I also see IFI> when I reset the bot
-tested with another RC. Same problem.
-unplugged camera TTL converter. Same problem
-Added printfs everywhere in my code. None of them work unless I comment out the #include for serial_ports.h (this breaks the camera functionality of course) And none of the printfs produce any output
-Replaced all the files that should never have been modified (serial_ports.c/.h, terminal.c/.h, camera.c/.h are the ones I overwrote with the ones out of Kevin's code). No effect.

I'm bashing my head on the wall right now.....please help!

JBot

PS. I will post the code tonight if you need it. I am using a school machine right now and don't have access to my code right now.
__________________
Aren't signatures a bit outdated?
  #2   Spotlight this post!  
Unread 20-12-2006, 09:38
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,721
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Printf has just entirely failed to do anything

Which printf are you using?

The C18 library version that requires you to add "#include <stdio.h>" everywhere printf is called,
or one of the older printf_lib.c/h versions?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 20-12-2006, 12:35
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Printf has just entirely failed to do anything

I am using the stdio.h version where it won't compile unless I #include <stdio.h>.

It "Code error"ed out when I commented out the includes for Kevin Watson's serial port code. It worked then for about 5 seconds but it gave me a red light of death afterwards, presumably because I was bombarding it with tons of printfs.

JBot
__________________
Aren't signatures a bit outdated?
  #4   Spotlight this post!  
Unread 20-12-2006, 20:57
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Printf has just entirely failed to do anything

I really hate to do this, but since it is slowly creeping down the portal and I really need an answer...BUMP!

I am thinking about re-writing from scratch, but that would be ugly, so please, please tell me what I might be doing wrong...

JBot
__________________
Aren't signatures a bit outdated?
  #5   Spotlight this post!  
Unread 20-12-2006, 22:23
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,721
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Printf has just entirely failed to do anything

Sorry, we've been racing robots all night. They're having a pushing contest now.

Probably need to attach or email your whole project to look at.
It's hard to guess what serial port resource conflict you might have. There are too many answers.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #6   Spotlight this post!  
Unread 20-12-2006, 23:45
esquared's Avatar
esquared esquared is offline
Keeps saying 3-2-1-Rush...
AKA: Angry Eric
no team (Volunteer!)
Team Role: Mascot
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Boston, MA
Posts: 192
esquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond repute
Re: Printf has just entirely failed to do anything

Quote:
Originally Posted by Mark McLeod View Post
Sorry, we've been racing robots all night. They're having a pushing contest now.

Probably need to attach or email your whole project to look at.
It's hard to guess what serial port resource conflict you might have. There are too many answers.
Definitely zip up the project, there are a number of people out here on "the internets" who will take a look and give you a hand. Not being able to debug over the serial port leaves you with few options. The "Red Light of Doom" is typically caused by the same things that would cause a Windows-type program to either crash, or it went into an infinite/extremely long loop somewhere. The infinite/long loop would be the first thing I'd carefully check for in your code, it's easier to do than you'd think.

If you are indeed the lone programmer for your team (poor guy ) you might want to force some code versioning on yourself. Things like CVS or SVN (check out wikipedia or google it yourself) CAN AND WILL SAVE YOUR BACON! It'll allow you to easily step back in time before you screwed something up, and will also provide an easier time of multiple people working on the project at once. This way you can try training an interested freshman without fear of him making changes you can't get rid of when your team leader asks you "is autonomous mode done yet?" It takes some work to understand, but I promise (and every other user of some code versioning system will promise) it will be worth the effort.

--Eric
  #7   Spotlight this post!  
Unread 21-12-2006, 14:11
B.Johnston B.Johnston is offline
Registered User
AKA: Bruce Johnston
no team
Team Role: Mentor
 
Join Date: Apr 2006
Rookie Year: 2004
Location: Niagara Falls
Posts: 44
B.Johnston will become famous soon enough
Re: Printf has just entirely failed to do anything

I had the same sort of occurrence myself this week as I was trying to program one of the 2005 units.

Since you haven't mentioned which controller you're using this may not work.

If you have a 2005 CPU it's likely using a 8520 pic, which needs the following environment changes in mplab:

From the Configure >> Select Device... menu choose "PIC18F8520"
as the pic type

In your project use the "FRC_library.lib" for the 8520

(mine is named FRC_library_8520.lib) -To keep my sanity I
renamed it in the same
fashion as last years revised
libraries and linkers were.

Also In your project use the "18F8520.lkr" for the 8520

NOW the last ingredient for success in restoring printf's (in my case anyway)

Load the FRC_MASTER_V12.BIN and reload your first compiled code
(before all of your changes)

If you're using a pre 2006 CPU it's probably not been loaded with a FRC_MASTER_V12.BIN but an older version.

I'm just guessing (since it's now gone) but ours was probably using the V11 master code as distributed in April 2005.

Once the master code was updated my printf's worked fine (no more IFI> terminal freeze ups)
  #8   Spotlight this post!  
Unread 21-12-2006, 22:46
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Printf has just entirely failed to do anything

OK, the code that is causing me problems is posted:

http://jbotalan.frih.net/07_code.zip

No printfs work anywhere.

I'm re-writing from the default user code. It will make for cleaner code. I would be interested in finding out why the heck this broke.

I'm going to try CVS.

JBot
__________________
Aren't signatures a bit outdated?
  #9   Spotlight this post!  
Unread 21-12-2006, 23:16
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: Printf has just entirely failed to do anything

Quote:
Originally Posted by 1680Bruce View Post
If you're using a pre 2006 CPU it's probably not been loaded with a FRC_MASTER_V12.BIN but an older version.

I'm just guessing (since it's now gone) but ours was probably using the V11 master code as distributed in April 2005.

Once the master code was updated my printf's worked fine (no more IFI> terminal freeze ups)
I'm not sure this is sound advice, I looked on IFIs website, and the latest update I see for a 2005 controller is v11. The v12 update is included with the 2006 controller code. This to me implies the update is built for the 2006 controller, and I'm not sure if it shares a master processor with the 2005. If it does share a master processor, it should work fine, but if they've changed them, such an update could make the RC...not work.

Does anyone know if the 2005 and 2006 controllers share a master processor model? Also did you actually do the Master version update on your 2005 controller? It's a little hard to understand as you speculate the controller in question was running v11.

Can someone clarify please?
__________________
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 22-12-2006, 11:52
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Printf has just entirely failed to do anything

Quote:
Originally Posted by esquared View Post
If you are indeed the lone programmer for your team (poor guy ) you might want to force some code versioning on yourself. Things like CVS or SVN (check out wikipedia or google it yourself) CAN AND WILL SAVE YOUR BACON!
Thanks so much for suggesting CVS/SVN! I now have SVN set up on my machine, and I like the looks of it. It's really cool to look at the diff of two versions of one file. I can see how this would be great at robotics.

Oh, I like being the lone programmer! Nobody to fight with over how the code will work! I'm trying to train a freshman, but otherwise I'm it.

Thanks again. You learn something new every day. If only I learned something this cool every day...

JBot
__________________
Aren't signatures a bit outdated?
  #11   Spotlight this post!  
Unread 22-12-2006, 17:14
esquared's Avatar
esquared esquared is offline
Keeps saying 3-2-1-Rush...
AKA: Angry Eric
no team (Volunteer!)
Team Role: Mascot
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Boston, MA
Posts: 192
esquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond reputeesquared has a reputation beyond repute
Re: Printf has just entirely failed to do anything

Quote:
Originally Posted by JBotAlan View Post
OK, the code that is causing me problems is posted:

http://jbotalan.frih.net/07_code.zip

No printfs work anywhere.

I'm re-writing from the default user code. It will make for cleaner code. I would be interested in finding out why the heck this broke.

I'm going to try CVS.

JBot
Could you add the following to timer_handler.c in the InitializeTimer() function?

Code:
PIE1bits.TMR1IE = 0;
Since you don't have an interrupt handler for that timer, but you start it, it is wise to make sure it's set to not create an interrupt. It might start out that way by default, but this is much safer. An interrupt that is generated but not handled can do very bizarre things.

If i understand your original post correctly, it stopped working when you moved the function calls into your abstraction files?

I noticed you did not call "Initialize_Camera()" in your abstraction file (or anywhere in your project). Try adding that to user_routines.c in the User_Initialization() function.

Let me know if any of these work.
-Eric
  #12   Spotlight this post!  
Unread 22-12-2006, 17:26
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Printf has just entirely failed to do anything

I'll be sure to let you know if these work. I won't be able to check until we get back (on the 4th I think). It's nice to know someone cares enough to pull down someone else's code to look at it. I wouldn't have been as generous before FIRST...

Thanks,
JBot

EDIT: I was under the impression that Camera_Handler() in camera.c was supposed to be calling Initialize_Camera(), and it is as far as I know. I can call it manually, but depending on the flags set in camera.c, it does get called if camera comms aren't working. Correct me if I'm wrong...
__________________
Aren't signatures a bit outdated?

Last edited by JBotAlan : 22-12-2006 at 17:31. Reason: Just re-read the code
  #13   Spotlight this post!  
Unread 22-12-2006, 20:48
B.Johnston B.Johnston is offline
Registered User
AKA: Bruce Johnston
no team
Team Role: Mentor
 
Join Date: Apr 2006
Rookie Year: 2004
Location: Niagara Falls
Posts: 44
B.Johnston will become famous soon enough
Re: Printf has just entirely failed to do anything

Matt,

Sorry for leaving you confused.

The last step for success (in my eliminating the IFI> prompt freeze up while adding in printf's for my chosen variables) WAS the loading of the MASTER_V12.BIN from the 2006 default code.

You are absolutely correct when you mention that there is no explicit documentation of whether it's appropriate to try this.

But where is your sense of adventure.

The fact that IFI was doing FRC controller processor upgrades from ver 8520PICS to 8722PICS,

and Kevin Watson was releasing all kinds of code with instructions on how to load user programs written as enhancements for the 2006 base code onto 2005 processors.

Surely, if it were fatal to the processor somebody would have noticed by now that loading the MASTER_V12.BIN shouldnt be done on a 2005 controller.

Anyway it works, my 2005 controller is happily running MASTER_V12.BIN and both the FRC Default code and OUR 1114-1503-1680 Common base code that were teaching our programmers with.

Perhaps I should have actually read the IFI site for instructions on how to confirm which Master code we were running before I scrapped it, but I did save the bin file for posterity using device reader.

The only guessing going on was if it was v 10 or v11 not whether or not I fixed the freeze up at the IFI> stage.

Bruce

PS Jacob, I looked at your environment (8722PIC, lib & lkr) and you don't have the same printf freeze issue I had.
  #14   Spotlight this post!  
Unread 22-12-2006, 21:39
JBotAlan's Avatar
JBotAlan JBotAlan is offline
Forever chasing the 'bot around
AKA: Jacob Rau
FRC #5263
Team Role: Mentor
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Riverview, MI
Posts: 723
JBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond reputeJBotAlan has a reputation beyond repute
Send a message via AIM to JBotAlan Send a message via Yahoo to JBotAlan
Re: Printf has just entirely failed to do anything

Quote:
Originally Posted by 1680Bruce View Post
But where is your sense of adventure.
...
Surely, if it were fatal to the processor somebody would have noticed by now that loading the MASTER_V12.BIN shouldnt be done on a 2005 controller.
Hmm. I'm glad someone else did this experimentation. It would be an interesting experience, to say the least, describing to our team leader exactly why the most expensive component of the robot has become a paperweight.
Quote:
Originally Posted by 1680Bruce View Post
PS Jacob, I looked at your environment (8722PIC, lib & lkr) and you don't have the same printf freeze issue I had.
Thanks for trying. I really appreciate your help.

JBot
__________________
Aren't signatures a bit outdated?
  #15   Spotlight this post!  
Unread 23-12-2006, 00:54
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: Printf has just entirely failed to do anything

Quote:
Originally Posted by 1680Bruce View Post
Anyway it works, my 2005 controller is happily running MASTER_V12.BIN and both the FRC Default code and OUR 1114-1503-1680 Common base code that were teaching our programmers with.
Quote:
Originally Posted by JBotAlan View Post
Hmm. I'm glad someone else did this experimentation. It would be an interesting experience, to say the least, describing to our team leader exactly why the most expensive component of the robot has become a paperweight.

Thanks for trying. I really appreciate your help.

JBot
Yeah I was definitely not up to that adventure Killing the RC my first year on 358 would have left a bad first impression

Thanks for the information, I've tucked it in with my 'useful things' section of the brain.
__________________
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!)
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
Compiling Failed Teh Mike Programming 7 09-02-2005 13:27
pic: Failed attempt at simulation CD47-Bot Extra Discussion 5 17-06-2004 11:03
printf isn't printf-ing. Help! Meandmyself Programming 14 15-02-2004 16:27
And now for something entirely different..... archiver 1999 1 23-06-2002 22:46


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

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