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
|> From: Mark Jurras <torrington.com> JURRAM
> 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
> - -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
movwf pr2 ; Set up period register
; Optionally, set up TMR2 prescaler (not shown here)
movwf t2con ; Turn on timer 2
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.
Juan Jose Abba
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???
At 10:49 AM 10/3/96 EST, you wrote:
More... (looser matching)
- Last day of these posts
- In 1996
, 1997 only
- New search...