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 / How to control a PWM signal with counters in 8051

How to control a PWM signal with counters in 8051

|

Microcontroller › 8051 › How to control a PWM signal with counters in 8051

  • This topic has 9 replies, 3 voices, and was last updated 10 years ago by Skylite.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • November 24, 2015 at 10:43 am #4125
    Skylite
    Participant

    Hi,

    How to generate a counter for a PWM signal,

    i.e., I'm getting a PWM output of 10hz frequency,and I have taken another port[for this port I need to use a counter]

    and this port should toggle on/off and this signal I need to control with the generated

    pwm signal by using counter operation.

    For example: if counter is 0 the pwm signal should be HIGH[till it becomes 1].

    Thanks in advance.

    Skylite

     

    November 27, 2015 at 7:22 am #13523
    Ashutosh Bhatt
    Participant

    ur question is confusing

    PWM is generated using timers – inbuilt timers

    why u r using counters for it

    November 27, 2015 at 9:05 am #13525
    rahul
    Participant

    plz explain your problem in detail so we can help you
    :)

    November 28, 2015 at 7:44 am #13529
    Skylite
    Participant

    Yes PWM is generated using timers, and i'm getting the output of it,which i'm generating in different port.

    Now I have taken a seperate I/O port, where i'm getting the signal high and low, now my question is

    how to control this signal for particular count/timer period[say for about maximum 5 to 10 minutes the

    signal should be high and next it should be low]

    Here is the part of the code:

    sbit CLOCK = P2^3;

    unsigned char check = 1;

    void timer1_ISR`(void)

    {

    //timer tick functions

    if(check == 0)

    {

    CLOCK = 0;//getting a low signal

    }

    else

    {

    CLOCK = ! CLOCK;//toggling high& low

    }

    }

    I'm checking this in the isr routine.

    Hope I have not confused, please let me know where i'm going wrong.

     

    November 28, 2015 at 8:42 am #13530
    rahul
    Participant

    do you mean you are getting pwm on say port A continuously now you want this signal on port B say for 5mins…once this 5 mins are over this signal will not be on port B….and by the time on port A this signal will exist continuously. ..
    am I correct?

    November 28, 2015 at 8:48 am #13531
    rahul
    Participant

    for wht duration you have configured timer? ? means how much is time interval of pwm singal is high or low

    November 28, 2015 at 8:50 am #13532
    Skylite
    Participant

    But I'm not generating a PWM signal on portB, just a high and low pulse,

    later i'm using a transistor circuit for switching, now my concentration is only on

    portB to how to hold a signal , not on portA.

    November 28, 2015 at 8:50 am #13533
    rahul
    Participant

    hi can u mail all your code on my id [email protected]

    November 28, 2015 at 8:53 am #13534
    rahul
    Participant

    means initially you want high low pulses in port a later on it will be on port b now fot 5 mins

    November 28, 2015 at 8:54 am #13535
    Skylite
    Participant

    Ok i'll mail complete code.

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

RSS Recent Posts

  • Droplet1 December 14, 2025
  • Bringing a Siemens W-48 and Ericsson Model 1951 back to life December 14, 2025
  • What is involved to convert a small town to fiber optic? December 14, 2025
  • mechanism to shutdown feeding when sensor temperature rises December 13, 2025
  • Oshonsoft MSSP simulation question December 13, 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