CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

printf hangs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
teekaytk



Joined: 14 Jan 2005
Posts: 28

View user's profile Send private message

printf hangs
PostPosted: Mon May 29, 2006 5:44 am     Reply with quote

hi i am using 18LF8720 in 3.3v system. printf command seems to make it hang during strings longer than 10 characters. but putc always works.
has any one found this problem before. is this a bug? or is it just me!
please help
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon May 29, 2006 6:10 am     Reply with quote

As far as I know this is not a known bug. Which compiler version are you using?
Can you post a small but compilable program showing your problem?
teekaytk



Joined: 14 Jan 2005
Posts: 28

View user's profile Send private message

PostPosted: Mon May 29, 2006 6:24 am     Reply with quote

ver is 3.230
Code:
#include <18F8720.h>
#device *=16//,icd=true
#use delay(clock=16000000)

#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7)

#fuses NOWDT,WDT128, HS, NOPROTECT, NOOSCSEN, NOBROWNOUT, BORV25, NOPUT, NOCPD, STVREN, NODEBUG, NOLVP, NOWRT, NOCPB, NOEBTR, NOWRTD, NOWRTC, NOWRTB


Code:

void main (){
printf("initialize done")
while(1){}
}



code that works
Code:
void main (){

while(1){putc(oxAA)}
}
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Mon May 29, 2006 6:31 am     Reply with quote

Maybe you can try

Code:
printf("%S","TRY THIS");
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon May 29, 2006 7:03 am     Reply with quote

teekaytk wrote:
code that works
Code:
void main (){

while(1){putc(oxAA)}
}
You are cheating, I do understand your intentions but both your example codes contain compiler errors. From the given example code I don't understand why it isn't working but as this is not your real program code the error might be somewhere else.

Code:
#device *=16//,icd=true
For the PIC18 series this line can be omitted, it will always use 16-bit pointers.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group