Autor Tema: retardos _pdel delayer  (Leído 3551 veces)

0 Usuarios y 2 Visitantes están viendo este tema.

Desconectado microcom

  • Colaborador
  • PIC24F
  • *****
  • Mensajes: 568
retardos _pdel delayer
« en: 09 de Octubre de 2006, 17:27:55 »
Código: ASM
  1. saludos
  2. caballeros el inconveniente que tengo en mano es que los retardos que programo con el pdel delayer que son 5seg; 3seg y 1seg no me estan dando como quiero y programo y nada. entonces no se cual sera el problema
  3. utilizo pic: 16f873A
  4. cristal: 4mhz
  5. condensadores:27pf
  6.  
  7. este es el programa es una secuencia de leds con tres tiempos diferentes.
  8. al precionar el ra2 solo prende el primer led y ahi se queda y no me atiende los otros pulsadores.
  9. el programa conta de 14 leds. 7 en portb y 7 en portc .
  10. gracias por la colabaracion.
  11.  
  12.  
  13.  
  14.  
  15.         LIST    p=16f873A
  16.                include"p16f873A.INC"
  17.                          
  18.  
  19.  
  20.  
  21. contador        EQU     23
  22. status  EQU     03
  23. porta   EQU     05
  24. portb   EQU     06
  25. portc   EQU     07
  26. adcon1  EQU     H'9F'
  27. PDel0   EQU     10
  28. PDel1   EQU     11
  29. PDel2   EQU     12
  30. PDel3   EQU     13  
  31. PDel4   EQU     14
  32. PDel5   EQU     15
  33. PDel6   EQU     16
  34.  
  35.  
  36. org     00
  37.          goto    inicio
  38.  
  39. tabla   ADDWF   PCL,1
  40.                 RETLW   B'00000001'    
  41.                 RETLW   B'00000010'    
  42.                 RETLW   B'00000100'    
  43.                 RETLW   B'00001000'    
  44.                 RETLW   B'00010000'    
  45.                 RETLW   B'00100000'    
  46.                 RETLW   B'01000000'    
  47. anti  
  48.         movlw     .248      ; 1 set number of repetitions
  49.         movwf     PDel0     ; 1 |
  50. PLoopR  clrwdt              ; 1 clear watchdog
  51.         decfsz    PDel0, 1  ; 1 + (1) is the time over?
  52.         goto      PLoopR   ; 2 no, loop
  53. PDelLM  goto PDelLL         ; 2 cycles delay
  54. PDelLL                ; 1 cycle delay
  55.         return              ; 2+2 Done
  56.  
  57.  
  58. retardo
  59.         movlw   .200
  60.         movwf   contador
  61. ggg     decfsz  contador,1
  62.         goto     ggg        
  63.         return
  64.  
  65.        
  66.  
  67. uno_seg  
  68.         movlw     .14       ; 1 set number of repetitions (C)
  69.         movwf     PDel0     ; 1 |
  70. PLoopx  movlw     .72       ; 1 set number of repetitions (B)
  71.         movwf     PDel1     ; 1 |
  72. PLoopy  movlw     .247      ; 1 set number of repetitions (A)
  73.         movwf     PDel2     ; 1 |
  74. PLoopz  clrwdt              ; 1 clear watchdog
  75.                  
  76.                 decfsz    PDel2, 1  ; 1 + (1) is the time over? (A)
  77.         goto      PLoopz    ; 2 no, loop
  78.         decfsz    PDel1,  1 ; 1 + (1) is the time over? (B)
  79.         goto      PLoopy    ; 2 no, loop
  80.         decfsz    PDel0,  1 ; 1 + (1) is the time over? (C)
  81.         goto      PLoopx    ; 2 no, loop
  82. PDelL1  goto PDelLx         ; 2 cycles delay
  83. PDelLx  clrwdt              ; 1 clear watchdog
  84.         return              ; 2+2 Done
  85.  
  86.  
  87. tres_seg  
  88.                 movlw     .67       ; 1 set number of repetitions (C)
  89.         movwf     PDel0     ; 1 |
  90. PLoop0  movlw     .91       ; 1 set number of repetitions (B)
  91.         movwf     PDel1     ; 1 |
  92. PLoop1  movlw     .122      ; 1 set number of repetitions (A)
  93.         movwf     PDel2     ; 1 |
  94. PLoop2  clrwdt             ; 1  clear watchdog
  95.                 decfsz    PDel2, 1  ; 1 + (1) is the time over? (A)
  96.         goto      PLoop2    ; 2 no, loop
  97.         decfsz    PDel1,  1 ; 1 + (1) is the time over? (B)
  98.         goto      PLoop1    ; 2 no, loop
  99.         decfsz    PDel0,  1 ; 1 + (1) is the time over? (C)
  100.         goto      PLoop0    ; 2 no, loop
  101. PDelL6  goto PDelL2         ; 2 cycles delay
  102. PDelL2  clrwdt              ; 1 cycle delay
  103.         return              ; 2+2 Done
  104.  
  105. cinco_seg  
  106.         movlw     .165      ;    1 set number of repetitions (C)
  107.         movwf     PDel0     ; 1 |
  108. PLoopv  movlw     .41       ; 1 set number of repetitions (B)
  109.         movwf     PDel1     ; 1 |
  110. PLoopw  movlw     .147      ; 1 set number of repetitions (A)
  111.         movwf     PDel2     ; 1 |
  112. PLoopm  clrwdt              ; 1 clear watchdog
  113.         clrwdt
  114.                 decfsz    PDel2, 1  ; 1 + (1) is the time over? (A)
  115.         goto      PLoopm    ; 2 no, loop
  116.         decfsz    PDel1,  1 ; 1 + (1) is the time over? (B)
  117.         goto      PLoopw    ; 2 no, loop
  118.         decfsz    PDel0,  1 ; 1 + (1) is the time over? (C)
  119.         goto      PLoopv    ; 2 no, loop
  120.         return              ; 2+2 Done
  121.  
  122.        
  123.  
  124.  
  125. inicio          bsf     status,5
  126.                 bcf     status,6
  127.                 movlw   07
  128.                 movwf   adcon1
  129.                 movlw   b'001111'
  130.                 movwf   porta
  131.                 clrf    portb
  132.                 clrf    portc
  133.                 bcf     status,5
  134.                 clrf    portb
  135.                 clrf    portc
  136.  
  137.  
  138. coveñas
  139.  
  140. empezar                                
  141.                 btfss     porta,0        
  142.                 goto      uno_rot
  143.                 call       anti
  144.                 btfss     porta,0
  145.                 goto    uno_rot    
  146.                 goto  fijo
  147. uno_rot         btfss     porta,1        
  148.                 goto     dos_rot
  149.                 call       anti
  150.                 btfss     porta,1    
  151.                 goto       dos_rot
  152.                 goto       primer_rot
  153.  
  154. dos_rot         btfss     porta,2        
  155.                 goto     tres_rot
  156.                 call      anti
  157.                 btfss     porta,2    
  158.                 goto      tres_rot
  159.                 goto      segundo_rot
  160.  
  161. tres_rot        btfss     porta,3        
  162.                 goto      empezar
  163.                 call      anti
  164.                 btfss     porta,3    
  165.                 goto      empezar
  166.                 goto      tercer_rot
  167.  
  168.  
  169.  
  170.  
  171. fijo            movlw   H'ff'
  172.                 movwf   portb
  173.                 movwf   portc
  174.                 call    retardo
  175.                 btfsc   porta,1
  176.                 goto    primer_rot    
  177.                 btfsc   porta,2
  178.                 goto    segundo_rot
  179.                 btfsc   porta,3
  180.                 goto    tercer_rot
  181.                 goto    fijo
  182.  
  183. primer_rot              clrf      contador
  184.                 clrf     portc
  185.                 clrf     portb
  186. repit                   movf       contador,0
  187.                 btfsc     porta,0
  188.                 goto      fijo    
  189.                         btfsc     porta,2
  190.                 goto   segundo_rot
  191.                 btfsc     porta,3
  192.                 goto    tercer_rot
  193.                 call      tabla
  194.                 movwf  portb
  195.                                 call      uno_seg
  196.                                 incf     contador,1
  197.                                 movlw  .7
  198.                 xorwf  contador,0
  199.                          btfss   status,2
  200.                 goto    repit
  201.                 clrf      portb
  202.                 clrf      contador
  203. ben             movf       contador,0
  204.                 btfsc     porta,0
  205.                 goto      fijo    
  206.                         btfsc     porta,2
  207.                 goto   segundo_rot
  208.                 btfsc     porta,3
  209.                 goto    tercer_rot
  210.                 call      tabla
  211.                 movwf  portc
  212.                 call      uno_seg
  213.                 incf     contador,1
  214.                 movlw  .7
  215.                 xorwf  contador,0
  216.                         btfss   status,2
  217.                 goto    ben
  218.                 goto    primer_rot
  219.  
  220.  
  221.  
  222.                                  
  223. segundo_rot     clrf      contador
  224.                 clrf      portc
  225.                 clrf     portb
  226. repit1          movf       contador,0
  227.                 btfsc     porta,0
  228.                 goto      fijo    
  229.                 btfsc     porta,1
  230.                 goto    primer_rot
  231.                 btfsc     porta,3
  232.                 goto    tercer_rot
  233.                 call      tabla
  234.                 movwf  portb
  235.                 call      tres_seg
  236.                 incf     contador,1
  237.                 movlw  .7
  238.                 xorwf  contador,0
  239.                 btfss   status,2
  240.                 goto     repit1
  241.                 clrf     portb
  242.                 clrf     contador
  243. ben99           movf       contador,0
  244.                 btfsc     porta,0
  245.                 goto      fijo    
  246.                 btfsc     porta,1
  247.                 goto    primer_rot
  248.                 btfsc     porta,3
  249.                 goto    tercer_rot
  250.                 call      tabla
  251.                 movwf  portc
  252.                call      tres_seg
  253.                 incf     contador,1
  254.                 movlw  .7
  255.                 xorwf  contador,0
  256.                                 btfss   status,2
  257.                 goto    ben99
  258.                 goto    segundo_rot                                              
  259.  
  260.  
  261.  
  262.  
  263.  
  264. tercer_rot      clrf      contador
  265.                 clrf     portc
  266.                 clrf     portb
  267. repit2          movf     contador,0
  268.                 btfsc    porta,0
  269.                 goto     fijo    
  270.                 btfsc    porta,1
  271.                 goto    primer_rot
  272.                 btfsc   porta,2
  273.                 goto    segundo_rot
  274.                 call    tabla
  275.                 movwf   portb
  276.                 call      cinco_seg
  277.                 incf     contador,1
  278.                 movlw  .7
  279.                 xorwf  contador,0
  280.                 btfss   status,2
  281.                 goto     repit2
  282.                 clrf    contador
  283.                 clrf    portb  
  284. ben999          movf       contador,0
  285.                 btfsc     porta,0
  286.                 goto      fijo    
  287.                 btfsc     porta,1
  288.                 goto    primer_rot
  289.                 btfsc     porta,2
  290.                 goto    segundo_rot
  291.                 call      tabla
  292.                 movwf  portc
  293.                 call      cinco_seg
  294.                 incf     contador,1
  295.                 movlw  .7
  296.                 xorwf  contador,0
  297.                 btfss   status,2
  298.                 goto   ben999
  299.                 goto    tercer_rot                                              
  300.                
  301.                 end
