Mercurial > public > hwos_code
comparison src/wait.asm @ 0:11d4fc797f74
init
author | heinrichsweikamp |
---|---|
date | Wed, 24 Apr 2013 19:22:45 +0200 |
parents | |
children | 653a3ab08062 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:11d4fc797f74 |
---|---|
1 ;============================================================================= | |
2 ; | |
3 ; File wait.asm | |
4 ; | |
5 ; Wait routines | |
6 ; | |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2004-01-31 : [chsw] Initial version. | |
11 ; 2007-05-11 : Updated (OSTC code). | |
12 ; 2011-10-18 : [mH] Timings tested with oscilloscope | |
13 | |
14 #include "ostc3.inc" | |
15 | |
16 basic CODE | |
17 | |
18 ; ========================================================== | |
19 ; WAIT 1 MILLISECOND (Not exact: 1,008ms +/- 30,5µs + worst case ISR latency) | |
20 ; ========================================================== | |
21 | |
22 global WAITMSX | |
23 WAITMSX movwf waitms_temp | |
24 | |
25 WAITMSX2 setf TMR5H | |
26 movlw .255-.32 ;32 x 31,5µs = 1,008ms | |
27 movwf TMR5L | |
28 bcf PIR5,TMR5IF ; Clear flag | |
29 WAITMSX3 btfss PIR5,TMR5IF | |
30 bra WAITMSX3 ; Wait loop | |
31 decfsz waitms_temp,F | |
32 bra WAITMSX2 | |
33 return | |
34 | |
35 ;============================================================================= | |
36 | |
37 END |