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
  • Do you understand why it was a bad idea to have it in a timer ISR in the first place?

    If you haven't fully grasped that yet, then you (probably) haven't fully understood the requirements for using a watchdog effectively!

    Perhaps you could give a detailed explanation of why you think it's a bad idea - then people may be able to spot if there's anything you're missing..

    "...to the main program and did the update frequently"

    So what, exactly, do you mean by "frequently" here?

    "my program got stuck after two days of actual use"

    So you still haven't got the watchdog right yet!

    Again, the two possibilities are:

    1. The watchdog is somehow getting disabled;

    2. Your watchdog update scheme is flawed so that it can keep the watchdog running despite the program being stuck in a loop!

Reply
  • Do you understand why it was a bad idea to have it in a timer ISR in the first place?

    If you haven't fully grasped that yet, then you (probably) haven't fully understood the requirements for using a watchdog effectively!

    Perhaps you could give a detailed explanation of why you think it's a bad idea - then people may be able to spot if there's anything you're missing..

    "...to the main program and did the update frequently"

    So what, exactly, do you mean by "frequently" here?

    "my program got stuck after two days of actual use"

    So you still haven't got the watchdog right yet!

    Again, the two possibilities are:

    1. The watchdog is somehow getting disabled;

    2. Your watchdog update scheme is flawed so that it can keep the watchdog running despite the program being stuck in a loop!

Children