Can any one tell me how to get serial communication from 8051 with pc. i m reallly confused. i have tried my best but no characters appeared on my hyper terminal
i have written serial comm. code in assembly from different books but none worked. can any one plz help me?
Please post your code.
#include "maxim.h"
That's not even the start of a program!
#include "maxim.h" // include the header file maxim.h
main() { set_up_serial_channel(); // set up serial channel
while ( 1 != 2 ) // do it forever { if (1 == recieve_serial_message()) // message received transmit_sreial_response() // send response } }
have you forgotten how to use the 'pre' and '/pre' tags so soon?
and what is the point of commenting 'include the header file maxim.h' next to '#include "maxim.h"' ?? It adds absolutely no value whatsoever!
dou you think the comment is wrong? i dont think it makes the program fail bcoz they are both same. eg maxim.h
"dou you think the comment is wrong?"
It's not wrong - it's just entirely pointless!
If you are going to comment that line, then your comment should provide some information on why you are inlcuding that file at that point; eg, what does it contain?
The usual idiom for an infinite loop is either:
for( ;; )
or:
while( 1 )
The last time I checked, Keil C51 generated exactly the same code for each!
doy ou think the loop is wrong? does make error?
No! Andy just pointed out that the usual style for such a loop is different from your style. But back to your original problem: Did you check the setting for the include path?
wher edo i check include? i can not find file on my pc! is it missing?
What means did you use to search for it?
"is it missing?"
If you've searched thoroughly and not found it then, of course, it must be missing!
have you got the file?
can you give me it?
The chances that I might have any file called "maxim.h" are fair - but the chances that it's the particular file that you need are minimal!
You need to go back to the source where you originally obtained this code...
Better still, perhaps you should go back to basics and start here, so that you actually understand what you're doing: http://www.keil.com/support/man/docs/uv3/uv3_ex_hello.htm
http://www.keil.com/support/man/docs/uv3/uv3_examples.htm