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

MCU Timing not responding!

The 8051 micro-controller(P89V51RD2FN) that I have been using is configured on a 11.0592 Mhz crystal. But the delays do not respond as per programmed. The programs are perfectly written and there is no issue in the code. Is my controller faulty? How to check that? Please provide some troubleshoot tips and tricks. Thank you very much.

Parents
  • I thought I'd make his code even more perfect.

    Faulty controller or faulty programmer?

    I know which one I would say.

    #include <REGX51.H>
    
    void wait (void)
    {
      ;
    }
    
    void main (void)
    {
      unsigned int i; /* Delay var */
      unsigned char j; /* LED var */
    
      while (1)
      { /* Loop forever */
        for (j=0x01; j< 0x80; j<<=1)
        { /* Blink LED 0, 1, 2, 3, 4, 5, 6 */
          P3 = j; /* Output to LED Port */
          for (i = 0; i < 30000; i++)
          { /* Delay for 10000 Counts */
            wait (); /* call wait function */
          }
        }
    
        for (j=0x80; j> 0x01; j>>=1)
        { /* Blink LED 6, 5, 4, 3, 2, 1 */
          P3 = j; /* Output to LED Port */
          for (i = 0; i < 10000; i++)
          { /* Delay for 10000 Counts */
            wait (); /* call wait function */
          }
        }
      }
    }
    
    
    

Reply
  • I thought I'd make his code even more perfect.

    Faulty controller or faulty programmer?

    I know which one I would say.

    #include <REGX51.H>
    
    void wait (void)
    {
      ;
    }
    
    void main (void)
    {
      unsigned int i; /* Delay var */
      unsigned char j; /* LED var */
    
      while (1)
      { /* Loop forever */
        for (j=0x01; j< 0x80; j<<=1)
        { /* Blink LED 0, 1, 2, 3, 4, 5, 6 */
          P3 = j; /* Output to LED Port */
          for (i = 0; i < 30000; i++)
          { /* Delay for 10000 Counts */
            wait (); /* call wait function */
          }
        }
    
        for (j=0x80; j> 0x01; j>>=1)
        { /* Blink LED 6, 5, 4, 3, 2, 1 */
          P3 = j; /* Output to LED Port */
          for (i = 0; i < 10000; i++)
          { /* Delay for 10000 Counts */
            wait (); /* call wait function */
          }
        }
      }
    }
    
    
    

Children
No data