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 11 years, 9 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

  • Help with finding unique wire lug(s) June 21, 2025
  • Simple LED Analog Clock Idea June 21, 2025
  • Kawai KDP 80 Electronic Piano Dead June 21, 2025
  • Saga 1400sv vinyl cutter motherboard issue June 21, 2025
  • using a RTC in SF basic June 20, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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