Autor Tema: PROGRAMITA PARA PIC 16F884 EN PBP  (Leído 13901 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado LordLafebre

  • Moderador Global
  • DsPIC30
  • *****
  • Mensajes: 3529
    • Micros & micros
RE: PROGRAMITA PARA PIC 16F884 EN PBP
« Respuesta #30 en: 08 de Noviembre de 2005, 09:44:00 »
Hola:

Felicidades, muy buen trabajo...!!! Sonrisa Gigante

Desconectado batman123

  • Colaborador
  • PIC10
  • *****
  • Mensajes: 46
RE: PROGRAMITA PARA PIC 16F884 EN PBP
« Respuesta #31 en: 11 de Noviembre de 2005, 20:28:00 »
FlashMUCHAS GRACIAS LORDFlash

No hay cosas imposibles  si no hombres incapaces

Desconectado batman123

  • Colaborador
  • PIC10
  • *****
  • Mensajes: 46
RE: PROGRAMITA PARA PIC 16F884 EN PBP
« Respuesta #32 en: 27 de Enero de 2006, 17:08:00 »
ESTE MENSAJE ES PARA PODER TENER MI FORO EN PRIMERA PAGUINA ..


FlashSUERTE Y FELIZ 2006Flash
No hay cosas imposibles  si no hombres incapaces

Desconectado batman123

  • Colaborador
  • PIC10
  • *****
  • Mensajes: 46
Re: PROGRAMITA PARA PIC 16F884 EN PBP
« Respuesta #33 en: 07 de Junio de 2011, 20:51:27 »
BUENO QUE NOSTALGIA ME DA VER ESTE  POST,.......
PUES LA VIDA ME IMPIDIÓ DEDICARME A LA ELECTRÓNICA, HORA ME DEDICO A OTRAS COSAS Y  Y MI TRABAJO ABSORVE TODO MI TIEMPO  PERO ESPERO PROGRAMAR DE NUEVO ALGÚN DÍA....
No hay cosas imposibles  si no hombres incapaces

Desconectado Noelillo

  • PIC12
  • **
  • Mensajes: 94
Re: PROGRAMITA PARA PIC 16F884 EN PBP
« Respuesta #34 en: 18 de Julio de 2011, 11:28:54 »
Código: [Seleccionar]
[code' Program to create telephone pad tone
' Oscillator must be set to 20MHz

DEVICE = 16F628a
        XTAL = 4
        ALL_DIGITAL = TRUE
        PORTB_PULLUPS = ON      ' Enable PORTB pull-ups

LCD_DTPIN = PORTb.4
LCD_RSPIN = PORTa.0
LCD_ENPIN = PORTa.2
LCD_INTERFACE = 4 ' 4-bit Interface
LCD_LINES = 2
LCD_TYPE = 0

' Define program variables
Dim Col         as  Byte            ' Keypad column
Dim Row         as  Byte            ' Keypad row
Dim Key         as  Byte            ' Key value
Dim Tone        as  Byte            ' Tone number
        dim XLCD        as  Byte
        dim YLCD        As  Byte
        dim Pitch       as  byte
        dim Clave       as  Byte
     
        dim Digitos     as  byte
       
        dim Posicion    as  byte
        dim Leer        as  byte
' Define program Symbol
        Symbol Altavoz  =     PORTa.1          ' Alias speaker pin
        Symbol Rele     =     porta.3
        symbol Led      =     porta.4
        'trisa=%11111111
           Delayms 50                      ' Estavilizacion LCD
 ' Comienza el programa ran-up       
 '********************1234567890123456       
        high    Led
        Print at 1,1,"Teclado / Clave "
        Print at 2,1,"IBERICA 2000/1.0"                         
        Delayms 2000
        low     led
        cls
 
         
Cero:        posicion = 0
             digitos = 0
             
Inicio:
'*********************************************************************************
'***  Lee EEprom para conprovar que la memoria
'***  no se a escrito nunca y pide clave nueva
'*********************************************************************************
       
        Leer = eread 0                  'LEE EL LA EEPROM LA POSICION CERO
        if Leer = $FF then Nueva        'COMPUEBA QUE VALE LA POSICION CERO
        goto vieja                      'SI VALE FF PIDE CLAVA NUEVA, SI NO VA A VIEJA
Nueva: 
        high    Led
 '********************1234567890123456
        Print at 1,1,"Leyendo Memoria "
        Print at 2,1," Codigo Activa  "   
        Delayms 2000
        cls
 '********************1234567890123456
        print at 1,1,"  Clave Nueva:  "
        print at 2,1,">              <"
        xlcd=2
        ylcd=2
Otra:                                   'SE GENERA UN BUCLE DE PARA INTRODUCIR 4 DIGITOS
        For digitos = 0 to 3
        Gosub Getkey
        Lookup Tone,["0123456789*0#"],Key'
        ewrite  Posicion,[key]          'GRABA EN LA EEPROM LAS TECLAS PULSADAS
        posicion = posicion +1          'INCREMENTA UNA POSICION EN LA EEPROM
        Print at Xlcd,ylcd, Key         'INPRIMA EL LA LCD LA TECLA PULSADA
        ylcd = ylcd +1                  'INCREMENTA CURSOR A LA DERECHA   
       
        Dtmfout Altavoz, [Tone]         'GENERA TONO DE GRABACION 
        Next                            'SALE DEL BUCLE
 '******************  1234567890123456       
        Print Cls, "CLAVE Grabada   "  '
        print at 2,1,"En Memoria EEPro"
        Dtmfout Altavoz, [12]
        Delayms 2000 
        cls
 Vieja:
        high    Led
 '******************  1234567890123456
        Print Cls, "  Teclea Clave"
        print at 2,1,">              <"
        xlcd = 2
        ylcd = 2
        Clave = 0
        Digitos  = 0
       ' Oprotunidad = 0
     
        Posicion = 0
Loop:   
        if  ylcd >= 17 then Inicio
        Gosub Getkey            ' Get a key from the keypad
        Leer = eread Posicion
        posicion = posicion + 1
        Lookup Tone,["0123456789*0#"],Key
        Print at Xlcd,ylcd,Key
        if  Leer = Key then Clave = Clave + 1
        ylcd = ylcd +1
        Dtmfout Altavoz, [Tone]
        if  ylcd = 6 then Compara
        Goto Loop                ' Do it forever
 Compara:
        if Clave = 4 Then Abre
 Cierra:
 '****************** 1234567890123456
        print cls , "Acceso Denegado"
        Dtmfout Altavoz, [3]
         Delayms 2000
         goto vieja
 Abre:  high Rele
        print Cls , "Acceso Permitido"
        For Pitch = 0 to 120
Sound Altavoz,[Pitch,1]
        Next
        Delayms 2000
        low Rele
        goto vieja   
' Subroutine to get a key from keypad
Getkey:
        Delayms 50                ' Debounce

Getkeyu:
        ' Wait for all keys up
        PORTB = 0                ' All output pins low
        TRISB = $f0              ' Bottom 4 pins out, top 4 pins in
        If (PORTB >> 4) <> $0F Then Getkeyu    ' If any keys down, loop

        Delayms 50                ' Debounce

Getkeyp:
        ' Wait for keypress
        For Col = 0 To 3        ' 4 columns in keypad
        PORTB = 0        ' All output pins low
        TRISB = (Dcd Col) ^ $FF ' Set one column pin to output
          Row = PORTB >> 4        ' Read row
          If Row <> $0F Then Gotkey       ' If any keydown, exit
        Next

        Goto Getkeyp            ' No keys down, go look again

' Change row and column to key number 0 - 15
Gotkey:
        Key = (Col * 3) + (Ncd (Row ^ $0F)) -1
        'Key = (Col * 3) + (Ncd (Row ^ $0F))
        ' Translate key to telephone keypad tone
        ' 10 = *
        ' 11 = #
        ' 12 = A
        ' 13 = B
        ' 14 = C
        ' 15 = D
        Lookup Key,[1,2,3,4,5,6,7,8,9,10,11,12],Tone
        Return                  ' Subroutine over

        End]

Desconectado batman123

  • Colaborador
  • PIC10
  • *****
  • Mensajes: 46
Re: PROGRAMITA PARA PIC 16F884 EN PBP
« Respuesta #35 en: 15 de Marzo de 2012, 14:57:54 »
muy bien


con ganas de regresar
No hay cosas imposibles  si no hombres incapaces


 

anything