Go to Post Dean's probably sitting in his chair saying "Dance puppets, dance!" - [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 16-01-2008, 18:26
jasonpeinko jasonpeinko is offline
Registered User
FRC #1087
 
Join Date: Jan 2008
Location: Salem Oregon
Posts: 22
jasonpeinko is an unknown quantity at this point
printf causes programs to not run

I was trying to setup a printf command in user routines fast, but when i upload it to the robot it gets stuck in program mode,

I used Jifi to upload it,

i also use mplab running under wine to compile.
  #2   Spotlight this post!  
Unread 16-01-2008, 18:54
psy_wombats's Avatar
psy_wombats psy_wombats is offline
Registered User
AKA: A. King
FRC #0467 (Duct Tape Bandits)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Shrewsbury MA
Posts: 95
psy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura aboutpsy_wombats has a spectacular aura about
Re: printf causes programs to not run

The fast loop, I believe, can't support the printf function, simply because it is a very fast loop. The printf takes a lot of time (relaying info through your serial) so the print is being called way too fast for it to finish, and causes the program error.

Should be able to fix by calling only by a timer interrupt, or when a loop count is divisible by fifty, (to call every fiftieth loop or something), or maybe use the slow loop?
  #3   Spotlight this post!  
Unread 16-01-2008, 19:02
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: printf causes programs to not run

Quote:
Originally Posted by psy_wombats View Post
The fast loop, I believe, can't support the printf function, simply because it is a very fast loop. The printf takes a lot of time (relaying info through your serial) so the print is being called way too fast for it to finish, and causes the program error.
I've done this successfully (when debugging shaft encoders), but wouldn't recommend it. It's very easy to crash things this way.

Quote:
Should be able to fix by calling only by a timer interrupt, or when a loop count is divisible by fifty, (to call every fiftieth loop or something), or maybe use the slow loop?
This is of course a much better solution.
  #4   Spotlight this post!  
Unread 16-01-2008, 19:03
gizzlyMIKE000 gizzlyMIKE000 is offline
Registered User
FRC #1516
 
Join Date: Jan 2008
Location: San Ramon, CA
Posts: 24
gizzlyMIKE000 is an unknown quantity at this point
Re: printf causes programs to not run

how do i post a forum?
  #5   Spotlight this post!  
Unread 16-01-2008, 19:13
TubaMorg TubaMorg is offline
Programmermechanicalelect ricalcoach
AKA: Dan
FRC #1480 (Robatos Locos)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Houston
Posts: 450
TubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond reputeTubaMorg has a reputation beyond repute
Re: printf causes programs to not run

Quote:
Originally Posted by gizzlyMIKE000 View Post
how do i post a forum?
Do you mean how do you post a reply? Well you just did, obviously. If you mean that you would like to start a new thread, then look for the appropriate topic and look for "start a new thread"
  #6   Spotlight this post!  
Unread 17-01-2008, 17:40
jasonpeinko jasonpeinko is offline
Registered User
FRC #1087
 
Join Date: Jan 2008
Location: Salem Oregon
Posts: 22
jasonpeinko is an unknown quantity at this point
Re: printf causes programs to not run

i am confused on how to get this to work,

i have to it only is supost to show every 1000000 times the code runs.
  #7   Spotlight this post!  
Unread 17-01-2008, 18:54
jasonpeinko jasonpeinko is offline
Registered User
FRC #1087
 
Join Date: Jan 2008
Location: Salem Oregon
Posts: 22
jasonpeinko is an unknown quantity at this point
Re: printf causes programs to not run

tomorrow i will try using the default prgoram with the controller to see if it work with printf, could the problem be that my computer is not being able to handle the printf when it recieves it back?
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
Presence of function causes auton to fail??? Kyveck Programming 13 16-02-2006 14:48
printf could not find definition Alex829 Programming 7 27-06-2005 10:04
printf statements do not display in autonomous mode PVC Pirates Programming 3 22-02-2005 15:41
printf isn't printf-ing. Help! Meandmyself Programming 14 15-02-2004 16:27


All times are GMT -5. The time now is 15:14.

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