« Última modificación: 10 de Octubre de 2006, 02:30:51 por BrunoF »

Desconectado Modulay

  • Moderadores
  • DsPIC30
  • *****
  • Mensajes: 2651
Re: retardos _pdel delayer
« Respuesta #1 en: 09 de Octubre de 2006, 18:49:14 »
Pero hombre,usa la herramienta "código",que el lo quiera leer se va a dejar la vista

Desconectado microcom

  • Colaborador
  • PIC24F
  • *****
  • Mensajes: 568
Re: retardos _pdel delayer
« Respuesta #2 en: 09 de Octubre de 2006, 18:54:11 »
Pero hombre,usa la herramienta "código",que el lo quiera leer se va a dejar la vista

caballero como asi...........

gracias

Desconectado Modulay

  • Moderadores
  • DsPIC30
  • *****
  • Mensajes: 2651
Re: retardos _pdel delayer
« Respuesta #3 en: 09 de Octubre de 2006, 19:01:53 »
Para un código bien puesto,legible y entendible.Echa un ojo a la imagen

Desconectado microcom

  • Colaborador
  • PIC24F
  • *****
  • Mensajes: 568
Re: retardos _pdel delayer
« Respuesta #4 en: 09 de Octubre de 2006, 19:48:04 »
Para un código bien puesto,legible y entendible.Echa un ojo a la imagen


