Чт фев 17, 2022 08:13:35
Чт фев 17, 2022 08:18:27
Чт фев 17, 2022 08:29:06
;******************************************************************************
; Author: FABIO MACHADO
; GitHub: https://github.com/MrFMach
;******************************************************************************
;******************************************************************************
;List directives
list p=18F4520 ;directive to define processor
;******************************************************************************
;Includes
#INCLUDE <P18F4520.INC> ;processor specific variable definitions
;******************************************************************************
;Configuration bits
CONFIG OSC = HS ;pic-board cristal cscillator = 20 MHz
;******************************************************************************
;Reset Vector
RES_VECT CODE 0x0000 ;processor reset vector
GOTO START ;go to beginning of program
;******************************************************************************
;Add interrupts here if used
;******************************************************************************
;Main program
MAIN_PROG CODE ;let linker place main program
DCounter1 EQU 0x0C
DCounter2 EQU 0x0D
DCounter3 EQU 0x0E
DELAY_1s:
MOVLW 0x6D
MOVWF DCounter1
MOVLW 0x5E
MOVWF DCounter2
MOVLW 0x1A
MOVWF DCounter3
LOOPD1:
DECFSZ DCounter1, 1
GOTO LOOPD1
DECFSZ DCounter2, 1
GOTO LOOPD1
DECFSZ DCounter3, 1
GOTO LOOPD1
RETURN
DELAY_200ms:
MOVLW 0xAC
MOVWF DCounter1
MOVLW 0x13
MOVWF DCounter2
MOVLW 0x06
MOVWF DCounter3
LOOPD2:
DECFSZ DCounter1, 1
GOTO LOOPD2
DECFSZ DCounter2, 1
GOTO LOOPD2
DECFSZ DCounter3, 1
GOTO LOOPD2
NOP
RETURN
START:
MOVLW B'00000000'
MOVWF TRISB ;PORTB as output
CLRF PORTB
GOTO MAIN
MAIN:
BSF PORTB,5 ;set bit 5
BSF PORTB,6 ;set bit 6
BSF PORTB,7 ;set bit 7
CALL DELAY_200ms
BCF PORTB,5 ;clear bit 5
BCF PORTB,6 ;clear bit 6
BCF PORTB,7 ;clear bit 7
CALL DELAY_1s
GOTO MAIN
;******************************************************************************
;End
END
Чт фев 17, 2022 08:39:37
Чт фев 17, 2022 10:39:26
Чт фев 17, 2022 11:42:35
Пт фев 18, 2022 20:57:45
Пт фев 18, 2022 22:37:31
Сб фев 19, 2022 03:51:08
Сб фев 19, 2022 05:42:02
Сб фев 19, 2022 05:42:30
Сб фев 19, 2022 06:53:17
Сб фев 19, 2022 07:51:26
serega4789 писал(а):Это нужно для поиска обрыва кабеля, 40 метров можно найти обрыв самодельным рефлектометром
Сб фев 19, 2022 08:31:11
Сб фев 19, 2022 08:45:08