Microcontroller › 8051 › How to interface computer’s Serial Port (RS232) with 8051 microcontroller (AT89C51) Error.,, Help !!
- This topic has 19 replies, 6 voices, and was last updated 9 years, 5 months ago by Sanket shedge.
-
AuthorPosts
-
June 24, 2012 at 9:18 am #4776MikelParticipant
Hello, I am using a 8051 Microcontroller development board in which has a 40 Pin P89V51RD2 Microcontroller in it , 4 LEDs connected to its Port 1 , and 4 switches connected to Potr0.
I saw the program “How to interface computer’s Serial Port (RS232) with 8051 microcontroller (AT89C51) ” in this website, and I burnt the hex file of the above program to my MC. The program worked right with Hyper Terminal Software, but the problem is now I cant erase or re-program my Microcontroller with another program. i.e When I try to burn an another program’s hex file, the MC is not responding properly. It throws me an error message as “Unable connect”, or “Unable recieve/Send” or sometimes “failled to read device signature”. Everytime I tried to burn a new hex file only the 4 LEDs turns On/Off , Even if press the Reset Key nothing happens. I tried lot of ways , but I am not able burn a new hex file.
Please someone help me with this problem. The image of the Dev board I am using is below:
<I am using “Keil u-Vision” for programming, and “Flash Magic” to burn the hex file.>
June 25, 2012 at 2:46 pm #8122AmrithParticipantHi mikel,
I faced the same issue once. Here is the solution
1. Power up the board & press RESET switch for 30 seconds & release it.
2.Now try to program your controller.
3. If you find the same problem then see the oscillator value in the tools setting, the value shouls match external oscillator value used.
Kindly let me know which tool are you using for dumping the hex file in controller. Furthe quries please share.
June 26, 2012 at 8:05 am #8130MikelParticipantThanks Amrith for your suggestions, but I had tried it earlier it didn’t work. I found out the solution for this problm i.e :
1. Switch OFF the MC kit , connect it to the PC with serial cable .
2. (I am using “Flash magic” software to burn/dump hex file). Run the Flash magic software and Press start button to start burning the hex file.
3.When the software asks for “Reset the Device into ISP mode” , just Switch ON the MC kit.
4. This will flash/re-program the Mc kit , and Mc will start to work again normally.
And 1 more thing is that I had made some adjustments in the Flash magic Soft i.e : in Options – Advanced Options- Misc- I had tick marked “Disable signature Checking” and “Erase all Flash using Pages” buttons. I un-marked them after my Mc started working properly.
June 27, 2012 at 3:08 pm #8134AmrithParticipantHi Mikel,
Thanks for the description of the solution. This may help others, really appreciate your work.
July 31, 2012 at 2:24 am #8370Lui Yat MingParticipantI also saw the program “How to interface computer’s Serial Port (RS232) with 8051 microcontroller (AT89C51) ” in this website, and IIIiIIIIIIIII
I use the Keil C emulator to run the C progran on 8051 board which is connecting to PC through UC232A ( a device of rs232 (9 pin device) to USB (insert to PC)).
When I type the Keyboard on PC, There is no any ‘char’ shown on the Hyperterminal.
But I change the program which is download from http://www.keil.com/forum/933 , I can see the result on Hyperterminal.
By the way , I am not fully understand some sentance in C program such as P1=value & P2=P1-32 for what function and I could not see P1 & P2 port connection in the circuit.
Thanks for help!
July 31, 2012 at 2:54 am #8371Lui Yat MingParticipantI also saw the program “How to interface computer’s Serial Port (RS232) with 8051 microcontroller (AT89C51) ” in this website. But I try this experiment as follows: but I am fail.
I use a Keil C emulator to run the C prohram mentioned in about paper on 8051 board which is connected to PC through a device UC232A ( RS232 to UAB cable). when I type the Keyboard of PC, there is nothing to see on Hyperterminal.
I change the C peogram which dowdload from http://www.keil.com/forum/933 and run the program. I got the result as expectation.
Also I do not understand that some sentance such as P1=value and P2=P1-32 in C code.
Please help !
YM Lui
July 31, 2012 at 3:11 am #8372Lui Yat MingParticipantDear Mr.Amrith,
I have some questions on your paper, But I can not reach you by this website. my email address: [email protected]. if available, Please contact me.
Thanks
YM Lui
August 9, 2012 at 2:37 am #8423Lui Yat MingParticipantDear Mr.Amrith,
I have some questions on your paper, But I can not reach you by this website. my email address: [email protected]. if available, Please contact me.
Thanks
YM Lui
August 10, 2012 at 6:01 am #8425AmrithParticipantHi YM Lui,
Sorry for any inconvenience caused. I was on holiday for some time.
Kindly post your quries, i will try to solve your doubts & issues.
August 10, 2012 at 9:45 am #8435Lui Yat MingParticipantThanks for your reply first!
My problem has describled in reply many replies and write down my email address to you. [email protected].
Please check Forum.
August 11, 2012 at 2:22 am #8442Lui Yat MingParticipantHi Amrith,
Please see the Forum dated on 31/07/2012 & 01/08/2012. I have written my questions.
by the way , you may contact me by email: [email protected]
August 13, 2012 at 5:30 am #8447AmrithParticipantHi Lui..
when you use any microcontroller there should be an proper C or assembly code to run it. Without C code you cannot generate your output.kindly refer “The 8051 Microcontroller And Embedded Systems Using Assembly And C” for learning C codes.
August 14, 2012 at 7:59 am #8456Lui Yat MingParticipantHi Amrith,
Thanks for your reply. My problem is follow your setting on Hypertermial, then you do not to run any program, you could see what your type char on PC display.
Also I do not understand that some sentance such as P1=value and P2=P1-32 in C code.
August 14, 2012 at 12:42 pm #8457AmrithParticipantHi Lui,
Follow below steps to get characters on hyperterminalwhen you type from key board
1. After selecting com port your are using & set the baudrate value to 9600(as mentioned in code), set the flow contolas none.
2. Go to file–> click on properties
wysiwyg_imageupload:5762:height=378,width=586
Step2:
wysiwyg_imageupload:5764:height=359,width=585
Step 3:
wysiwyg_imageupload:5765:height=356,width=582Select the tabs as ashow and click OK
August 14, 2012 at 12:43 pm #8458AmrithParticipantKindly share the link of the C code your are using.
-
AuthorPosts
- You must be logged in to reply to this topic.