Go to Post Don't give up on others. I believe in killing grumps with a smile! - maltz1881 [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 14-12-2007, 10:00
K.Porter's Avatar
K.Porter K.Porter is offline
Not So Random!
FRC #0172 (FALGOR)
Team Role: Electrical
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Gorham, Maine
Posts: 68
K.Porter will become famous soon enough
Send a message via AIM to K.Porter Send a message via MSN to K.Porter
Printf's cause code violation

Whenever there is a printf statement in code the code violation light blinks slowly. It happens regardless of what variable types I'm printing, or even if its just text. Has anyone else had this problem?

This is on the 2006 controller using MPLAB + IFI Loader.
I have the proper serial port selected in IFI Loader, and Baud rate is 115200. Error occurs regardless of where the printf is.
  #2   Spotlight this post!  
Unread 14-12-2007, 10:26
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Printf's cause code violation

I've seen this before if the loop is too fast it can make the processor angry.

We saw this in early testing when we wrote the first version of easyC

Add a small delay in the loop and see if that helps.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #3   Spotlight this post!  
Unread 14-12-2007, 12:47
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Printf's cause code violation

Can you post the code that is causing the issue?

If not, I think I had an issue like that when I switched to Kevin's code, but I don't remember what I did to fix it.
__________________
Eric Haskins KC9JVH
  #4   Spotlight this post!  
Unread 14-12-2007, 17:26
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: Printf's cause code violation

Quote:
Originally Posted by K.Porter View Post
Whenever there is a printf statement in code the code violation light blinks slowly. It happens regardless of what variable types I'm printing, or even if its just text. Has anyone else had this problem?

This is on the 2006 controller using MPLAB + IFI Loader.
I have the proper serial port selected in IFI Loader, and Baud rate is 115200. Error occurs regardless of where the printf is.
If you're using my serial port code, a sure fire way to get the red-light-of-death when you send data is to not properly configure the interrupt service routine in user_routines_fast.c.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
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
URGENT - Code Violation CPress Programming 5 09-02-2007 23:26
Modified default code gives "code violation" scottmso Programming 8 10-02-2006 23:17
Code Violation when testing chris_chen Programming 0 24-01-2006 20:28
Code violation using Hall effect sensor pickle Programming 9 19-01-2005 00:10
code violation...need help Vince lau Programming 4 20-02-2004 16:31


All times are GMT -5. The time now is 19:47.

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