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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/21/09 16:03
Read: times


 
#171019 - Neither way fixes anything.
Responding to: ???'s previous message
Kai Klaas said:
Richard said:
I agree that the measure you recommend will mitigate the risk of the code wandering off into the weeds if there's uninitialized code space, but ... after all, it doesn't cost any extra to fill unused code space with NOP's.


With the AT89S52 and ISP programming it is like the following:

Before you can program the flash code memory you must fully erase it, which leaves "FF" everywhere in the code memory. Programming means substituting these "FF" by the code bytes and leaving the unprogrammed bytes to "FF". So, a micro eroneously jumping out of the code range will execute "MOV R7,A" instructions while incrementing the program counter over and over again, until it skips to "00", which is the same as if the micro would undergo a hardware reset.

So, the micro wouldn't endlessly run ill, and it's not needed to fill the unused code space with NOPs either.

Kai Klaas


First of all, this should not happen. Secondly, if it does, it's clear evidence of broken hardware of or broken code.

However, if you fill the unused memory with NOP's, a single-byte instruction, the MCU will ultimately end up at 0x000, which is where it would go on a RESET, and R7 hasn't been altered, though the initialization code might just put it in a different state anyway. Nevertheless, it would be harmless, perhaps either way, aside from the fact that it just might get "lost" again.

I doubt there's a significant advantage in doing either, so your "default" value is probably as effective as the 0x00 (NOP).

RE



List of 77 messages in thread
TopicAuthorDate
a simple 89s52 based led circuit on the breadboard            01/01/70 00:00      
   22uF?            01/01/70 00:00      
      He's probably wondering what GNG is            01/01/70 00:00      
         Yep, I also wonder.... Already edited!            01/01/70 00:00      
      yes my bad, its 22pf not uf            01/01/70 00:00      
         Lots of nice info in datasheets and application notes            01/01/70 00:00      
         your problem identified            01/01/70 00:00      
         Yes...            01/01/70 00:00      
   I see no decoupling            01/01/70 00:00      
   Some hints...            01/01/70 00:00      
   similar problems when i was an infant enthusiast            01/01/70 00:00      
      NO!            01/01/70 00:00      
         a simpler solution            01/01/70 00:00      
            Of course...            01/01/70 00:00      
   Will post results in a week or soo            01/01/70 00:00      
      Maybe it is your program            01/01/70 00:00      
         How would that happen?            01/01/70 00:00      
            wandering into Enchanted Forest            01/01/70 00:00      
               about those test spec's            01/01/70 00:00      
                  Thorough testing? Often an illussion!            01/01/70 00:00      
                     testing is an illusion            01/01/70 00:00      
                        Agreed, with caveats            01/01/70 00:00      
                           Still same problem - no problem seen doesn't prove anything            01/01/70 00:00      
                              I've been saying that for years ...            01/01/70 00:00      
                                 for the umpteenth time            01/01/70 00:00      
                                    You should learn how to spell those words you like            01/01/70 00:00      
                                       I quoted you            01/01/70 00:00      
                                          Yes, but you "tracked down" nothing!            01/01/70 00:00      
                                             I recall the previous occasions ...            01/01/70 00:00      
                                                Focus on the circumstances            01/01/70 00:00      
                                                   'investigation' vs 'reasoning'            01/01/70 00:00      
                                                      Reasoning vs. investigation was popular for millenia            01/01/70 00:00      
                                                         Reasoning            01/01/70 00:00      
                                                            Ptolemy and Eratosthenes...            01/01/70 00:00      
                                                               seek to find game: facts, evidence, philisophy            01/01/70 00:00      
                                                                  Reasoning works fine if you don't omit/ignore the evidence            01/01/70 00:00      
                                 I only do what the manufacturer urged me...            01/01/70 00:00      
                                    Yes, Kai, you did that            01/01/70 00:00      
                                       can't you read            01/01/70 00:00      
                                          That's not what you were complaining about!            01/01/70 00:00      
                                       Please read this document...            01/01/70 00:00      
                                           I read that the first time you mentioned it.            01/01/70 00:00      
                  not perfect and never perfectly debugged            01/01/70 00:00      
                     It's the difference between "good" and "good enough"            01/01/70 00:00      
            Not necessary...            01/01/70 00:00      
               Neither way fixes anything.            01/01/70 00:00      
                  it might not be 'harmless'            01/01/70 00:00      
                     Watchdog should be used for anything semicritical            01/01/70 00:00      
                  Of ourse, illjumping must not happen!!!            01/01/70 00:00      
                     What "depending on"?            01/01/70 00:00      
                        Relax, not you...            01/01/70 00:00      
                           What do you use to "pet" the dog?            01/01/70 00:00      
                              hw timer isr för watchdog kick is dangerous            01/01/70 00:00      
                              Different instructions in different parts of the code!            01/01/70 00:00      
                              why use ALE?            01/01/70 00:00      
                                 Why indeed?!            01/01/70 00:00      
                                    The REAL problem lies in what it tells you.            01/01/70 00:00      
                                       please find just one that ...            01/01/70 00:00      
                                          the typical switcher ripple is too much            01/01/70 00:00      
                                             Have you ever observed            01/01/70 00:00      
                                                ... glad you asked that ...            01/01/70 00:00      
                                                   Only you, Richard            01/01/70 00:00      
                                                      that's not what you were asked, Erik!            01/01/70 00:00      
                                                         Nothing much            01/01/70 00:00      
                                                            We can let others conclude what they will            01/01/70 00:00      
                                 because ...            01/01/70 00:00      
                                 It's what the mfg tells us to use ...            01/01/70 00:00      
   Problem solved!            01/01/70 00:00      
      correction            01/01/70 00:00      
      Driving car with closed eyes...            01/01/70 00:00      
         sleep driving            01/01/70 00:00      
            Of course!!!            01/01/70 00:00      
      thanks for WHAT            01/01/70 00:00      
      No ... You only THINK it has been solved.            01/01/70 00:00      
         question for wire wrapping and some clarification            01/01/70 00:00      
            Rectangular pins that cuts into the wire            01/01/70 00:00      
            If you were to adopt this technique ...            01/01/70 00:00      

Back to Subject List