annotate src/wait.asm @ 80:db920ca01491

new commands in download mode: "w" - write setting "x" - Reset all settings
author mh@mh-THINK.localdomain
date Thu, 27 Feb 2014 14:38:08 +0100
parents 11d4fc797f74
children 653a3ab08062
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
heinrichsweikamp
parents:
diff changeset
3 ; File wait.asm
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; Wait routines
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2004-01-31 : [chsw] Initial version.
heinrichsweikamp
parents:
diff changeset
11 ; 2007-05-11 : Updated (OSTC code).
heinrichsweikamp
parents:
diff changeset
12 ; 2011-10-18 : [mH] Timings tested with oscilloscope
heinrichsweikamp
parents:
diff changeset
13
heinrichsweikamp
parents:
diff changeset
14 #include "ostc3.inc"
heinrichsweikamp
parents:
diff changeset
15
heinrichsweikamp
parents:
diff changeset
16 basic CODE
heinrichsweikamp
parents:
diff changeset
17
heinrichsweikamp
parents:
diff changeset
18 ; ==========================================================
heinrichsweikamp
parents:
diff changeset
19 ; WAIT 1 MILLISECOND (Not exact: 1,008ms +/- 30,5µs + worst case ISR latency)
heinrichsweikamp
parents:
diff changeset
20 ; ==========================================================
heinrichsweikamp
parents:
diff changeset
21
heinrichsweikamp
parents:
diff changeset
22 global WAITMSX
heinrichsweikamp
parents:
diff changeset
23 WAITMSX movwf waitms_temp
heinrichsweikamp
parents:
diff changeset
24
heinrichsweikamp
parents:
diff changeset
25 WAITMSX2 setf TMR5H
heinrichsweikamp
parents:
diff changeset
26 movlw .255-.32 ;32 x 31,5µs = 1,008ms
heinrichsweikamp
parents:
diff changeset
27 movwf TMR5L
heinrichsweikamp
parents:
diff changeset
28 bcf PIR5,TMR5IF ; Clear flag
heinrichsweikamp
parents:
diff changeset
29 WAITMSX3 btfss PIR5,TMR5IF
heinrichsweikamp
parents:
diff changeset
30 bra WAITMSX3 ; Wait loop
heinrichsweikamp
parents:
diff changeset
31 decfsz waitms_temp,F
heinrichsweikamp
parents:
diff changeset
32 bra WAITMSX2
heinrichsweikamp
parents:
diff changeset
33 return
heinrichsweikamp
parents:
diff changeset
34
heinrichsweikamp
parents:
diff changeset
35 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
36
heinrichsweikamp
parents:
diff changeset
37 END