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
Hiya man well the answer of Erik's question is that i am measuring the voltage on the port .... IO port man well i know i am dumb but not that much that i cant measure the voltage
Andy ask "Are you sure that the point you're measuring "
you answer "My power supply is"
Now, pleaase answer Andys question, my guess is that that will answer yours.
Erik
Well sir i am measuring it with the Voltmeter and My power supply is of Steady 5v DC ....... and my desired output is of 5v because i am using external Digital Logic Circuit and My external Circuit is only capable to recoganize 1 as 5v DC............. may i know why?
"cuz"
Please, the word is "because".
"my AT89C51 is giving 3v for logical-1"
How are you measuring this?
Are you sure that the point you're measuring is at a constant, steady logic-1?
What is your power supply voltage?
I am using EXPRO-100 for program my AT89C51 and there is UART also in my MCU but the problem lies there cuz my AT89C51 is giving 3v for logical-1 and 0v for logical-0. but as far as my knowledge is working it might be 5v for 1 and 0v for 0. So could any one please tell me whats wrong (well UART is working fine and i am getting the required output from MCU via Hyper terminal)
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 ?
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
why don't you try this type of loop for input.
char InputfromSerial (void) { while(!RI); RI=0; i=SBUF; return i; }
"cursor is not getting any thing from me"
Pardon??
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?
there is a garbage on the Hyper terminal....
that, most often is a result of baud rate mismatch.
Well i know that i cannot communicate MCU without MAX232, and i have little knowledge about the MCUs cuz i have built one AT89C4051 with successful UART . but dont know the problem .. well as its my own created circuit so there might be problem and one thing that where do i send the Schimitics ?
and there is a garbage on the Hyper terminal.... and one more problem is that when ever i give power to my circuit all the LED's connected to my MCu are ON but they might have to be OFF cuz i have programmed them to be OFF until communication over UART ......... ant Garbage is comming when ever u RST the MCU.
if it works in simiulation but not in 'real life' the obvious conclusion is a hardware problem
questions 1) I hope you are not one of those that believe that you can do RS-232 without a MAX232(equivalent)? 2) do you have a scope? 3) does hyperterminal give garbage or nothing when the uC send to it?
View all questions in Keil forum