Contador con Gal16v8 del 0-59 "segundos"(DUDAS)

Hola,el profesor nos pidió que hiciéramos un reloj con puras GAL16v8, actualmente ya tengo la programacion al 100% solo me falta simularlo bien en proteus, al conectar el contador del 0-9 sirve bien! pero... al conectar el otro display que llegara de 0-5 no sale como debe de ser.... LES explico! cuando cuenta 0,1,2,3,4,5,6,7,8... en el "8" manda el pulso al otro display y ya esta marcando 1 como se ve en la foto que les adjunte aqui abajito. PD: Se que estoy conectando mal algo en el proteus que manda el pulso cuando este el numero binario en 1000 = 8. Espero que me puedan ayudar!

contador 0-59 2.PNG
 
En el Proteus sería meter un inversor, pero es mas negocio hacerlo en el código

Por ejemplo, en tu código se puede usar el pin15 (definido como carry) y simplemente insertar la línea:

carry = !Q3 ;

Obviamente , ahora el clk de las decenas sale del pin15
 
En el Proteus sería meter un inversor, pero es mas negocio hacerlo en el código

Por ejemplo, en tu código se puede usar el pin15 (definido como carry) y simplemente insertar la línea:

carry = !Q3 ;

Obviamente , ahora el clk de las decenas sale del pin15



¿Quedaría así?

Código:
Name     Contador 0.6 ;
PartNo   00 ;
Date     30/07/2019 ;
Revision 01 ;
Designer Edgar ;
Company  Uppue ;
Assembly None ;
Location  ;
Device   g16v8a ;

/* *************** INPUT PINS *********************/
PIN   1  = clk                         ; /*                                 */
PIN   2  = dir                        ; /*                                 */

/* *************** OUTPUT PINS *********************/
PIN    19 = Q0                      ; /*                                 */
PIN    18 = Q1                    ; /*                                 */
PIN    17 = Q2                        ; /*                                 */
PIN    16 = Q3                        ; /*                                 */
PIN    15 = carry                        ; /*                                 */




field mode = [dir];
up = mode :0;
down = mode: 1;

field counter = [Q3,Q2, Q1, Q0];
$define p0 'b' 0000
$define p1 'b' 0001
$define p2 'b' 0010
$define p3 'b' 0011
$define p4 'b' 0100
$define p5 'b' 0101
$define p6 'b' 0110
$define p7 'b' 0111
$define p8 'b' 1000
$define p9 'b' 1001

