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

UART of AT89C51 is not working ?

I am using Keil uv2 to program my AT89C51 and although the UART is working just fine in Simulation but in real circuit its not working i donno why .... cuz there are just ASCII code in the Hyper term but it was suppose to be "Hello to MCU " so could any one plese help me ..... any help is appreciable well my id is sirfrajput@hotmail.com

Parents
  • well i have found the problem that was on MAX232 cuz its groung was not properly connected....

    but there is one more problem that scanf is not working this is what i have written in keil

    SCON  = 0x50;
    TMOD |= 0x20;
    TH1   = 0xf3;
    TR1   = 1;
    TI    = 1;
    
    printf("Enter the Meter no ");
    printf("and Shut down command\n ");
    printf("meter: ");
    scanf("%d",&i);
    
    
    

    well on Hyperterminal all the printf words are shown but dont know why the scanf is not working cuz cursor is not getting any thing from me... why?

Reply
  • well i have found the problem that was on MAX232 cuz its groung was not properly connected....

    but there is one more problem that scanf is not working this is what i have written in keil

    SCON  = 0x50;
    TMOD |= 0x20;
    TH1   = 0xf3;
    TR1   = 1;
    TI    = 1;
    
    printf("Enter the Meter no ");
    printf("and Shut down command\n ");
    printf("meter: ");
    scanf("%d",&i);
    
    
    

    well on Hyperterminal all the printf words are shown but dont know why the scanf is not working cuz cursor is not getting any thing from me... why?

Children