sudden reset?

General discussion on mikroPascal for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Skydec
Posts: 39
Joined: 30 Jan 2009 12:38

sudden reset?

#1 Post by Skydec » 18 Mar 2009 08:37

I have written some programs to run on a 24HJ128GP502 micro controller it does alot with the both build in uarts.

It's pretty static, it needs to process once per second a block of data wich is always the same.
But when I run it for a long time I always get some strange character errors it looks like the controller resets once in a while

Anybody has a suggestion?

btw: there is no watchdog or clock fail protection activated.
The problems happen once in an couple of hours, but never the same time

goran.marinkovic
mikroElektronika team
Posts: 265
Joined: 25 Nov 2008 09:09

#2 Post by goran.marinkovic » 20 Mar 2009 11:55

Hi,

Please can you tell me did you try our examples with your MCU?
Does they work?

Regards

Skydec
Posts: 39
Joined: 30 Jan 2009 12:38

#3 Post by Skydec » 25 Mar 2009 21:59

Yeah I did.

I think I found out why there are sudden resets.

I suppose the compiler doesn't do range checking, when you try to write a character to a string outside the declaration, the compiler will write in a piece of mem outside the declaration wich will result in strange behaviour.

Is there a way to let the compiler do range checking?

goran.marinkovic
mikroElektronika team
Posts: 265
Joined: 25 Nov 2008 09:09

#4 Post by goran.marinkovic » 31 Mar 2009 14:27

Hi,

The compiler will do range checking if you are accessing an array with constant indexes.
However, if you do access an array with a variable index (which is often the case), there is no way that the compiler will know if the value of the variable index goes out of bounds. You have to write the program in such way that it never happens that the array index goes out of bounds.

Regards

Post Reply

Return to “mikroPascal for dsPIC30/33 and PIC24 General”