We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
there is a garbage on the Hyper terminal....
that, most often is a result of baud rate mismatch.
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?
"cursor is not getting any thing from me"
Pardon??
why don't you try this type of loop for input.
char InputfromSerial (void) { while(!RI); RI=0; i=SBUF; return i; }
why don't you try this type of loop for input. and make everything come to a screeching halt when no input arrives.
see a psychriatist aboy your interruptifobia
Erik
Well the problem is solved cuz it was error in connection (Well cuz i am dumb) when i have set the flow control to none it worked like dream ............ but could any one tell me that why My mcu is giving the output 1 as 3 volt-dc but i think it might suppose to be be 1 for 5 volt-dc ?