Reprogramação do micro para uso no strobo de Aeromodelismo Luz de Navegação
Автор: tiago finger
Загружено: 2017-03-18
Просмотров: 1249
Conforme prometido nos vídeo anterior
" • Montagem Eletronica para lampada strobo de... e • Gravação do micro para uso no strobo de Ae...
aqui esta o processo para alteração das piscadas... abaixo a programação para copiar, compilar e gravar.
list p=12f629
#include "p12f629.inc" ;substituir as aspas por simbolo de menor e maior
;============================================================
;Configuracoes
__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _CPD_OFF
;============================================================
;Portas
#define Led2 GPIO,0
#define Led3 GPIO,1
#define Led1 GPIO,2
;============================================================
; RAM de 0x20 a 0x5F
CBLOCK 0x20
mem_delay_1: 1
mem_delay_2: 1
mem_delay_3: 1
ENDC
;============================================================
ORG 0x000
goto MAIN
ORG 0x004
RETFIE
;============================================================
;============================================================
ORG 0x010
MAIN:
; osc int de 4 Mhz
banksel 0x80
call 0x3FF
movwf OSCCAL
banksel 0x00
; desativas todas int
LOCAL STOP_INT
BCF INTCON,GIE
BTFSC INTCON,GIE
GOTO $-2
;===========================================================
; incializa os pinos
banksel 0x00
clrf GPIO
movlw b'00000111'
movwf CMCON
banksel 0x80
bcf OPTION_REG,5
bsf OPTION_REG,7
clrf WPU
clrf IOC
movlw b'00001000'
movwf TRISIO
banksel 0x00
;=============================================================
bcf Led1
bcf Led2
bcf Led3
;==============================================
REPETE:
banksel 0x00
bsf Led1
movlw .8
call para_por_x_10ms
bcf Led1
movlw .3
call para_por_x_10ms
bsf Led2
movlw .8
call para_por_x_10ms
bcf Led2
movlw .3
call para_por_x_10ms
bsf Led1
movlw .8
call para_por_x_10ms
bcf Led1
movlw .3
call para_por_x_10ms
bsf Led2
movlw .8
call para_por_x_10ms
bcf Led2
movlw .3
call para_por_x_10ms
movlw .5
call para_por_x_10ms
bsf Led3
movlw .10
call para_por_x_10ms
bcf Led3
movlw .35
call para_por_x_10ms
goto REPETE
;=========================================
; Delay
para_por_x_10ms:
movwf mem_delay_3
call Delay_10ms
decfsz mem_delay_3,1
goto $-2;
return
Delay_10ms:
movlw d'100'
movwf mem_delay_2
call Delay_100uS
decfsz mem_delay_2,1
goto $-2;
return
Delay_100uS:
movlw d'31'
movwf mem_delay_1
decfsz mem_delay_1,1
goto $-1
return
;============================================
org 3FFh
retlw 0x34 ;
end
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: