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

Simulator issue with printf?

While using the simulator, the values of i in the serial window are shifted by left 8 bits.

#include "stdlib.h"
#include "stdio.h"
#include "reg51.h"

void main (void)
{
    unsigned char i;
    SCON  = 0x50;
    TMOD |= 0x20;
    TH1   = 221;
    TR1   = 1;
    TI    = 1;

    for (i = 0; i < 8; i++)
    {
        printf("%x\n", i);
    }
}

Parents
  • I jusr read the thraad (it is Monday morning here) and I see one word in all your posts which is "NOW"

    so, In your opininion, everybody that has a paid job and occsionally visit this forum, should immediately drop what they are doing to earn their pay and for free take care of the fact that you have no idea of even the most basic concepts.

    Ok, here is a suggestion

    post whithout using capitals a short synopsis of what the BCD format is and how YOU propose to code the conversion so we know that you have, at least, done some work yourself and maybe, just maybe someone will forget the way you have behaved so far in this thread.

    Erik

Reply
  • I jusr read the thraad (it is Monday morning here) and I see one word in all your posts which is "NOW"

    so, In your opininion, everybody that has a paid job and occsionally visit this forum, should immediately drop what they are doing to earn their pay and for free take care of the fact that you have no idea of even the most basic concepts.

    Ok, here is a suggestion

    post whithout using capitals a short synopsis of what the BCD format is and how YOU propose to code the conversion so we know that you have, at least, done some work yourself and maybe, just maybe someone will forget the way you have behaved so far in this thread.

    Erik

Children
No data