Hello Rossw
Here is the Code that I promised you... But, like Ralph said... PBP has a built in function, and using my code is like re-inventing the wheel... <g> But I promised it to you anyhow.... It is cycling just like the PWM...different timing, but principal is the same... I tested it on a LED, and the LED cycled... you may want to change the parameters to allow the LED to go all the way out...
@ DEVICE PIC12F675,INTRC_OSC_NOCLKOUT,WDT_ON,PWRT_OFF,BOD_O N,PROTECT_OFF,CPD_OFF,MCLR_OFF
ANSEL=%00000000
CMCON=%00010111
TRISIO=%00011000
ADCON0=%00000000
Counter var byte
Counter2 var word
Loop:
For Counter=0 to 255
For Counter2=0 to 62
GPIO.1=1
Pauseus Counter
GPIO.1=0
pauseus 255-Counter
Next Counter2
Next counter
GPIO.0=1
GPIO.0=0
Goto Loop
end
If you want to use the PWM on your 628... here is the code for it...It has some extra trash in it... but who cares <g>
C1 var byte
TrisA = %11111111
TrisB = %00000000
PortB = %0
PR2= $003F
CCPR1L = 0
CCP1CON = %00001100
TRISB.3 = 0
T2CON = %00000110
'I BYTE
CCPR1L=0
PAUSE 5000
LOOPIT:
For c1=0 to 60
CCPR1L=C1
PAUSE 1000
Next C1
GOTO LOOPIT
END
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks