Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
bueno es una pregunta sencilla
se puede utilizar esta instruccion de esta manera?
Pulsador es una variable, y queria comprobar si es 1 el primer bit de esa variable, o es de otra manera?Código:btfss Pulsador,0
list P=16f628A
include <P16f628A.INC>
__config _CP_OFF& _WDT_OFF& _PWRTE_ON& _MCLRE_ON& _LVP_OFF& _INTOSC_OSC_NOCLKOUT ; desavilito perro guardion pin 5 no se puede usar, habilito puerto B(lvp_of),habiita el oscilador interno y no el de salida (_intosc_osc_noclkouñ
org 0
goto CONFIG_PUERTOS
org 5
CONFIG_PUERTOS
clrF PORTA
clrf PORTB
bcf STATUS,RP1
bsf STATUS,RP0
movlw 0x07
movwf CMCON
movlw b\'11111111\'
movwf TRISA
movlw 0x00 ;clrf trisb
movwf TRISB
bcf STATUS,RP1
bcf STATUS,RP0
PRINSIPAL
movf PORTA,W
movwf PORTB
goto PRINSIPAL
end
list P=16f628A ; informa al ensamblador a qué PIC nos dirigimos
include <P16f628A.IN> ; incluye las constantes de ese PIC para usarlas más adelante
; ajusta los fusibles de funcionamiento general
__config _CP_OFF & _WDT_OFF & _PWRTE_ON & _MCLRE_ON & _LVP_OFF & _INTOSC_OSC_NOCLKOUT
org 0 ; origen del programa
goto CONFIG_PUERTOS ; saltar a configurar los puertos
org 5
CONFIG_PUERTOS: ; aquí empieza lo interesante
clrf PORTA ; inicialiazamos el valor de los puertos A y B
clrf PORTB
bcf STATUS,RP1 ; cambiamos al banco 1
bsf STATUS,RP0
movlw b'0111' ; le ponemos 7 al CMCON: desactivamos el modo de comparación en puerto A
movwf CMCON
movlw b'11111111' ; configuramos el puerto A como entrada
movwf TRISA
movlw b'00000000' ; configuramos el puerto B como salida
movwf TRISB
bcf STATUS,RP1 ; cambiamos al banco 0
bcf STATUS,RP0
PRINCIPAL: ; inicio del bucle
movf PORTA,W ; leemos el valor presente en el puerto A
movwf PORTB ; lo escribimos en el puerto B
goto PRINCIPAL ; y repetimos
end
PRINCIPAL:
BSF LED ; enciende
MOVLW .100
MOVWF cnt
BUCLE1:
NOP
DECFSZ cnt
GOTO BUCLE1
BCF LED ; apaga
MOVLW .100
MOVWF cnt
BUCLE2:
NOP
DECFSZ cnt
GOTO BUCLE2
GOTO PRINCIPAL
END
$ ./delay_pic.pl 4Mhz 500ms -s
; ----------------------------------------------------------------------------------------------------
; Espera = 500ms
; Frecuencia de reloj = 4Mhz
;
; Espera real = 0.5 segundos = 500000 ciclos
; Error = 0.00 %
cblock 0x70
Espera_d1
Espera_d2
Espera_d3
endc
Espera:
;499994 ciclos
movlw 0x03
movwf Espera_d1
movlw 0x18
movwf Espera_d2
movlw 0x02
movwf Espera_d3
Espera_loop:
decfsz Espera_d1, f
goto $+2
decfsz Espera_d2, f
goto $+2
decfsz Espera_d3, f
goto Espera_loop
;2 ciclos
goto $+1
;4 ciclos (incluyendo la llamada)
return
; Generado por delay_pic.pl (Joaquín Ferrero. 2014.07.22)
; ./delay_pic.pl 4Mhz 500ms -s
; jue 25 sep 2014 19:55:09 CEST
; http://perlenespanol.com/foro/generador-de-codigos-de-retardo-para-microcontroladores-pic-t8602.html
; ----------------------------------------------------------------------------------------------------
El problema viene aquí: En uno de los menús necesito acceder a otro submenú y en ese sub menú a otro submenú, y en este, a su vez, realizar la selección de dos opciones.
acá está, sepan disculpar lo mal que programo :/ todavía no lo domino bien...Pon el codigo para ver como manejas la rutina. Quizas estan utilizando un solo registro para todo el proceso y no estas cargando adecuadamente el numero de veces que quieres que se repita una secuencia. Pero es solo imaginacion mia, mejor, pon el codigo para poderte ayudar.
LIST P=16F628A
INCLUDE <P16F628A.INC>
__config _BODEN_OFF & _CP_OFF & DATA_CP_OFF & _PWRTE_ON & _WDT_OFF & _LVP_OFF & _MCLRE_ON & _XT_OSC
ORG 0
BSF STATUS, RP0
MOVLW B'00000000'
MOVWF TRISB
BCF STATUS, RP0
EFECTO1 EQU H'21'
MOVLW .15
MOVWF .15
MOVLW B'00001111'
MOVWF PORTB
CALL DEMORA
MOVLW B'11110000'
MOVWF PORTB
CALL DEMORA
DECFSZ .15
GOTO EFECTO2
EFECTO2 EQU H'21'
MOVLW .15
MOVWF .15
MOVLW B'10101010'
MOVWF PORTB
CALL DEMORA
MOVLW B'01010101'
MOVWF PORTB
CALL DEMORA
DECFSZ .15
GOTO EFECTO3
EFECTO3 EQU H'21'
MOVLW .15
MOVWF .15
MOVLW B'10000001'
MOVWF PORTB
CALL DEMORA
MOVLW B'11000011'
MOVWF PORTB
CALL DEMORA
MOVLW B'11100111'
MOVWF PORTB
CALL DEMORA
MOVLW B'11111111'
MOVWF PORTB
CALL DEMORA
MOVLW B'11100111'
MOVWF PORTB
CALL DEMORA
MOVLW B'11000011'
MOVWF PORTB
CALL DEMORA
MOVLW B'10000001'
MOVWF PORTB
CALL DEMORA
DECFSZ .15
GOTO EFECTO1
DEMORA
MOVLW .100 ;RETARDO DE 250 MILISEGUNDOS
MOVWF H'7E' ;
TOPB MOVLW .250 ; TIMING ADJUSTMENT VARIABLE
MOVWF H'7F'
TOP2B NOP
NOP
NOP
NOP
NOP
NOP
DECFSZ H'7F',F ; INNER LOOPS COMPLETE?
GOTO TOP2B ; NO, GO AGAIN
DECFSZ H'7E',F ; OUTER LOOPS COMPLETE?
GOTO TOPB ; NO, GO AGAIN
RETURN ; YES, RETURN FROM SU
END
MOVLW .15
MOVWF .15
EFECTO1 EQU H'21'
MOVLW B'00001111'
MOVWF PORTB
CALL DEMORA
MOVLW B'11110000'
MOVWF PORTB
CALL DEMORA
DECFSZ .15,F
GOTO EFECTO1
MOVWF TRISB
movwf TRISX^0x80
clrf INTCON^0x80
movf EEDATA^0x100
errorlevel -302 ; Turn off banking message