Apparently, your Scope works Really Well.
I ran the numbers again for a 16F877 this time, and the results are rather surprising.
Code:
Start: ' Cycles uS@20mhz
PORTD.0 = 1 ' 1 .2
Delay = Value /*$004D ' 243 48.6
PORTD.0 = 0 ' 1 .2
PauseUs 700 ' 3502 700.4
Goto Start ' 4 .8
----- -----
' Loop Total 3751 750.2
' Without Pause 249
Code:
' Cycles uS@20mhz
Dummy1 = OldPulseTime >> 2 ' 37 7.4
Delay = Dummy1 >> 2 ' 37 7.4
Delay = Delay + Dummy1 ' 6 1.2
----- -----
' Total 80 16.0
Code:
' Cycles uS@20mhz
Dummy1 = OldPulseTime >> 1 ' 5 1.0
Dummy1 = Dummy1 >> 1 ' 3 .6
Delay = Dummy1 >> 1 ' 5 1.0
Delay = Delay >> 1 ' 3 .6
Delay = Delay + Dummy1 ' 6 1.2
----- -----
' Total 22 4.2
I really didn't expect that much difference between the same code compiled for the 2 different chips.
Way to go Ingvar.
Bookmarks