Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/06/06 04:28
Read: times


 
#125871 - Got It Working
Responding to: ???'s previous message
Hi Kai,

I got the quarter stepping to work today. Thanks again for your help. The article you cited was interesting, but a little hint in the PBL3717A data sheet was what helped me the most. For anybody who cares, some code follows that shows one way to set up the I/O sequence tables.

-- Russ
 
/*  These macros correlate the L6219 signal names with their positions within
    Port 1.  Note that here we call the two windings 'A' and 'B' instead of '1'
    and '2' like the data sheet does.  */

#define A_I0    0x01                            /* Hardware dependent */
#define A_I1    0x02                            /* Hardware dependent */
#define A_Ph    0x04                            /* Hardware dependent */
#define B_I0    0x20                            /* Hardware dependent */
#define B_I1    0x10                            /* Hardware dependent */
#define B_Ph    0x08                            /* Hardware dependent */

/*  These macros give names to the various possible settings of the current
    control signals.  The numbers in the names indicate percent of full
    current.  */

#define A_0     (A_I0 | A_I1)			/* From the L6219 data sheet */
#define A_33    A_I1
#define A_67    A_I0
#define A_100   0

#define B_0     (B_I0 | B_I1)
#define B_33    B_I1
#define B_67    B_I0
#define B_100   0

/*  These macros give names to the directions of current flow in the two
    windings.  */

#define A_PLUS  A_Ph
#define A_MINUS 0

#define B_PLUS  B_Ph
#define B_MINUS 0

/*  This table specifies the sequencing of the I/O lines needed to make the
    motor move.  See the data sheet for the L6219 motor driver for details.  */

#if STEP_FULL                           /* Full stepping with 100% current */
static code char sequence[] = {
    A_MINUS | A_100  | B_MINUS | B_100,
    A_PLUS  | A_100  | B_MINUS | B_100,
    A_PLUS  | A_100  | B_PLUS  | B_100,
    A_MINUS | A_100  | B_PLUS  | B_100
    };
#endif

#if STEP_HALF                           /* Half stepping with 67% current */
static code char sequence[] = {
    A_MINUS | A_0    | B_PLUS  | B_67,
    A_PLUS  | A_67   | B_PLUS  | B_67,
    A_PLUS  | A_67   | B_PLUS  | B_0,
    A_PLUS  | A_67   | B_MINUS | B_67,
    A_PLUS  | A_0    | B_MINUS | B_67,
    A_MINUS | A_67   | B_MINUS | B_67,
    A_MINUS | A_67   | B_MINUS | B_0,
    A_MINUS | A_67   | B_PLUS  | B_67
    };
#endif

#if STEP_QUARTER                        /* Quarter stepping with 67% current */
static code char sequence[] = {
    A_MINUS | A_0    | B_PLUS  | B_67,
    A_PLUS  | A_33   | B_PLUS  | B_67,
    A_PLUS  | A_67   | B_PLUS  | B_67,
    A_PLUS  | A_67   | B_PLUS  | B_33,
    A_PLUS  | A_67   | B_PLUS  | B_0,
    A_PLUS  | A_67   | B_MINUS | B_33,
    A_PLUS  | A_67   | B_MINUS | B_67,
    A_PLUS  | A_33   | B_MINUS | B_67,
    A_PLUS  | A_0    | B_MINUS | B_67,
    A_MINUS | A_33   | B_MINUS | B_67,
    A_MINUS | A_67   | B_MINUS | B_67,
    A_MINUS | A_67   | B_MINUS | B_33,
    A_MINUS | A_67   | B_MINUS | B_0,
    A_MINUS | A_67   | B_PLUS  | B_33,
    A_MINUS | A_67   | B_PLUS  | B_67,
    A_MINUS | A_33   | B_PLUS  | B_67
    };
#endif
 




List of 4 messages in thread
TopicAuthorDate
Quarter Stepping with STM L6219 Motor Driver Chip            01/01/70 00:00      
   Read these links            01/01/70 00:00      
      Perfect!            01/01/70 00:00      
      Got It Working            01/01/70 00:00      

Back to Subject List