Tempo 196 094 + 2+ 2 196 098 Us 196ms: Tempo Movlw D'255' Movwf Val1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Temporisation 7

Calcul de temporisation par boucles imbriques

Val2 EQU 0x20


Val EQU 0x21

TEMPO
movlw D'255' 1cycle = 1us
movwf Val1 1cycle = 1us

B1 movlw D'255' 1cycle = 1us


movwf Val2 1cycle = 1us

Si Val = 0

}
B2 Decfsz Val2 ,F 1cycle = 1us 2cycles = 2us
x 255 x 255 B2 = (255x3)-1
Goto B2 ; 2cycles = 2us 0 cycle = 0 us =764 us
Decfsz Val1,F 1cycle = 1us 2cycles = 2us
Goto B1 2cycles = 2us 0 cycle = 0 us
Return 2cycles = 2us B1 = 255[2 + 764 + 3)-1
= 196 094 us

Tempo = 196 094 + 2+ 2 = 196 098 us = 196ms

You might also like