This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Serial communication

Hi, I use AT89S52 in a project. I send and receive data through TXD, RXD pins to a GSM module for sending SMS to another mobile equipment. I use watchdog facility and the watchdog counter is reset at every 256 counts. My crystal frequency is 11.0592 MHz. It happens once in a while that the uC doesn't respond and remains as if it hangs. Then it has to be RESET again. I doubt whether it happens while serial data reception and sending happens simultaneously. I wrote the program in C using KEIL IDE.
My questions are
1) What are the special precautions to be taken in this case?(sending and receiving simultaneously)
2)why this happens even when the watchdog is active? It will be highly appreciated if anybody can give some guidance.

Parents
  • Assuming Jack Sprat is right (and I tend to believe he is) then your chip could be resetting and failing to start up properly - hence, your program does not get stuck at all during normal operation. It fails, "getting stuck" in the aftermath of a reset or in a failure handler (again, not being a C51 guy I cannot elaborate). Have you ever consider to actually debug this instead of shooting blanks? Ever considered adding a tiny trace buffer to track your program behavior etc.? Your situation is indeed hopeless, and it shall remain so unless you decide to do something to change it.

Reply
  • Assuming Jack Sprat is right (and I tend to believe he is) then your chip could be resetting and failing to start up properly - hence, your program does not get stuck at all during normal operation. It fails, "getting stuck" in the aftermath of a reset or in a failure handler (again, not being a C51 guy I cannot elaborate). Have you ever consider to actually debug this instead of shooting blanks? Ever considered adding a tiny trace buffer to track your program behavior etc.? Your situation is indeed hopeless, and it shall remain so unless you decide to do something to change it.

Children