sequenced counter
{
present p0 if up     next p1;
           if up     out carry;
           if down   next p5;

present p1 if up     next p2;
           if down   next p0;
           if up     out carry;

present p2 if up     next p3;
           if up     out carry;
           if down   next p1;

present p3 if up     next p4;
           if up     out carry;
           if down   next p2;

present p4 if up     next p5;
          if up     out carry;
           if down   next p3;

present p5 if up     next p0;
           if up     out carry;
           if down   next p4;
 
No, solamente escribí carry=!Q3; antes de sequenced counter (por ejemplo)

Vale... asi quedaria! como tu dices no?



Código:
Name     Contador 0.6 ;
PartNo   00 ;
Date     30/07/2019 ;
Revision 01 ;
Designer Edgar ;
Company  Uppue ;
Assembly None ;
Location  ;
Device   g16v8a ;

/* *************** INPUT PINS *********************/
PIN   1  = clk                         ; /*                                 */
PIN   2  = dir                        ; /*                                 */

/* *************** OUTPUT PINS *********************/
PIN    19 = Q0                      ; /*                                 */
PIN    18 = Q1                    ; /*                                 */
PIN    17 = Q2                        ; /*                                 */
PIN    16 = Q3                        ; /*                                 */





field mode = [dir];
up = mode :0;
down = mode: 1;

field counter = [Q3,Q2, Q1, Q0];
$define p0 'b' 0000
$define p1 'b' 0001
$define p2 'b' 0010
$define p3 'b' 0011
$define p4 'b' 0100
$define p5 'b' 0101
$define p6 'b' 0110
$define p7 'b' 0111
$define p8 'b' 1000
$define p9 'b' 1001

carry = !Q3;

sequenced counter
{
present p0 if up     next p1;       
           if down   next p5;

present p1 if up     next p2;
           if down   next p0;
          

present p2 if up     next p3;
           if up     out carry;
           if down   next p1;

present p3 if up     next p4;
           if down   next p2;

present p4 if up     next p5;
           if down   next p3;

present p5 if up     next p0;
           if down   next p4;
 
Tengo muchas dudas y creo que ya me sature, al parcer solo me faltan las horas en mi reloj pero no logro programarlo adecuadamente, intento ponerlo en 12 horas! espero que me puedan ayudar, Gracias, les dejo la imagen en proteus junto con sus codigos de cada GAL16v8

SIMULACIÓN con proteus.
PROGRAMACIÓN con wincupl.


horas.PNG


(Codigo que marcará de 0-1 en el display de arriba)

Código:
Código:
/* *************** INPUT PINS *********************/
PIN    1 = clk                         ; /*                                 */
PIN    2 = dir                       ; /*                                 */

/* *************** OUTPUT PINS *********************/
PIN  19   =  Q0                       ; /*                                 */
PIN  18   =  Q1                       ; /*                                 */
PIN  17   =  Q2                       ; /*                                 */
PIN  16   =  Q3                       ; /*                                 */


field mode = [dir];
up= mode:0;
down= mode:1;

field counter = [Q3, Q2, Q1, Q0];
$define p0  'b'  0000
$define p1  'b'  0001
$define p2  'b'  0010




sequenced counter
{
present p0 if up      next p1;
           if down    next p2;
          


present p1 if up      next  p2;
           if down    next  p0;
          
present p2 if up      next  p0;
           if down    next  p1;

}


CODIGO 0-9 DESPUES marcara un (0 como el 10), (1 como el 11) ,(2 como el 12).

Código:
Código:
/* *************** INPUT PINS *********************/
PIN    1 = clk                         ; /*                                 */
PIN    2 = dir                       ; /*                                 */

/* *************** OUTPUT PINS *********************/
PIN  19   =  Q0                       ; /*                                 */
PIN  18   =  Q1                       ; /*                                 */
PIN  17   =  Q2                       ; /*                                 */
PIN  16   =  Q3                       ; /*                                 */


field mode = [dir];
up= mode:0;
down= mode:1;

field counter = [Q3, Q2, Q1, Q0];
$define p0  'b'  0000
$define p1  'b'  0001
$define p2  'b'  0010
$define p3  'b'  0011
$define p4  'b'  0100
$define p5  'b'  0101
$define p6  'b'  0110
$define p7  'b'  0111
$define p8  'b'  1000
$define p9  'b'  1001
$define p10 'b'  1010
$define p11 'b'  1011
$define p12 'b'  1100




sequenced counter
{
present p0 if up      next p1;
           if down    next p12;
          

present p1 if up      next  p2;
           if down    next  p0;
          

present p2 if up      next  p3;
           if down    next  p1;
          
        
present p3 if up      next  p4;
           if down    next  p2;
          
        

present p4 if up      next  p5;
           if down    next  p3;
          

present p5 if up      next  p6;
           if down    next  p4;
          

present p6 if up      next  p7;
           if down    next  p5;
          

present p7 if up      next  p8;
           if down    next  p6;
          

present p8 if up      next  p9;
           if down    next  p7;
          

present p9 if up      next  p10;
           if up      next  p0;
           if down    next  p8;
          

present p10 if up    next  p1;
            if down  next  p9;
          

present p11 if up    next  p2;
            if down  next  p10;
          

present p12 if up    next  p0;
            if down  next  p11;
          


}
 
Atrás
Arriba