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 problem

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



Joined: 02 Sep 2006
Posts: 4

View user's profile Send private message Yahoo Messenger

Printf problem
PostPosted: Mon Dec 05, 2011 5:50 am     Reply with quote

I have recently updated my CCS compiler to version 4.127. Now I have a strange problem. My printf is not working for texts. Variables are sent through the serial port but text messages are not at all printed.
For example,
the Statement : printf("THE ADC VALUE IS %u",adval); will only print the value of the variable, not the text.

This printf statement is working fine with versions 4.094 or lower.
Please help.
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 6:07 am     Reply with quote

Which PIC are you testing on ?
PIC16F877 and PIC18F4550 work fine under v4.114 for me.
labviewman



Joined: 05 Dec 2011
Posts: 11

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 9:19 am     Reply with quote

I had the same problem...printf code that worked fine in 4.125 didn't in 4.127 (didn't like %lX but was OK with %ld). I reverted back to 4.125
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 5:15 pm     Reply with quote

Neither one of you posted your PIC, so there is no way for us (forum
members) to verify your problem.
labviewman



Joined: 05 Dec 2011
Posts: 11

View user's profile Send private message

PostPosted: Mon Dec 05, 2011 8:48 pm     Reply with quote

Pretty simple:

int16 data;

Printf("%lx\r",data);

There were other issues with 4.127 which caused me to burn an entire day (Sunday) trying to make my code work with 4.127 which worked fine the previous night with 4.125.

The following Monday, I talked to tech support who sent me 4.125 (I had done the update, not download, which I will never again), and the broken parts of the code worked again.

We use CCS at my day job (yes, I bought my own license for home) where the engineers regularly keep older versions of the compiler just in case an update breaks their code. Unfortunately, the updates frequently caused problems. Yes, every compiler has problems, but wow, breaking printf??
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Dec 06, 2011 4:44 pm     Reply with quote

Quote:

Neither one of you posted your PIC, so there is no way for us
(forum members) to verify your problem.
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Dec 06, 2011 5:21 pm     Reply with quote

The problem does not seem to exist in 4.128 with the 18F4685.
I just recompiled a program originally built with 4.114 using 4.128 and
there are no problems.
_________________
Google and Forum Search are some of your best tools!!!!
starter



Joined: 14 Dec 2011
Posts: 3

View user's profile Send private message

PostPosted: Wed Dec 14, 2011 4:17 pm     Reply with quote

printf(usb_cdc_putc, "%lu", value); //if through usb
printf(lcd_putc, "%lu",value);//if in LCD
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