EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / PWM of servo motor using timer(mode 2) 89C51

PWM of servo motor using timer(mode 2) 89C51

|

Microcontroller › 8051 › PWM of servo motor using timer(mode 2) 89C51

  • This topic has 1 reply, 2 voices, and was last updated 12 years, 4 months ago by AJISH ALFRED.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 18, 2013 at 6:09 pm #2650
    tahira
    Participant

     

    hi all

     

    i need a timer of 1usec,,using  timer mode 2 of  89C51.

    issue is:  execution time of statements making up timer function is exceeding the net value of delay generated by timer,,

     

    here it goes:

    void timer()

    {

    TMOD=0x20;

    TH1=0xFE;

    TR1=1;

    while(TF1==0);

    TF1=0;

    TR1=0;

    }

     

    we cn use 12/36 MhZ clock

     

     

    plz repli

     

     

     

    September 19, 2013 at 5:05 am #10469
    AJISH ALFRED
    Participant

    Hi Tahira,

    You are continuously checking the timer flag inside a function to know whtehr the timer overflows or not, are you?. The better method is to enable the timer interrupt and use the timer ISR.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Variable audio oscillator January 19, 2026
  • Micro mouse January 19, 2026
  • Wien bridge oscillator January 19, 2026
  • Silicon insulated wire January 19, 2026
  • Unable To Get Advertised Op-Amp Slew Rate January 19, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise