用ATF16V8B写的一个步进电机驱动,可是模拟出来一条水平线,帮看看。
大家帮看看有什么问题,我是新手大家多包涵。Name stepper;
Partno CA0018;
Date 12/19/99;
Revision02;
DesignerKahl;
Company Logical Devices, Inc.;
AssemblyNone;
LocationNone;
Device g16v8a;
/**Inputs**/
Pin 1 = clk; /* Counter clock */
Pin 2 = dir; /* Counter clear input */
Pin 11 = !oe; /* Register output enable */
/**Outputs**/
Pin = ; /* Counter outputs */
/** Declarations and Intermediate Variable Definitions **/
field count = ; /* declare counter bit field */
$define S0 'b'1110 /* define counter states */
$define S1 'b'1100
$define S2 'b'1101
$define S3 'b'1001
$define S4 'b'1011
$define S5 'b'0011
$define S6 'b'0111
$define S7 'b'0110
$define up 'b'1
$define down 'b'0
/** Logic Equations **/
Sequenced count { /* free running counter */
present S0 if up next S1;
if down next S7;
present S1 if up next S2;
if down next S0;
present S2 if up next S3;
if down next S1;
present S3 if up next S4;
if down next S2;
present S4 if up next S5;
if down next S3;
present S5 if up next S6;
if down next S4;
present S6 if up next S7;
if down next S5;
present S7 if up next S0;
if down next S6;
} 汗,就没有一个好心人?
页:
[1]