i tried to send data, through serial data communication, from one Microcontroller[Atmel 8052 - AT89c52] to another Microcontroller[Atmel 8052 - AT89c52] and back to the source Microcontroller and then display the data on a LCD[16x2]. both the Microcontrollers have 12Mhz crystal and the baud rate is 2,400, and i have calculated the reload value for TH1 in mode 2[auto-reload mode] as, 256-[12E6/(32 x 12 x 2400)]=242.98, which is rounded off to the nearest integer 243. By doing this i am not getting the expected result. the output on the LCD is some junk value[looks v.weird]. what could b the problem???
Upon receipt of its first byte, 1st MCU will begin writing to SBUF without any pacing, sequential values from 0x42 through 0x5A and then loop forever writing to SBUF without any pacing, sequential values 0x41 through 0x5A. That doesn't seem good, does it? As a side note, your code has a distinct look of your trying use C as if it were assembly language. It's probably not a concern in this very constrained case, but I would be asking myself "how do I know the compiler is not using locations 0x30-31 itself? Where is the compiler locating the stack?" In other cases, you should be very concerned about your style of program design.
Thank you Dan, dat probably is the dummest thing i have done in a program till date.
"Thank you Dan, dat probably is the dummest thing i have done in a program till date." I'm glad that I am not the only one who does dumb things now and then. I have to admit that on Friday just last week, I had a moment of weakness worthy of slapping my forehead (or worse having someone else slap it for me)! :-)
"I'm glad that I am not the only one who does dumb things now and then. I have to admit that on Friday just last week, I had a moment of weakness worthy of slapping my forehead (or worse having someone else slap it for me)! :-) " Lol, n now i am glad to know dat i am not the only 1 who dose dum thinks. Thanks any ways Dan. I'll post the entire code of my project, once completed, on this thread. Bye for now.