help for 12C508A


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2010
    Posts
    4

    Default help for 12C508A

    I am using a web-translator.... I need help to modify a program carried out on a PIC 12C508A.
    This PIC has 2 imputs and 1 exit
    When in the 2 imputs have a state "H",(at least one second)...,the output turn high state during 2 minutes.
    Then it returns to low state and it is awaiting that has been again high in the 2 imputs simultaneously.
    I would need that the entrances are GP5 and GP4
    The exit GP2
    Internal oscillator .....I don't need precision in the time
    I attach them the program that uiso at the moment and that it is necessary to modify
    Thank you

    #include <P12C508A.INC>

    ;__config 03f18h

    ;Declaración de variables.
    RetardoA equ 07h
    RetardoB equ 08h
    RetardoC equ 09h

    ;Vector de reset
    org 00h
    goto Inicio ;Ir a configurar los puertos.

    Delay35S
    movlw .200
    movwf RetardoA
    movlw .250
    movwf RetardoB
    movlw .250
    movwf RetardoC
    decfsz RetardoC,F
    goto $-1
    decfsz RetardoB,F
    goto $-5
    decfsz RetardoA,F
    goto $-9
    retlw 0

    ; Delay = 60 seconds
    ; Clock frequency = 4 MHz
    ; Actual delay = 60 seconds = 60000000 cycles
    ; Error = 0 %
    ; 59999994 cycles

    Delay60s
    movlw 0x23
    movwf RetardoA
    movlw 0xCB
    movwf RetardoB
    movlw 0x83
    movwf RetardoC
    Delay_0
    decfsz RetardoA, f
    goto $+2
    decfsz RetardoB, f
    goto $+2
    decfsz RetardoC, f
    goto Delay_0

    ;6 cycles
    goto $+1
    goto $+1
    goto $+1

    Inicio
    ;Configurar los puertos
    movlw b'00000011' ;GP0 y GP1 son entradas, el resto salidas.
    tris GPIO
    movlw b'11011111' ;T0CS-Timer0 se incrementa con cada ciclo interno, sino vuelve a GP2 una entrada
    option

    bcf GPIO,2 ;Apagar la salida GP2.
    Leer
    btfss GPIO,0 ;Entrada GP0 = 1 ?
    goto Leer ;No, volver a leer.
    btfss GPIO,1 ;Si, Entrada GP1 = 1 ?
    goto Leer ;No, volver a leer.

    bsf GPIO, 2 ;Si, activar la salida.
    call Delay60s ;Retardo de 60 segundos.
    call Delay60s ;Retardo de 60 segundos.
    bcf GPIO, 2 ;Apagar la salida.
    goto Leer ;Volver a leer las entradas.

    end

  2. #2
    Join Date
    Aug 2010
    Posts
    4


    Did you find this post helpful? Yes | No

    Default help

    ??? can nobody help me???

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Hello dagger, and welcome to the Pic Basic compiler forum.

    The forum here is made for folks that use PicBasicPro, a basic compiler. Most here don't feel as comfortable programming in assembly. Yes, there are some here that are pretty comfortable with assembly, but the majority are not.

    I am sure if you re-write it in PicBasic Pro, you will get a lot more help here. Maybe someone will still answer your original question, but probably less likely here than at the microchip forum.

    Good luck.

    Walter
    http://www.scalerobotics.com

  4. #4
    Join Date
    Aug 2010
    Posts
    4


    Did you find this post helpful? Yes | No

    Default help

    tx walter for your time

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts