View previous topic :: View next topic |
Author |
Message |
vu2iti
Joined: 02 Sep 2006 Posts: 4
|
Printf problem |
Posted: Mon Dec 05, 2011 5:50 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9171 Location: Greensville,Ontario
|
|
Posted: Mon Dec 05, 2011 6:07 am |
|
|
Which PIC are you testing on ?
PIC16F877 and PIC18F4550 work fine under v4.114 for me. |
|
![](templates/subSilver/images/spacer.gif) |
labviewman
Joined: 05 Dec 2011 Posts: 11
|
|
Posted: Mon Dec 05, 2011 9:19 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Dec 05, 2011 5:15 pm |
|
|
Neither one of you posted your PIC, so there is no way for us (forum
members) to verify your problem. |
|
![](templates/subSilver/images/spacer.gif) |
labviewman
Joined: 05 Dec 2011 Posts: 11
|
|
Posted: Mon Dec 05, 2011 8:48 pm |
|
|
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?? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Dec 06, 2011 4:44 pm |
|
|
Quote: |
Neither one of you posted your PIC, so there is no way for us
(forum members) to verify your problem.
|
|
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Tue Dec 06, 2011 5:21 pm |
|
|
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!!!! |
|
![](templates/subSilver/images/spacer.gif) |
starter
Joined: 14 Dec 2011 Posts: 3
|
|
Posted: Wed Dec 14, 2011 4:17 pm |
|
|
printf(usb_cdc_putc, "%lu", value); //if through usb
printf(lcd_putc, "%lu",value);//if in LCD |
|
![](templates/subSilver/images/spacer.gif) |
|