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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/24/05 09:30
Read: times


 
#99951 - Simulate it!
Responding to: ???'s previous message
Vignesh Prasad said:
Hoping this is a new subject

What do you mean, "hoping?"
Have you checked?

What happens is that, the first byte of 10 byte serial packet never gets stored in packet[0].

How do you know that?
Are you sure that it isn't just getting overwritten? You haven't shown anything that clears RI...

What I suspect is...

Check your suspicion by running it in the Simulator.

byte_no++ instruction gets evaluated in the first run, before the main function is called.

There is no such thing as a "first run, before the main function is called"

Will this happen?

Only if something is very seriously broken!

Any suggestions?

Reduce it to the simplest complete program that demonstrates the problem, and run that in the Simulator.
If you still can't work it out, post that complete program here, and explain what you've discovered.

For some debugging tips, see:
http://cm.bell-labs.com/cm/cs/tpop/debugging.html
(it's written for "computer system" programmers, rather than embedded, but many of the principles apply).




List of 18 messages in thread
TopicAuthorDate
More encounters with Keil C51            01/01/70 00:00      
   Simulate it!            01/01/70 00:00      
      It is not an homework            01/01/70 00:00      
         Proving nothing.            01/01/70 00:00      
         LCD            01/01/70 00:00      
      Simulation Results            01/01/70 00:00      
         Pointless            01/01/70 00:00      
            Got it !!            01/01/70 00:00      
            update            01/01/70 00:00      
   do you set SCON as a byte or bitwise ?            01/01/70 00:00      
   not an answer, but why do you call a fun            01/01/70 00:00      
      I don't C            01/01/70 00:00      
         inline            01/01/70 00:00      
            Compiler Tries            01/01/70 00:00      
            OT: inline, Keil ARM            01/01/70 00:00      
               C99 does specify inline as a keyword.            01/01/70 00:00      
   Review index boundary value            01/01/70 00:00      
      Even More Pointless simulation!            01/01/70 00:00      

Back to Subject List