caballero ya estä

gracias

Desconectado microcom

  • Colaborador
  • PIC24F
  • *****
  • Mensajes: 568
Re: retardos _pdel delayer
« Respuesta #5 en: 09 de Octubre de 2006, 20:05:16 »
caballeros sigo programando y nada sigue el problema del retardo ;supuestamente el retardo es el calculado
yo programé el pic 16f84a con el mismo retardo y mas o menos me daba el retardo deseado.


pero para el pic 16f873a
los leds son grandes y de luz a chorro. estan siendo alimentados desde la salida de pic con resis de 100ohm
al presionar el rao si me prenden todos los leds y eso esta bien.
al presionar ra1 un segundo no esta dando es mas rapido
al presionar ra2 prende el primer led y ahi se queda y no se atiende los demas pulsadores.
al presionar ra3 el tiempo no es 5seg

gracias  por la atencion prestada.
« Última modificación: 09 de Octubre de 2006, 20:17:33 por microcom »

Desconectado Veguepic

  • Moderadores
  • PIC24H
  • *****
  • Mensajes: 2119
Re: retardos _pdel delayer
« Respuesta #6 en: 09 de Octubre de 2006, 20:45:35 »
Podrias  en vez de poner rutinas diferentes para cada caso 1, 3 y 5 segundos usar una unica rutina, la de 1 segundo y repetir la llamada 3 veces para 3 segundos y 5 para 5 segundos.

