Searching \ for '16C73 PWM' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=pwm
Search entire site for: '16C73 PWM'.

Truncated match.
PICList Thread
'16C73 PWM'
1996\10\02@111542 by Mark Jurras

flavicon
face
I need to output a 50% Duty Cycle Fixed Frequency without tying up the
processor. and I figured that the PWM might do the trick. Most of the app
notes on the CD seem to relate to the 17C parts or the PWM theory. The Data
Sheet doesn't give much detail on exactly what needs to be set up.

Since I need to just output a fixed frequency do I need to setup the
interrupts?

- -Mark

1996\10\02@204419 by Steve Hardy

flavicon
face
> From: Mark Jurras <spam_OUTJURRAMTakeThisOuTspamtorrington.com>
>
> I need to output a 50% Duty Cycle Fixed Frequency without tying up the
> processor. and I figured that the PWM might do the trick. Most of the app
> notes on the CD seem to relate to the 17C parts or the PWM theory. The Data
> Sheet doesn't give much detail on exactly what needs to be set up.
>
> Since I need to just output a fixed frequency do I need to setup the
> interrupts?
>
> - -Mark
>

Assuming you are using a PIC16C7X (i.e. one with a PWM module), setting
up for PWM output is documented quite well in the Microchip Datasheet
for the 16C7X.  Here is some code for PWM1:

setup   bsf     status,rp0
       movlw   PWM_PERIOD
       movwf   pr2             ; Set up period register
       bcf     status,rp0
; Optionally, set up TMR2 prescaler (not shown here)
       movlw   1<<tmr2on
       movwf   t2con           ; Turn on timer 2
       movlw   0Ch
       movwf   ccp1con         ; Set PWM mode
       movlw   PWM_PERIOD/2    ; Constant for 50% duty cycle
       movwf   ccpr1l          ; Set duty cycle
; Optionally, set 'fine control' bits for up to 10-bit resolution (not shown).
       ...
turnoff clrf    t2con           ; Turn off timer 2
       clrf    ccp1con         ; Turn of CCP 1.

No interrupt handling is required.

Regards,
SJH
Canberra, Australia

1996\10\03@111112 by Juan Jose Abba

flavicon
face
Steve, would you have some code to generate a sine wave using PWM on a 16C74???
What would be the highest frequency that could be generated under let say a
2% maximum armonic distortion???
thanks
juan


At 10:49 AM 10/3/96 EST, you wrote:
{Quote hidden}

1996\10\03@121928 by Scott Dattalo

face
flavicon
face
Juan Jose Abba wrote:
>
> Steve, would you have some code to generate a sine wave using PWM on a
16C74???
> What would be the highest frequency that could be generated under let say a
> 2% maximum armonic distortion???


PWM and sine waves? Hmm, could you be a little more specific Juan?
If you need a fast and accurate way to generate sine waves, then
check out:


http://www.interstice.com/~sdattalo/technical/software/pic/picsine.html

If you need a REAL fast way to generate them and you are willing to
give up a little accuracy then check out Eric Smith's:

http://www.brouhaha.com/~eric/pic/sine.html

As far as your 2% max armonic (harmonic) distortion, you might want to
check
out:

http://www.interstice.com/~sdattalo/technical/theory/sinewave.html

I discuss a little bit about how much error is introduced when you use
first order linear interpolation with sine waves.

Scott

More... (looser matching)
- Last day of these posts
- In 1996 , 1997 only
- Today
- New search...