View previous topic :: View next topic |
Author |
Message |
TimothyCarter
Joined: 08 Aug 2016 Posts: 22
|
New compiler version 5.100 bug |
Posted: Wed Jan 20, 2021 1:21 pm |
|
|
I got the email and updated CCS to version 5.100 today (January 20, 2021). Now, when I try to compile a project for the 16f1847 it gives "Internal error - Contact CCS PR-CODE at 37/C/36 SCR=2074". I can go back to version 5.099 and it compiles just fine.
The reason for the re-compile is to switch to the low-power version of the PIC; 16F1847 -> 16LF1847 (neither will compile with version 5.100).
I'm not sure if it matters, but the warning seems to be happening after I call the read_adc() function - using the 10-bit ADC. -- at least that's the line that is pointed to when the error occurs. _________________ “Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”
- Eric S. Raymond
Last edited by TimothyCarter on Wed Jan 20, 2021 1:37 pm; edited 1 time in total |
|
|
jeremiah
Joined: 20 Jul 2010 Posts: 1351
|
|
Posted: Wed Jan 20, 2021 1:55 pm |
|
|
I would report this to CCS ( official support is through email at [email protected] ) |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Thu Jan 21, 2021 2:02 am |
|
|
CCS seem to have been 'fiddling' with the ADC handling on the last couple
of versions of compiler. My problems have all been with the ADC's on the
16bit PIC's, so it is interesting to see problems appearing with some of the
newer 8bit PIC's. 5.099, supports the LF chip, so I'd stick with this until
CCS come back to you. As Jeremiah says, you need to report this to
CCS themselves.
However have just tried a really basic 'read the ADC and display it', on
5.100, and it does not complain at the read_adc line. It is possible it is
something like a 'silly' that they have renamed a define and this is causing
a problem with your code.
Does this compile for you?
Code: |
#include <16LF1847.h>
#device ADC=10
#use delay(internal=32000000)
#use RS232(baud=9600, XMIT=PIN_B2, RCV=PIN_B1, ERRORS, STREAM=UART)
void main()
{
int16 adc_sum;
int8 ctr;
int32 voltage;
setup_adc(ADC_CLOCK_DIV_32);
setup_adc_ports(SAN0, VSS_VDD);
set_adc_channel(0);
while(TRUE)
{
adc_sum=0;
for (ctr=0;ctr<8;ctr++)
{
delay_us(5); //Tacq
adc_sum+=read_adc();
}
adc_sum/=8; //generate 8 sample average
voltage=((adc_sum*3300LL)+1617)/1024;
//running on 3.3v generate voltage to display
printf(UART,"%5.3LWV/n/r", voltage);
delay_ms(500);
}
}
|
|
|
|
TimothyCarter
Joined: 08 Aug 2016 Posts: 22
|
|
Posted: Thu Jan 21, 2021 9:27 am |
|
|
Ttelmah, that code does indeed work. I suspect it has nothing to do with the read_adc() function, that's just the line that gets highlighted because it is actually an "Internal Error - Contact CCS" and as such the compiler doesn't know what to show.
It's the exact same code that compiles with 5.099, yet does not with 5.100.
I now have another project where I am getting a "Floating point overflow" error with CCS's included math.h file (in version 5.100, but not in 5.099):
>> Actually the floating point error is an "Info"; I also get a "Internal Error - Contact CCS" when trying to compile for a PIC24fj256gb410.
The line it questions is:
Code: | // Overloaded function exp() for data type - Float64
float64 const pe_64[12] ={9.30741400474913e-011,-4.28655416283316e-011,
8.71486547014137e-009,9.84458531538385e-008,
1.32588296983536e-006,1.52489283823016e-005,
0.000154037598423921,0.00133335487036216,
0.00961812936407326,0.0555041086222122,
0.240226506962827,0.693147180559823}; |
again, this problem goes away with version 5.099: but I get the bug where doesn't work (which is fixed in 5.100). _________________ “Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”
- Eric S. Raymond |
|
|
TimothyCarter
Joined: 08 Aug 2016 Posts: 22
|
|
Posted: Thu Jan 21, 2021 10:24 am |
|
|
Received this reply from CCS:
The problem you reported has been fixed and will be in the
next compiler release.
For both of my issues reported above.
CCS is always quick on the fixes, and so easy to work with. _________________ “Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”
- Eric S. Raymond |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19529
|
|
Posted: Fri Jan 22, 2021 1:32 am |
|
|
and they have actually posted the version overnight. |
|
|
TimothyCarter
Joined: 08 Aug 2016 Posts: 22
|
|
Posted: Fri Jan 22, 2021 10:07 am |
|
|
Yeah, they're super-speedy over there _________________ “Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”
- Eric S. Raymond |
|
|
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
Posted: Fri Jan 22, 2021 12:02 pm |
|
|
Maybe too speedy, sometimes its better to be a little slower but correct at the first time |
|
|
|