??? 07/09/08 12:36 Read: times |
#156553 - Simulator Responding to: ???'s previous message |
Chris, you're an excitable boy arent't you! As for your code problem, for all intents an purposes, there's nothing specific you need to do for an array - the compiler should take care of all that. So weird shit is happening. All of us have given you good advice, whether you think its applicable or not is the price you pay for 'free' advice. As others have mentioned, we haven't seen your code, so at best we can just guess. It could be:
1/dodgy code - code that is doing what you told it but not what you want. 2/something else using register banks and trashing your array. Look at the code that was generated by Codearchitect - I've not used this so I have no idea of what it generates. Sorry to say, a read of the Codearchitect manual might enlighten you here. There's some people here that have used codearchitect, so they might be able to help as well. There's also the compiler config to mix in with the problem. You also might have a combination of problems. So what might seem a very simple problem to you might have a myriad of causes - so there is no simple answer to your problem until we have the full picture. If it was me, I'd be loading the code up in the simulator and single stepping until it goes wrong. At that point, you should have a fair idea of the cause. Just the other day I was debugging a new board using a new micro and the uart wouldn't work but the code I used was cut & pasted from known good code. After a few hours of fiddling and running the simulator, I found the uart was being disabled - somehow a '~' disappeared. Fixed that and all was well. That was a fairly simple problem. Then I had a handful of pointer related problems that came to light in the simulator. |
Topic | Author | Date |
Data Array getting corrupted after init | 01/01/70 00:00 | |
OnePossibleIdea.... | 01/01/70 00:00 | |
I did not do anything with the stack | 01/01/70 00:00 | |
As Michael said.... | 01/01/70 00:00 | |
How do you test and debug code? | 01/01/70 00:00 | |
Keil is the only thing in place | 01/01/70 00:00 | |
'crap'?? | 01/01/70 00:00 | |
Is this the book you refer? | 01/01/70 00:00 | |
nope | 01/01/70 00:00 | |
Erik | 01/01/70 00:00 | |
So where is the code | 01/01/70 00:00 | |
do NOT "put them" | 01/01/70 00:00 | |
Focus | 01/01/70 00:00 | |
Simulator | 01/01/70 00:00 | |
So this is on a simulator? | 01/01/70 00:00 | |
Post your duff code | 01/01/70 00:00 | |
Finding Cause of Corruption | 01/01/70 00:00 | |
Get the C right, then look at the target CPU | 01/01/70 00:00 | |
Optimizing Compilers | 01/01/70 00:00 | |
In my experience..... | 01/01/70 00:00 | |
Keil C 51 Optimizations | 01/01/70 00:00 | |
Use IAR then | 01/01/70 00:00 | |
different approaches | 01/01/70 00:00 | |
sometimes, depends | 01/01/70 00:00 | |
Thanks![]() | 01/01/70 00:00 |