View previous topic :: View next topic |
Author |
Message |
mslomp
Joined: 10 Oct 2003 Posts: 1
|
Problems whit 18F452 |
Posted: Fri Oct 10, 2003 4:21 pm |
|
|
Hello,
I have a problem with a tested routine, when the code grows the problem change place?
I´ve change the microcontroller and the problem still happens
What can I do? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Fri Oct 10, 2003 7:26 pm |
|
|
Post the code that is giving you problems and describe what the problems are. No magic 8 balls here |
|
|
sheldona
Joined: 15 Oct 2003 Posts: 1
|
Re: Problems whit 18F452 |
Posted: Wed Oct 15, 2003 6:10 am |
|
|
I have similar problems with the 18F452. When I resize global arrays, particularly, this problems arises. for example, I'll change a byte array size from 32 to 16 and the code just doesn't run. Not even start up code gets run properly, before the array is accessed.
Its quite frustrating, and there seems to be no rhyme or reason to it. A bit of "black magic" is required to get my code running correctly on the 18F452, resizing arrays, removing calls to certain functions, etc... all in an attempt to get the compiler to arrange the generated code properly. (I've looked at the generated asm code for good vs. bad programs and at a very general level, this seems to be the problem. Its hard to follow, but it looks during/after branches and jumps, the program goes to the incorrect location in memory).
Anyone else having this problem, and have a solution? I posted about this over a month ago and received a response along the lines of: "this is a bug in the compiler".
Cheers.
Sheldon |
|
|
TSchultz
Joined: 08 Sep 2003 Posts: 66 Location: Toronto, Canada
|
|
Posted: Wed Oct 15, 2003 8:27 am |
|
|
I am still using PCWH version 3.142 since my 30 days upgrades expired before 3.148 was released. However I ran into quite a few problems with PCH and the use of arrays and arrays or structures.
I found that the compiler was re-using some of the memory locations reserved for the arrays with other variables. My solution was to reserve a large section of memory and then manually assign thier locations (and lose one of the nice features of the compiler). I also found problems at times if an array crossed the first page boudary (0xFF).
These problems were not predictable and tend to change with each compile and especially if you make any changes to the array sizes. This may or may not be your problem but I would suggest you carefully review the assigned locations for all variables after compile. |
|
|
|