Ahorras algunas lineas y solo tendrias una rutina para la demora.

Cuando tiempo te estan durando las rutinas?

No veo los fuses, como los estas poniendo?

Saludos

P.D.  segun la hoja tecnica, para cristal de 4 MHz recomienda condensadores de 15 pf, segun recuerdo no te debe dar una variacion muy grande, a lo sumo unos 100Hz por MHz segun recuerdo.
« Última modificación: 09 de Octubre de 2006, 21:04:20 por veguepic »
“Si la gente es buena sólo porque temen al castigo y porque esperan una recompensa, entonces verdaderamente somos un grupo lastimoso." Albert Einstein.

Saludos desde Lima , Peru    -    Hugo

Desconectado BrunoF

  • Administrador
  • DsPIC30
  • *******
  • Mensajes: 3865
Re: retardos _pdel delayer
« Respuesta #7 en: 10 de Octubre de 2006, 04:51:28 »
Hola microcom.
Tu principal problema es que declaraste los registros en posiciones de memoria reservada para los SFR(Special File Register).
Siempre recuerda que en estos micros 16F87XX la primera posicion para registros de proposito general(GPR) es la 0x20.

Aqui te dejo el programa que pasaste un poco modificado para que lo pruebes.

Saludos.
"All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value."  -- Carl Sagan

Sólo responderé a mensajes personales, por asuntos personales. El resto de las consultas DEBEN ser escritas en el foro público. Gracias.

Desconectado microcom

  • Colaborador
  • PIC24F
  • *****
  • Mensajes: 568
Re: retardos _pdel delayer
« Respuesta #8 en: 10 de Octubre de 2006, 20:01:00 »
caballero no he podido bajar el programa podrias pasarlo como yo lo pasé, porque yo no lo he podido bajar en .ar.



la verdad se me habia olvidado de las direcciones generales desde el 0x20.

¿cuando uno dectreta los registros generales el posicion como lo tengo, que concecuencias trae?
boy a probar para ver si resulvo el problema.

gracias por la atencion pretada caballeros .


veguepic :
los retardos son como menos de un segundo.
los fuses los desactivo todos menos el power up

saludos.
« Última modificación: 10 de Octubre de 2006, 20:04:41 por microcom »

Desconectado BrunoF

  • Administrador
  • DsPIC30
  • *******
  • Mensajes: 3865
Re: retardos _pdel delayer
« Respuesta #9 en: 10 de Octubre de 2006, 22:57:21 »
Hola microcom. Eso depende de las posiciones que afectes.
Deberias fijarte en el datasheet cuales registros afectan tus variables en el programa q posteaste, y razonar a que consecuencias perjuduciales para el funcionamiento conlleva.

Código: ASM
  1. LIST    p=16f873A
  2.                 include "p16f873A.INC"
  3.  
  4.                 __CONFIG        _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _LVP_OFF & _XT_OSC
  5.  
  6.                 ERRORLEVEL      -302
  7.  
  8. contador        EQU     0x20
  9. PDel0           EQU     0x21
  10. PDel1           EQU     0x22
  11. PDel2           EQU     0x23
  12. PDel3           EQU     0x24
  13.  
  14.                 org     0x00
  15.                 goto    inicio
  16.  
  17. tabla           ADDWF   PCL,1
  18.                 RETLW   B'00000001'    
  19.                 RETLW   B'00000010'    
  20.                 RETLW   B'00000100'    
  21.                 RETLW   B'00001000'    
  22.                 RETLW   B'00010000'    
  23.                 RETLW   B'00100000'    
  24.                 RETLW   B'01000000'    
  25.  
  26. inicio
  27.                 movlw   .1
  28.                 call    DEMORA
  29.  
  30.                 bcf     STATUS,RP1
  31.                 bsf     STATUS,RP0
  32.                 movlw   0x06
  33.                 movwf   ADCON1
  34.                 movlw   0x0F
  35.                 movwf   PORTA
  36.                 clrf    PORTB
  37.                 clrf    PORTC
  38.                 bcf     STATUS,RP0
  39.  
  40.                 clrf    PORTB
  41.                 clrf    PORTC
  42.  
  43.                 ERRORLEVEL      +302
  44.  
  45. empezar                                
  46.                 btfss   PORTA,0        
  47.                 goto    uno_rot
  48.  
  49.                 call    anti
  50.                 btfss   PORTA,0
  51.                 goto    uno_rot    
  52.  
  53.                 goto    fijo
  54. uno_rot         btfss   PORTA,1        
  55.                 goto    dos_rot
  56.  
  57.                 call    anti
  58.                 btfss   PORTA,1    
  59.                 goto    dos_rot
  60.  
  61.                 goto    primer_rot
  62. dos_rot         btfss   PORTA,2        
  63.                 goto    tres_rot
  64.  
  65.                 call    anti
  66.                 btfss   PORTA,2    
  67.                 goto    tres_rot
  68.  
  69.                 goto    segundo_rot
  70.  
  71. tres_rot        btfss   PORTA,3        
  72.                 goto    empezar
  73.  
  74.                 call    anti
  75.                 btfss   PORTA,3    
  76.                 goto    empezar
  77.  
  78.                 goto    tercer_rot
  79.  
  80.  
  81. fijo            movlw   H'ff'
  82.                 movwf   PORTB
  83.                 movwf   PORTC
  84.                 call    retardo
  85.                 btfsc   PORTA,1
  86.                 goto    primer_rot    
  87.  
  88.                 btfsc   PORTA,2
  89.                 goto    segundo_rot
  90.  
  91.                 btfsc   PORTA,3
  92.                 goto    tercer_rot
  93.  
  94.                 goto    fijo
  95.  
  96. primer_rot      clrf    contador
  97.                 clrf    PORTC
  98.                 clrf    PORTB
  99. repit           btfsc   PORTA,0
  100.                 goto    fijo    
  101.  
  102.                 btfsc   PORTA,2
  103.                 goto    segundo_rot
  104.  
  105.                 btfsc   PORTA,3
  106.                 goto    tercer_rot
  107.  
  108.                 movf    contador,W
  109.                 call    tabla
  110.                 movwf   PORTB
  111.                 movlw   .1
  112.                 call    DEMORA
  113.                 incf    contador,F
  114.                 movlw   .7
  115.                 xorwf   contador,W
  116.                 btfss   STATUS,Z
  117.                 goto    repit
  118.  
  119.                 clrf    PORTB
  120.                 clrf    contador
  121.  
  122. ben             btfsc   PORTA,0
  123.                 goto    fijo    
  124.  
  125.                 btfsc   PORTA,2
  126.                 goto    segundo_rot
  127.  
  128.                 btfsc   PORTA,3
  129.                 goto    tercer_rot
  130.  
  131.                 movf    contador,W
  132.                 call    tabla
  133.                 movwf   PORTC
  134.                 movlw   .1
  135.                 call    DEMORA
  136.                 incf    contador,F
  137.                 movlw   .7
  138.                 xorwf   contador,W
  139.                 btfss   STATUS,Z
  140.                 goto    ben
  141.  
  142.                 goto    primer_rot
  143.  
  144.  
  145.  
  146.                                  
  147. segundo_rot     clrf    contador
  148.                 clrf    PORTC
  149.                 clrf    PORTB
  150. repit1
  151.                 btfsc   PORTA,0
  152.                 goto    fijo    
  153.  
  154.                 btfsc   PORTA,1
  155.                 goto    primer_rot
  156.  
  157.                 btfsc   PORTA,3
  158.                 goto    tercer_rot
  159.  
  160.                 movf    contador,W
  161.                 call    tabla
  162.                 movwf   PORTB
  163.                 movlw   .3
  164.                 call    DEMORA
  165.                 incf    contador,F
  166.                 movlw   .7
  167.                 xorwf   contador,W
  168.                 btfss   STATUS,Z
  169.                 goto    repit1
  170.  
  171.                 clrf    PORTB
  172.                 clrf    contador
  173. ben99
  174.                 btfsc   PORTA,0
  175.                 goto    fijo    
  176.  
  177.                 btfsc   PORTA,1
  178.                 goto    primer_rot
  179.  
  180.                 btfsc   PORTA,3
  181.                 goto    tercer_rot
  182.  
  183.                 movf    contador,W
  184.                 call    tabla
  185.                 movwf   PORTC
  186.                 movlw   .3
  187.                 call    DEMORA
  188.                 incf    contador,F
  189.                 movlw   .7
  190.                 xorwf   contador,W
  191.                 btfss   STATUS,Z
  192.                 goto    ben99
  193.  
  194.                 goto    segundo_rot
  195.  
  196.  
  197.  
  198.  
  199.  
  200. tercer_rot      clrf    contador
  201.                 clrf    PORTC
  202.                 clrf    PORTB
  203. repit2
  204.                 btfsc   PORTA,0
  205.                 goto    fijo    
  206.  
  207.                 btfsc   PORTA,1
  208.                 goto    primer_rot
  209.  
  210.                 btfsc   PORTA,2
  211.                 goto    segundo_rot
  212.  
  213.                 movf    contador,W
  214.                 call    tabla
  215.                 movwf   PORTB
  216.                 movlw   .5
  217.                 call    DEMORA
  218.                 incf    contador,F
  219.                 movlw   .7
  220.                 xorwf   contador,W
  221.                 btfss   STATUS,Z
  222.                 goto    repit2
  223.  
  224.                 clrf    contador
  225.                 clrf    PORTB  
  226. ben999
  227.                 btfsc   PORTA,0
  228.                 goto    fijo    
  229.  
  230.                 btfsc   PORTA,1
  231.                 goto    primer_rot
  232.  
  233.                 btfsc   PORTA,2
  234.                 goto    segundo_rot
  235.  
  236.                 movf    contador,W
  237.                 call    tabla
  238.                 movwf   PORTC
  239.                 movlw   .5
  240.                 call    DEMORA
  241.                 incf    contador,F
  242.                 movlw   .7
  243.                 xorwf   contador,W
  244.                 btfss   STATUS,Z
  245.                 goto    ben999
  246.  
  247.                 goto    tercer_rot
  248.  
  249. ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  250.  
  251. anti  
  252.                 movlw   .248
  253.                 movwf   PDel0          
  254. PLoopR          clrwdt
  255.                 decfsz  PDel0, F
  256.                 goto    PLoopR
  257.  
  258. PDelLM          goto    PDelLL
  259. PDelLL          return
  260.  
  261. ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  262.  
  263.  
  264. retardo
  265.                 movlw   .200
  266.                 movwf   contador
  267. ggg             decfsz  contador,1
  268.                 goto    ggg        
  269.  
  270.                 return
  271.  
  272. ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  273.  
  274.  
  275. DEMORA          movwf   PDel3
  276. PLoopX          movlw   .14       ; 1 set numero de repeticion  (C)
  277.                 movwf   PDel0     ; 1 |
  278. PLoop0          movlw   .72       ; 1 set numero de repeticion  (B)
  279.                 movwf   PDel1     ; 1 |
  280. PLoop1          movlw   .247      ; 1 set numero de repeticion  (A)
  281.                 movwf   PDel2     ; 1 |
  282. PLoop2          clrwdt            ; 1 clear watchdog
  283.                 decfsz  PDel2,F   ; 1 + (1) es el tiempo 0  ? (A)
  284.                 goto    PLoop2    ; 2 no, loop
  285.  
  286.                 decfsz  PDel1,F   ; 1 + (1) es el tiempo 0  ? (B)
  287.                 goto    PLoop1    ; 2 no, loop
  288.  
  289.                 decfsz  PDel0,F   ; 1 + (1) es el tiempo 0  ? (C)
  290.                 goto    PLoop0    ; 2 no, loop
  291.  
  292. PDelL2          decfsz  PDel3,F   ; 1 ciclo delay
  293.                 goto    PLoopX
  294.  
  295.                 return            ; 2+2 Fin.
  296.  
  297. ;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  298.  
  299.                 END
"All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value."  -- Carl Sagan

Sólo responderé a mensajes personales, por asuntos personales. El resto de las consultas DEBEN ser escritas en el foro público. Gracias.

Desconectado BrunoF

  • Administrador
  • DsPIC30
  • *******
  • Mensajes: 3865
Re: retardos _pdel delayer
« Respuesta #10 en: 10 de Octubre de 2006, 23:07:35 »
En tu programa tal cual lo pusiste:

Código: ASM
  1. PDel0   EQU     10
  2. PDel1   EQU     11
  3. PDel2   EQU     12
  4. PDel3   EQU     13  
  5. PDel4   EQU     14
  6. PDel5   EQU     15
  7. PDel6   EQU     16


Es en realidad lo mismo que decir esto:

Código: ASM
  1. PDel0   EQU     T1CON
  2. PDel1   EQU     TMR2
  3. PDel2   EQU     T2CON
  4. PDel3   EQU     SSPBUF
  5. PDel4   EQU     SSPCON
  6. PDel5   EQU     CCPR1L
  7. PDel6   EQU     CCPR1H
"All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value."  -- Carl Sagan

Sólo responderé a mensajes personales, por asuntos personales. El resto de las consultas DEBEN ser escritas en el foro público. Gracias.

Desconectado microcom

  • Colaborador
  • PIC24F
  • *****
  • Mensajes: 568
