The strange behavior of the compiler MB for PIC32

General discussion on mikroBasic PRO for PIC32.
Post Reply
Author
Message
montana_rus
Posts: 3
Joined: 14 Oct 2015 05:50

The strange behavior of the compiler MB for PIC32

#1 Post by montana_rus » 14 Oct 2015 06:13

Good day !

Some days ago I detected the strange behavior of the compiler MikroBasik PIC32. I thought that is accident. But the problem shown more often. Problem is next:
First, the program after compiling for PIC32MX795 worked correct. Then it was need for some changes... For example, it was code:
.....
UART1_WRITE_TEXT ("Press any key")
i=i+1
.....
After addition a code for a view:
.....
UART1_WRITE_TEXT ("Press any key")
UART_WRITE_TEXT ("and work will done !") ' <---- this line
i=i+1
.....
in the working process of program body the strange take place: failure datas, incorrect rinning routines and more-more... This strange is shown also if change places two routines (procedure of functions) just. The compiler not gives error, it's OK, but really the program behaves unpredictably.
Please , need answer abour specific for PIC32 MikroBasik Compiler: is need any requirements for a lenght of routines (procedure, functions).

Thanks
Best regards,
Aleksey

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: The strange behavior of the compiler MB for PIC32

#2 Post by biljana.nedeljkovic » 15 Oct 2015 08:37

Hello,

since this is the same topic, I had answered you to the other one, so we can continue the conversation there:
http://www.mikroe.com/forum/viewtopic.php?f=168&t=65857

Best regards,
Biljana

montana_rus
Posts: 3
Joined: 14 Oct 2015 05:50

Re: The strange behavior of the compiler MB for PIC32

#3 Post by montana_rus » 15 Oct 2015 08:52

Yes, it's the same post. Information was updated so long...

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: The strange behavior of the compiler MB for PIC32

#4 Post by Dany » 15 Oct 2015 18:15

montana_rus wrote:Good day !

Some days ago I detected the strange behavior of the compiler MikroBasik PIC32. I thought that is accident. But the problem shown more often. Problem is next:
First, the program after compiling for PIC32MX795 worked correct. Then it was need for some changes... For example, it was code:
.....
UART1_WRITE_TEXT ("Press any key")
i=i+1
.....
After addition a code for a view:
.....
UART1_WRITE_TEXT ("Press any key")
UART_WRITE_TEXT ("and work will done !") ' <---- this line
i=i+1
.....
in the working process of program body the strange take place: failure datas, incorrect rinning routines and more-more... This strange is shown also if change places two routines (procedure of functions) just. The compiler not gives error, it's OK, but really the program behaves unpredictably.
Please , need answer abour specific for PIC32 MikroBasik Compiler: is need any requirements for a lenght of routines (procedure, functions).

Thanks
Best regards,
Aleksey
Hi Aleksey,
Before using Uart_... (so without number x) one must select the uart to do the action on. This is done with UART_Set_Active. See the compiler help for details.

Remark1: After a Uartx_Init (or Uartx_Init_Advanced) (with the uart number x) a Uart_Set_Active is done implicitely to the Uartx initialised. This means that, if you e.g. only initialise and use Uart1, you do not need to do Uart_Set_Active.

Remark2: when using Uart_... routines will link all uartx routines to your code next to the code of Uart_... you use.

So, perhaps you need to do a Uart_Set_Active ?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: The strange behavior of the compiler MB for PIC32

#5 Post by biljana.nedeljkovic » 16 Oct 2015 14:32

Hello Aleksey,

can you explain your project here? Use only one topic please.

There seems to be some issue with the tickets you are sending?

Dany has a good advice in case you didn't use that function. But it would be great if you could attach the whole project just to avoid the assumptions.

Kind regards,
Biljana

Post Reply

Return to “mikroBasic PRO for PIC32 General”