код рабочий, проверено
Код
$regfile = "2313def.dat"
$crystal = 4000000
Config Portb = Output
Config Timer0 = Timer , Prescale = 1
Enable Interrupts
Enable Timer0
On Timer0 Timer0isr
Start Timer0
Dim Pwm As Byte , A As Byte
Pwm = 0
Do
For A = 0 To 255
Waitms 10
Next A
For A = 255 To 0 Step -1
Waitms 10
Next A
Loop
Timer0isr:
Incr Pwm
If Pwm > A Then Portb = 1
If Pwm = 255 Then
Pwm = 0
Portb.0 = 0
End If
Return