• Sábado 20 de Abril de 2024, 06:37

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - elias1

Páginas: [1]
1
ASM (Ensamblador) / espero QUE A ALGUIEN LE SIRVA ESTO :)
« en: Domingo 7 de Abril de 2013, 19:57 »
;ESTE CODIGOESTA EN ASM. Y ES EL TECLADO MATRICIAL
;ESPERO A ALGUIEN LE AYUDE
 
 List p=16f84a
      INCLUDE "P16F84A.INC"
          __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON  & _XT_OSC ;
     
     

 org 0x00 ; Inicio de programa
BEGIN
      bsf STATUS,5; Inicio configuracion E/S
    clrf PORTA ; PORTA como salida
    movlw 0xF0
    movwf PORTB ;Puerto B como entradas
    bcf STATUS,5; Fin configuracion E/S

TECLADO

         
         bsf         PORTB,0         ;pongo en 1 la primera fila
   
         btfsc      PORTB,4            ;rutina tecla "1"
         goto      tecla1
         btfsc      PORTB,5            ;rutina tecla "2"
         goto      tecla2
         btfsc      PORTB,6            ;rutina tecla "3"
         goto      tecla3
   

         bcf         PORTB,0         ;pongo en 0 la primera fila
         bsf         PORTB,1         ;pongo en 1 la segunda fila
      
         btfsc      PORTB,4            ;rutina tecla "4"
         goto      tecla4
         btfsc      PORTB,5            ;rutina tecla "5"
         goto      tecla5
         btfsc      PORTB,6            ;rutina tecla "6"
         goto      tecla6
      
         bcf         PORTB,1         ;pongo en 0 la segunda fila
         bsf         PORTB,2         ;pongo en 1 la tercer fila
   
         btfsc      PORTB,4            ;rutina tecla "7"
         goto      tecla7
         btfsc      PORTB,5            ;rutina tecla "8"
         goto      tecla8
         btfsc      PORTB,6            ;rutina tecla "9"
         goto      tecla9
   
         bcf         PORTB,2         ;pongo en 0 la tercer fila
         bsf         PORTB,3         ;pongo en 1 la cuarta fila
   
         btfsc      PORTB,5            ;rutina tecla "0"
         goto      tecla0
         btfsc      PORTB,6            ;rutina tecla "numeral"
         goto      teclanum

         bcf         PORTB,3         ;pongo en 0 la cuarta fila
         goto      TECLADO
tecla1   
                           
         btfsc      PORTB,4            ;chequeo si ya soltaron la tecla   
         goto      tecla1                         
         MOVLW      0X01
         movwf      PORTA
         goto      TECLADO
      
tecla2         
         btfsc      PORTB,5
         goto      tecla2            
         movlw      0x02
         movwf      PORTA
         goto      TECLADO
      
tecla3         
         btfsc      PORTB,6
         goto      tecla3         
         movlw   0x03
         movwf      PORTA
         goto      TECLADO
      
tecla4
         btfsc      PORTB,4
         goto      tecla4
         movlw   0x04
         movwf      PORTA
         goto      TECLADO
      
               
tecla5         
         btfsc      PORTB,5
         goto      tecla5            
         movlw   0x05
         movwf      PORTA
         goto      TECLADO
tecla6
         btfsc      PORTB,6
         goto      tecla6
         movlw   0X6
         movwf      PORTA
         goto      TECLADO
      
tecla7         
         btfsc      PORTB,4
         goto      tecla7
         movlw   0x07
         movwf      PORTA
         goto      TECLADO      
tecla8         
         btfsc      PORTB,5
         goto      tecla8
         movlw   0x08
         movwf      PORTA
         goto      TECLADO      
tecla9         
         btfsc      PORTB,6
         goto      tecla9
         movlw   0x09
         movwf      PORTA
         goto      TECLADO
tecla0         
         btfsc      PORTB,5       ;chequeo si ya soltaron la tecla
         goto      tecla0
         movlw   0x00
         movwf      PORTA
         goto      TECLADO
teclanum      
         btfsc      PORTB,6
         goto      teclanum
         movlw      0xB
         movwf      PORTA
         goto      TECLADO

end  ; Fin de programa

2
ASM (Ensamblador) / podria alguien echarme la mano ,esun organo electronico
« en: Domingo 7 de Abril de 2013, 09:57 »
hola, que tal, quisiera saber si alguien me podria orientar o ayudar, con un proyecto que tengo que hacer, tengo que hacer un organo electronico solo que este lo tengo que hacer con un pic16f84a, en codigo asm y no se como programarlo , pero para esto,el circuito biene con un 555 y el profesor me dijo lo siguiente ((por lo que veo este circuito no utiliza el pic. sino un timer555. Si lo adaptas al pic para que por medio de este te genere las ondas cuadradas a la frecuencia que salen ahí. estaria muy bien. Eso lo puedes hacer como la práctica de 500µseg... solo que cambiarias los tiempos... por el puerto B sensas el boton y por el Porta sacas la onda con resistencia y un transistor con una bocina)))), pero no se como hacerlo, alguien mepodria ayudar porfavor  (les adujnte el cto pero este es con un 555 y tengo que cambiarlopor el pic)

agradeceria su ayuda gracias

Páginas: [1]