Blame | Last modification | View Log | Download
;;;; include DELAY.INC;;;;DELAY5 ; Delka spozdeni v nasobcich 5us;;DELAY1 ; Delka spozdeni v nasobcich 1ms;;;; Procedury pro generovani spozdeni SW prostredky;; Include 16C84.INC pro definici zakladnich registru__DELAY__: ; Priznak modulu DELAYifndef __16C84__error "Include file 16C84.INC"endififndef DELAY5cblockDELAY5endcendififndef DELAY1cblockDELAY1endcendif;-----------------------;; Short Delay - 6 az 1281 us 'a 5us --> 1+5*DELAY5 [us];;-----------------------;; Vstup: DELAY5 pozadovane spozdeni v 5us jednotkach; Nici: DELAY5del_0:goto $+1 ; Cyklus je 5usdelay5us:decfsz DELAY5goto del_0return ; Cas pro call a return je take zapocten;-----------------------;; Jednorazove spozdeni 10ms;;-----------------------;; Nici: W, DELAY1, DELAY5delay10ms:movlw 10movwf DELAY1;-----------------------;; Long Delay - 1 az 256 ms 'a 1ms --> 1000*DELAY1 + 3 [us];;-----------------------;; Vstup: DELAY1 pozadovane spozdeni v 1ms; Znici: W, DELAY5, DELAY1delay1ms:movlw (1000 / 5 ) - 2 ; 1usmovwf DELAY5 ; 1usgoto $+1 ; 2usgoto $+1 ; 2uscall delay5us ; 198 * 5 + 1 = 991usdecfsz DELAY1 ; 1/2usgoto delay1ms ; 2usreturn ; 2us