S
Sheeraz Khan
Guest
¿Alguien puede señalar esquema de código en la lista?
; Pulse_60.asm
;
, 22 de octubre 2004
;
, 1 salida de impulsos / min a partir 50Hz red o circuito de reloj de 0,5 HzP = 3D lista 12F675
incluyen "P12F675.inc"
ERRORLEVEL -305, -302, -306; supresión de error de MPLAB
__CONFIG _CP_OFF _INTRC_OSC_NOCLKOUT & & _BODEN_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_OFF & _MCLRE_ON
bank0 macro
bcf STATUS, RP0
bcf STATUS, RP1
bcf STATUS, IRP
ENDM
BANK1 macro
bsf STATUS, RP0
bcf STATUS, RP1
bcf STATUS, IRP
ENDM
mov litval macro, el archivo
litval movlw
archivo movwf
ENDM
0x20 CBLOCK
garrapatas
secs
temp1
temp2
t0_cnt
endc
# define gpio llevado, 0, 1 ppm LED
# define poder GPIO, 1; en la red
# define mains50 GPIO, 2; en 50Hz, INT
# define b0int GPIO, 4; a 452
# define gpio reloj, 5; 0,5 Hz de módulo de reloj
org 0x00
goto
org 0x04
goto ISR
org 0x05
inicio BANK1
0x3ff llamada
movwf osccal
Ansel clrf; entradas digitales
movlw b'00101110 '
1; 0,5 Hz en
, Salida 0 a 452
, 1 / MCLR
1; 50 Hz en
, 1 red de encendido / apagado
; 0 LED verde, la producción
movwf trisio
movlw b'10000110 '
1; Pullups fuera
; Previa 110 / 128 TMR0-escalador
OPTION_REG movwf; = 3D ~ 32.768ms vuelco 4MHz int rc = oscbank0
clrf GPIO
movlw b'00000111 '; GPIO 0,1,2 como digital
cmcon movwf
clrf TMR0
INTCON clrf
INTCON BSF, inte
t1con clrf
mov 0xff, tmr1l; TMR1 carga con -1
mov 0xff, tmr1h
mov .100, garrapatas, la resolución 2 segundos
mov .30, secs, 1 minuto
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
; Bucle principal, espera a la entrada
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
poder btfss principal
Ir a la batería
INTCON BCF, intf
clrf TMR0
wt_lh BTFSC mains50
Ir chk_m1
btfss wt_hl mains50
Ir chk_m2
bcf llevó
decfsz garrapatas
goto principal
mov .100, garrapatas; recargar las garrapatas
bsf LED; LED en la segunda 1/50th
secs decfsz
goto principal
mov .30, segundos; secs recarga
pulso de llamada
goto principal
btfss batería del reloj
Ir sec2; si el proceso de apagado
poder BTFSC
goto principal; la salida si el poder viene de
Ir a la batería
sec2 BsF llevó
llamada MS5; LED de 5ms
reloj btfss; esperar el regreso de alta
goto $ -1
bcf llevó
secs decfsz
Ir a la batería
mov .30, secs
pulso de llamada
Ir a la batería
b0int BsF pulso; 50us pulso a 452
mov .252, temp1
incfsz temp1
goto $ -1
b0int bcf
volver
chk_m1 poder btfss
Ir a la batería
wt_lh goto
chk_m2 poder btfss
Ir a la batería
wt_hl goto
MS5 mov .249, temp1; 5ms retraso
mov 0x84, temp2
inct1 incfsz temp2
goto $ -1
incfsz temp1
Ir inct1
volver
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
; Fallo - TMR0 tiempo de espera
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
nop ISR
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
INTCON BCF t_loop, t0if; aprox 500US demora
btfss INTCON, t0if
goto $ -1
INTCON BCF, t0if
volver
final
; Pulse_60.asm
;
, 22 de octubre 2004
;
, 1 salida de impulsos / min a partir 50Hz red o circuito de reloj de 0,5 HzP = 3D lista 12F675
incluyen "P12F675.inc"
ERRORLEVEL -305, -302, -306; supresión de error de MPLAB
__CONFIG _CP_OFF _INTRC_OSC_NOCLKOUT & & _BODEN_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_OFF & _MCLRE_ON
bank0 macro
bcf STATUS, RP0
bcf STATUS, RP1
bcf STATUS, IRP
ENDM
BANK1 macro
bsf STATUS, RP0
bcf STATUS, RP1
bcf STATUS, IRP
ENDM
mov litval macro, el archivo
litval movlw
archivo movwf
ENDM
0x20 CBLOCK
garrapatas
secs
temp1
temp2
t0_cnt
endc
# define gpio llevado, 0, 1 ppm LED
# define poder GPIO, 1; en la red
# define mains50 GPIO, 2; en 50Hz, INT
# define b0int GPIO, 4; a 452
# define gpio reloj, 5; 0,5 Hz de módulo de reloj
org 0x00
goto
org 0x04
goto ISR
org 0x05
inicio BANK1
0x3ff llamada
movwf osccal
Ansel clrf; entradas digitales
movlw b'00101110 '
1; 0,5 Hz en
, Salida 0 a 452
, 1 / MCLR
1; 50 Hz en
, 1 red de encendido / apagado
; 0 LED verde, la producción
movwf trisio
movlw b'10000110 '
1; Pullups fuera
; Previa 110 / 128 TMR0-escalador
OPTION_REG movwf; = 3D ~ 32.768ms vuelco 4MHz int rc = oscbank0
clrf GPIO
movlw b'00000111 '; GPIO 0,1,2 como digital
cmcon movwf
clrf TMR0
INTCON clrf
INTCON BSF, inte
t1con clrf
mov 0xff, tmr1l; TMR1 carga con -1
mov 0xff, tmr1h
mov .100, garrapatas, la resolución 2 segundos
mov .30, secs, 1 minuto
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
; Bucle principal, espera a la entrada
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
poder btfss principal
Ir a la batería
INTCON BCF, intf
clrf TMR0
wt_lh BTFSC mains50
Ir chk_m1
btfss wt_hl mains50
Ir chk_m2
bcf llevó
decfsz garrapatas
goto principal
mov .100, garrapatas; recargar las garrapatas
bsf LED; LED en la segunda 1/50th
secs decfsz
goto principal
mov .30, segundos; secs recarga
pulso de llamada
goto principal
btfss batería del reloj
Ir sec2; si el proceso de apagado
poder BTFSC
goto principal; la salida si el poder viene de
Ir a la batería
sec2 BsF llevó
llamada MS5; LED de 5ms
reloj btfss; esperar el regreso de alta
goto $ -1
bcf llevó
secs decfsz
Ir a la batería
mov .30, secs
pulso de llamada
Ir a la batería
b0int BsF pulso; 50us pulso a 452
mov .252, temp1
incfsz temp1
goto $ -1
b0int bcf
volver
chk_m1 poder btfss
Ir a la batería
wt_lh goto
chk_m2 poder btfss
Ir a la batería
wt_hl goto
MS5 mov .249, temp1; 5ms retraso
mov 0x84, temp2
inct1 incfsz temp2
goto $ -1
incfsz temp1
Ir inct1
volver
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
; Fallo - TMR0 tiempo de espera
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
nop ISR
; = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D = 3D
INTCON BCF t_loop, t0if; aprox 500US demora
btfss INTCON, t0if
goto $ -1
INTCON BCF, t0if
volver
final