Compiler bug - PIC32MX250F128B - unsigned integer problem

General discussion on mikroC PRO for PIC32.
Author
Message
mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#16 Post by mtuliomarco » 24 May 2018 13:06

Hello Mikroe !

It is not possible that simple problems will not be solved more quickly.
We see posts from a few years and several new versions have already been released and the problem persists.

:oops: :oops: :oops: :oops:

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#17 Post by filip » 24 May 2018 13:33

Hi,

@ mtuliomarco,
Could you please attach the minimal project that demonstrates this issue ?

Regards,
Filip.

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#18 Post by mtuliomarco » 24 May 2018 16:29

Hi @Filip, Thanks for your reply ! Sorry for my english....

For being a product design, I can't put the whole program. But I'll explain. if I happen to be missing some of it { or } here is why I took only one piece of program code.
I have the same program being used by a DSPIC33ep512MU810 and works perfectly the code. I am trying to migrate from microcontroller because they are pin compatible and easier to find where I live, but I had this problem there.


I have two files as below.

First File.:

unsigned int StartOK=0, UsoOK=0;
...
...

while(!UsoOK)// to be aborted when the timer counts using the StartOK variable and it reaches 59999
{
latd14_bit = 1;
if(StartOK < 60000)
{
StartOK++;
delay_us(90);
}
if(USB_Func !=1) ChecaTouch();
if(USB_Liga !=0)
{
if(HID_Read() !=0) // !HID_Read
{
StartUSB();
if(Flag !=1)
{
ErrorUSB();
for(contx=8; contx<64; contx++) writebuff[contx] = ' ';
while(!HID_Write(&writebuff,64));
}
if(Flag==1)
{
USB_Func = 1;
endgrava = 0x000001;
TelaInic = 0;
lermemo(endgrava, 0, 0, 0, 0x026160, 0); //0x026160
delay_ms(1000);
writebuff[0] = 'O';
writebuff[1] = 'K';
for(contx=2; contx<64; contx++) writebuff[contx] = ' ';
while(!HID_Write(&writebuff,64));
CarregaDadosUSB();
while(!HID_Write(&writebuff,64));
}
}
}
}

Second file.:

extern unsigned int StartOK, UsoOK;
...
...
void Timer1Interrupt() iv IVT_TIMER_1 ilevel 7 ics ICS_SRS
{

if(StartOK >= 59998 && StartOK < 60000) // test all the possible options here -> StartOK > 59998 && StartOK < 60000 or StartOK >= 59998 && StartOK <= 60000
{
UsoOK = 1;
StartOK = 60000;
}
}

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#19 Post by mtuliomarco » 01 Jun 2018 05:25

filip wrote:Hi,

@ mtuliomarco,
Could you please attach the minimal project that demonstrates this issue ?

Regards,
Filip.




waiting.....

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#20 Post by filip » 04 Jun 2018 08:48

Hi,

Can you please attach the project that can be compiled ?
I don't have definition of all variables/functions that you use in your code, which might be essential.

Regards,
Filip.

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#21 Post by mtuliomarco » 05 Jun 2018 02:45

filip wrote:Hi,

Can you please attach the project that can be compiled ?
I don't have definition of all variables/functions that you use in your code, which might be essential.

Regards,
Filip.

Hi,

I sent a private message with the whole project. It can be compiled without problems, but will present the problem I described.

Regards,
Marco Gonzaga

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#22 Post by mtuliomarco » 07 Jun 2018 15:18

filip wrote:Hi,

Can you please attach the project that can be compiled ?
I don't have definition of all variables/functions that you use in your code, which might be essential.

Regards,
Filip.


Hi Filip,

I think the pictures were not sent in the private message and so I'm sending them to you here.
Mikroe1.png
Mikroe1.png (309.48 KiB) Viewed 3430 times
Mikroe2.png
Mikroe2.png (275.71 KiB) Viewed 3430 times
Mikroe3.png
Mikroe3.png (260.55 KiB) Viewed 3430 times

regards

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#23 Post by mtuliomarco » 19 Jun 2018 14:43

Hi @ Filip,

Waiting......

regards,

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#24 Post by filip » 22 Jun 2018 10:45

Hi,

Is it possible to run this without the TFT and Serial Flash ?

Regards,
Filip.

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#25 Post by mtuliomarco » 22 Jun 2018 14:03

filip wrote:Hi,

Is it possible to run this without the TFT and Serial Flash ?

Regards,
Filip.
Hi Filip,

I do not understand why you asked. This program works perfectly on a dspic33ep without any problem. If I just do a check this way (StartOK > 59998) the program works too. But when I use more than one argument (StartOK > 59998 && StartOK < 60000), it does not work here for PIC32 because the DSPIC33 works without problems.

It is not the routines that are in trouble, it is a compiler problem, otherwise the same program would not work in DSPIC.


regards,

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#26 Post by mtuliomarco » 06 Aug 2018 16:48

filip wrote:Hi,

Is it possible to run this without the TFT and Serial Flash ?

Regards,
Filip.

Did you get tested? I need to use this very much and I am still waiting for the solution of voices.

josef2600
Posts: 94
Joined: 01 Jan 2012 03:26

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#27 Post by josef2600 » 08 Nov 2018 11:15

as always, they put the user to work around the bugs ! i think they don't even have or own the source code of their compilers !
they never fix bugs, what ever.
most of this problems is in the optimization of this **** compilers.
they even destroyed visual-tft . i cont work with it any moor. it is so stooped to have only tft screen or code ! how am i suppose to write the code for the screen ? f12 f12 f12 ... .
the only solution for this bugs are to turn off or on the "dynamic link ..." in the output setting of the compiler.
sometimes it works when it is on and add one line and you should turn it off for program to work !!

that is how i get it to work, poorly and burly.

mtuliomarco
Posts: 14
Joined: 30 Nov 2012 21:22

Re: Compiler bug - PIC32MX250F128B - unsigned integer proble

#28 Post by mtuliomarco » 08 Nov 2018 13:28

josef2600 wrote:as always, they put the user to work around the bugs ! i think they don't even have or own the source code of their compilers !
they never fix bugs, what ever.
most of this problems is in the optimization of this **** compilers.
they even destroyed visual-tft . i cont work with it any moor. it is so stooped to have only tft screen or code ! how am i suppose to write the code for the screen ? f12 f12 f12 ... .
the only solution for this bugs are to turn off or on the "dynamic link ..." in the output setting of the compiler.
sometimes it works when it is on and add one line and you should turn it off for program to work !!

that is how i get it to work, poorly and burly.

Thanks for your comment. My dynamic link is off, I'll be calling and making new tests to see if it solves the problem.

Post Reply

Return to “mikroC PRO for PIC32 General”