Re: retardos _pdel delayer
« Respuesta #11 en: 11 de Octubre de 2006, 19:57:10 »
caballero  bruno F las cuentas que hago son inmensas para agradecer la ayuda prestada en este inconveniente; cambié las posiciones generales de los registros empezando por el 0x20 y todo empezo como lo queria ya todo esta bajo control.

la verdad este error no lo habia cometido en anteriores programas  pero para este se me fueron las luces y gracias a usted pude resolverlo.

casi dudo de lo poco que se de pic por culpa de este error.

de antemano gracias

saludos desde sucre.
« Última modificación: 11 de Octubre de 2006, 19:59:40 por microcom »

Desconectado BrunoF

  • Administrador
  • DsPIC30
  • *******
  • Mensajes: 3865
Re: retardos _pdel delayer
« Respuesta #12 en: 11 de Octubre de 2006, 20:15:44 »
Pues no hay nada que agradecer, que para eso aquí nos reunimos: para ayudarnos :mrgreen:

Lamentablemente, luego de varios años programando PICs he llegado a la (terrible) conclusión que el 99.99% de los errores son de la persona que programa, y no de los PICs.

Pero bueno, todos nos cegamos a veces con detalles que una vez resueltos parecen básicos pero uno cuando se ciega...difícil se hace ver la luz por uno mísmo... :D

Saludos.
"All of the books in the world contain no more information than is broadcast as video in a single large American city in a single year. Not all bits have equal value."  -- Carl Sagan

Sólo responderé a mensajes personales, por asuntos personales. El resto de las consultas DEBEN ser escritas en el foro público. Gracias.


 

anything