This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Difference in Output of Simulator and Emulator

Dear All,

I am getting difference in output of Simulator and Emulator on using program Source

#include <reg51.H>
void SerTx(unsigned char);

void main(void)
{

int counter; TMOD = 0x20; TL1=0xFD; TH1 = 0xFD; SCON = 0x50;

TR1 =1; for(counter=0;counter<10;counter++)

{ SerTx('Y'); SerTx('E'); SerTx('S');

}

}

void SerTx(unsigned char x) { SBUF = x; while(!TI); TI=0;

}

In Simulator , it will show only 10 times 'YES' but in when flashed into a Micro - P89V51RD2, it keep on coming repeatedly.

Please explain

Parents
  • 
    #include <reg51.H>
    void SerTx(unsigned char);
    
    void main(void)
    {
    
            int counter;
            TMOD = 0x20;
            TL1=0xFD;
            TH1 = 0xFD;
            SCON = 0x50;
    
            TR1 =1;
            for(counter=0;counter<10;counter++)
            {
                     SerTx('Y');
                     SerTx('E');
                     SerTx('S');
    
    
                    }
    
    }
    
    
            void SerTx(unsigned char x)
            {
               SBUF = x;
                     while(!TI);
                     TI=0;
    
            }
    

    for loop has executed 10 times well in Simulator- It will print on 10 time , But if I flash it.. It keep on printing that message where is it going.

    Something with Bootloader and main thing , I feel

Reply
  • 
    #include <reg51.H>
    void SerTx(unsigned char);
    
    void main(void)
    {
    
            int counter;
            TMOD = 0x20;
            TL1=0xFD;
            TH1 = 0xFD;
            SCON = 0x50;
    
            TR1 =1;
            for(counter=0;counter<10;counter++)
            {
                     SerTx('Y');
                     SerTx('E');
                     SerTx('S');
    
    
                    }
    
    }
    
    
            void SerTx(unsigned char x)
            {
               SBUF = x;
                     while(!TI);
                     TI=0;
    
            }
    

    for loop has executed 10 times well in Simulator- It will print on 10 time , But if I flash it.. It keep on printing that message where is it going.

    Something with Bootloader and main thing , I feel

Children