SPWM and Elapsed Timer


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by CocaColaKid View Post
    Oh, guess I missed posting all the relevant information.

    16F88 @ 10MHz
    Single 82Hz SPWM Channel
    Single 1kHz HPWM Channel
    Timer0 - Free, Timer1 - SPWM , Timer2 - HPWM
    The 1kHz HPWM is being output on portb.3, it could be either portb.0 or portb.3
    The porta.4/T0CKI can be made available for use, its just an input
    Unfortunately the 82Hz is required, its the control signal for an ECM motor
    There ya go. Now there's some room to play with.
    But now you'll regret saying you want to do it yourself.

    Since there's only 1 SPWM channel. I would recommend reverting the the original SSPWM program. It only uses 2 interrupts per cycle, 1 for the ON time, and 1 for the OFF time. But it would need to be modified to work at 82hz, since it currently runs at 100. And in the SSPWM routines, you can create a 1sec period for timing the input frequency's measurement.

    Then by feeding the 0-1khz into Timer 0 (T0CKI), you should get a real good count/frequency that works in the background, unlike the COUNT command.
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Let me see if I get this right. Bare with me because I am still very green on the whole timer thing. I need to set Timer0 to count the pulses coming in on T0CKI for 1 second once a clock is seen. This 1 second interval will be determined from Timer1?

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    That's the plan.

    Of course, it doesn't have to be a 1 second sample period.
    As long as it's a constant time base, readings can be easily corrected to match the difference.
    <br>
    DT

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts