Hello.
Here's simple code:
When run on 16F628A, instead of 100, 200 and 300 uS delays, it gives: 290, 400, 490us delay, measured with digital scope.Code:define OSC 4 TRISB = %00000000 charte var PORTB.2 gamorte var PORTB.3 AGAIN: pulsout charte,1 pauseus 100 pulsout gamorte,1 pause 1000 pulsout charte,1 pauseus 200 pulsout gamorte,1 pause 1000 pulsout charte,1 pauseus 300 pulsout gamorte,1 pause 1000 GOTO AGAIN
I've modified code for 16F819, for 8mhz oscillator, by changing to: define OSC 8 and adding: OSCCON=%01110100
In this case, linearity improved, but PAUSEUS are still out of definitions:
100uS gives 270 uS
200uS gives 370 uS
300uS gives 470 uS
Why this happens and what I'm doing wrong?




Bookmarks