Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/23/11 04:26
Read: times


 
#182332 - Now seems like....
Responding to: ???'s previous message
It now seems like you may have some type of coding corruption going on with your code.

Can you share just what part you are using and the tool set used to build the code?

You may be getting the interrupt code executing at unexpected times due to some type of stack corruption, screwed up function pointer or improperly overlaid local RAM variables that are managed by the compiler and linker.

I can say with first hand experience that even with the excellent Keil C51 tool set I have had numerous problems with variables getting corrupted when I write code with too many levels of calls that use more than one or two calling arguments and/or a bunch of locally declared variables. The code tries to execute but the entry 2nd or 3rd level call corrupts expected values of arguments/variables in the 1st or 2nd level call. This gets way worse when the corruption happens to variables that are function pointers. This can make the code vector off in very strange ways. I've found that the most reliable fixes for these issues is to use a lot more globally declared variables (especially function pointers) and reduce or eliminate excess function call arguments.

Bottom line when writing code in C for '51s seems to use simple code structures instead of elegant and complex methods that work wonderfully on other MCU platforms.

Michael Karas


List of 13 messages in thread
TopicAuthorDate
PCA 8051 issue            01/01/70 00:00      
   CCF4 Bit            01/01/70 00:00      
      CCF4 bit            01/01/70 00:00      
         run_mode??            01/01/70 00:00      
            interrupt vectors            01/01/70 00:00      
               interrupt vectors            01/01/70 00:00      
            run_mode            01/01/70 00:00      
   Now seems like....            01/01/70 00:00      
      Goes for all languages/platforms            01/01/70 00:00      
      my code            01/01/70 00:00      
         No....            01/01/70 00:00      
   just a thought            01/01/70 00:00      
   Another Thought...            01/01/70 00:00      

Back to Subject List