Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Printf's cause code violation (http://www.chiefdelphi.com/forums/showthread.php?t=60100)

K.Porter 14-12-2007 10:00

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.

Kingofl337 14-12-2007 10:26

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.

EHaskins 14-12-2007 12:47

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.

Kevin Watson 14-12-2007 17:26

Re: Printf's cause code violation
 
Quote:

Originally Posted by K.Porter (Post 658836)
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


All times are GMT -5. The time now is 00:24.

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