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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Andy Neil
08/24/05 03:30
Read: 613 times

#99951 - Simulate it!
Responding to: Vignesh Prasad'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:
(it's written for "computer system" programmers, rather than embedded, but many of the principles apply).

List of 18 messages in thread
More encounters with Keil C51      Vignesh Prasad      08/23/05 23:28      
   Simulate it!      Andy Neil      08/24/05 03:30      
      It is not an homework      Vignesh Prasad      08/24/05 06:07      
         Proving nothing.      Andy Neil      08/24/05 07:01      
         LCD      Andy Neil      08/24/05 07:10      
      Simulation Results      Vignesh Prasad      08/24/05 08:32      
         Pointless      Andy Neil      08/24/05 10:52      
            Got it !!      Vignesh Prasad      08/24/05 13:02      
            update      Andy Neil      08/26/05 05:43      
   do you set SCON as a byte or bitwise ?      Erik Malund      08/24/05 06:37      
   not an answer, but why do you call a fun      Erik Malund      08/24/05 07:18      
      I don't C      Jan Waclawek      08/24/05 08:06      
         inline      Andy Neil      08/24/05 08:26      
            Compiler Tries      Abhishek Singh      08/25/05 21:59      
            OT: inline, Keil ARM      Andy Neil      09/06/05 07:18      
               C99 does specify inline as a keyword.      Maarten Brock      09/06/05 10:38      
   Review index boundary value      Tsuneo Chinzei      08/26/05 02:31      
      Even More Pointless simulation!      Andy Neil      08/26/05 05:40      

Back to Subject List