home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s199 / 1.img / MOTORDRV.ABL < prev    next >
Encoding:
Text File  |  1989-04-14  |  1.5 KB  |  61 lines

  1. module MOTORDRV
  2.  
  3. title' MOTOR DRIVER PAL1 '
  4.  
  5.          U1    device    'P16R4';
  6.  
  7.          A,B,C  pin 14,15,16;
  8.          P pin 2;
  9.          CLK pin 1;
  10.      E pin 11;
  11.  
  12. "Counter States
  13.          S0=^B001;S1=^B011;S2=^B010;
  14.          S3=^B110;S4=^B100;S5=^B101;
  15.      S6=^B111;S7=^B000;
  16.  
  17. State_diagram [A,B,C]
  18.          State S0:    case (P==1) : S1;
  19.                  (P==0) : S5;
  20.             endcase;
  21.          State S1:      case (P==1) : S2;
  22.                  (P==0) : S0;
  23.                         endcase;
  24.      State S2:    case (P==1) : S3;
  25.                      (P==0) : S1;
  26.                         endcase;
  27.      State S3:    case (P==1) : S4;
  28.                  (P==0) : S2;
  29.                         endcase;
  30.      State S4:    case (P==1) : S5;
  31.                  (P==0) : S3;
  32.                         endcase;
  33.      State S5:    case (P==1) : S0;
  34.                  (P==0) : S4;
  35.             endcase;
  36.      State S6:      case (P==1) : S3;
  37.                  (P==0) : S3;
  38.             endcase;
  39.          State S7:    case (P==1) : S1;
  40.                              (P==0) : S1;
  41.             endcase;
  42.  
  43. test_vectors ([CLK,P,E]->[A,B,C])
  44.               [.C.,1,0]->[1,1,0]; 
  45.               [.C.,1,0]->[1,0,0];
  46.           [.C.,1,0]->[1,0,1];
  47.           [.C.,1,0]->[0,0,1];
  48.               [.C.,1,0]->[0,1,1];
  49.           [.C.,1,0]->[0,1,0];
  50.           [.C.,1,0]->[1,1,0];
  51.           [.C.,1,0]->[1,0,0];
  52.           [.C.,1,0]->[1,0,1];
  53.           [.C.,1,0]->[0,0,1];
  54.               [.C.,0,0]->[1,0,1];
  55.           [.C.,0,0]->[1,0,0];
  56.           [.C.,0,0]->[1,1,0];
  57.           [.C.,0,0]->[0,1,0];
  58.           [.C.,0,0]->[0,1,1];
  59.           [.C.,0,0]->[0,0,1];       
  60. end MOTORDRV
  61.