Creating pulses at output port of PIC

Discussion in 'Embedded Systems and Microcontrollers' started by RG23, Feb 1, 2011.

  1. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    I am using PIC 16f887

    I have a timer of 50 ms

    Using that timer I want to create a pulse at the output port

    The pulse should be 100 ms on then 100 ms off and then 500 ms off.

    If anyone has an idea please let me know

    Thank you
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
  3. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    I want to create that pulse which is 100 ms ON and 500 ms off using the timer of 50 ms only

    please let me know if you have an idea
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,348
    Hello,

    I am not a programmer, but if you set the port high, loop the 50 mS twice,
    set the port low, loop the 50 mS 10 times and you will have the wanted result.

    Bertus
     
  5. Westernesse

    New Member

    Feb 1, 2011
    1
    0
    School project?

    Setup up a timer that will cause an interrupt every 50ms. The PIC spec PDF will detail which settings to use to get that.

    Then have a variable count the timer ticks (occurs every interrupt) . Reset your tick counter to 0 when it reaches 12.
    Activate a port pin digital output on the 16f887 when the tick value is <3, and shut it off (low) when tick >=3.
     
  6. RG23

    Thread Starter Active Member

    Dec 6, 2010
    301
    2
    Setup up a timer that will cause an interrupt every 50ms. The PIC spec PDF will detail which settings to use to get that.

    Then have a variable count the timer ticks (occurs every interrupt) . Reset your tick counter to 0 when it reaches 12.
    Activate a port pin digital output on the 16f887 when the tick value is <3, and shut it off (low) when tick >=3.
    ________________________________________________________________

    I am not clear with this idea
    Can you please explain once again

    Thanks
     
Loading...