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

configuring timer 2

i wanted to configure timer 2 of at89c51ed2
can any one give code to do so and and tell how to obtain a specific frequency.

Parents
  • "code calculetes number for th1 (sic) and tl2"

    Here is the code that you posted, then:

    int getBAUDSPEED( float SPEED)
    {
      float t, q;                 // variebles
      t = 1 / ( CLOCK / SPEED );  // sum it clock divided by speed
      t = t * 100 + 27;           // add magic amunt
      q = t * SPEED;              // change to variable
      return t + q / 113;         // return the asnwer
    }
    

    Is see no mention of either TH2 or TL2 in that!!

    It is, therefore, irrelevant!

    "i not help you any more!"

    That's a relief!

Reply
  • "code calculetes number for th1 (sic) and tl2"

    Here is the code that you posted, then:

    int getBAUDSPEED( float SPEED)
    {
      float t, q;                 // variebles
      t = 1 / ( CLOCK / SPEED );  // sum it clock divided by speed
      t = t * 100 + 27;           // add magic amunt
      q = t * SPEED;              // change to variable
      return t + q / 113;         // return the asnwer
    }
    

    Is see no mention of either TH2 or TL2 in that!!

    It is, therefore, irrelevant!

    "i not help you any more!"

    That's a relief!

Children