summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo <leo@azuminha.com>2023-10-29 16:21:08 -0300
committerleo <leo@azuminha.com>2023-10-29 16:21:08 -0300
commitc42e8965b003a6c80e00b261e90a43843a30e009 (patch)
tree304ec5b93acbfee5c2da6ed01b12a81f8b4d9a53
inicio
-rw-r--r--main.asm42
1 files changed, 42 insertions, 0 deletions
diff --git a/main.asm b/main.asm
new file mode 100644
index 0000000..2d97791
--- /dev/null
+++ b/main.asm
@@ -0,0 +1,42 @@
+#include <p16f873.inc>
+ __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_ON & _BOREN_OFF & _LVP_OFF & _CP_OFF & _CPD_OFF
+cblock 0x20 ;definir variaveis
+ led2
+endc
+ org 0x0
+ errorlevel -302 ;desabilitar mensagens de avisos na compilacao
+ goto INICIO:
+;;;;;;;;INICIO DO TIMER;;;;;;;;;;;;;;;;
+ org 0x004
+
+ retfie
+INICIO:
+ ; RB0 -> echo
+ ; RB1 -> trigger
+ banksel TRISB
+ movlw b'00000010' ; rb0 = input(recebe) / rb1 = output(manda)
+ movwf TRISB
+ ;; echo e trigger arrumados
+
+ ;;ATIVAR O TRIGGER;;;
+ banksel PORTB
+ bsf PORTB, RB1 ; ligou o trigger
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop
+ nop ;; 11 us
+ bcf PORTB, RB1 ;; desliga o trigger
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ loop $
+
+ end
+
+