pulsewidth var byte ; 0 -5 max is 5
ccp1con=12; pwm mode active high
pr2= pulsewidth+2
ccpr1l=pulsewidth.2
ccp1con= 12+ ((pulsewidth&3)<<4) ;low bits and set the pwm
if you change the pulsewidth you must change pr2 and ccpr1l also
don't expect the output to propagate far without severe deformation
note that 74series gates have propagation delays of 90ns and 20ns rise/fall times ,74f is better at 8 and 3 . ecl would be better still
ps needless to say the tris bit for the output must be cleared
you will need a good cro to measure this 200mhz+ to get a good look
Bookmarks