'Using the PWM of the PIC 16c74'
I am looking for both a simple explanation of and coding for if possible the
use and setting up of the PWM outputs on the PIC 16c74.
Has anyone undertaken any work of this kind that they may wish to share with
I would like to take a value from the A/D input (0 to 255) and simply put
this out as a PWM signal.
Any assistance will be appreciated.
Thanks in advance
If you already are familiar with the general operation of the PIC and its
ports, just set the pins as outputs, and then include these particulars:
movlw b'00001111' ;set for PWM not CCP1
movwf CCP1CON ;to ccp1con for pwm channel 1
movwf CCP2CON ;to ccp2con for pwm channel 2
bsf T2CON,2 ;turn on timer 2
;now make it work
;put your desired pwm value, 0-255, into w now!
movwf CCPR1L ;to PWM register channel 1
movwf CCPR2L ;to PWM register channel 2
This will get you started. There are other options, but start with this
and you can get to where you want to be.
More... (looser matching)
- Last day of these posts
- In 1998
, 1999 only
- New search...