MC3479 connections.

Arduino Interface MC3479 Stepper Motor Controller

by Lewis Loflin

The MC3479 is designed to drive a two-phase (bipolar) stepper motor. The circuit (see above) consists of four input sections, a logic decoding/sequencing section, two driver-stages for the motor coils. Here we will look at using the advanced features of the Mc3479 while over coming its limitations. The basic specs are as follows:

  • Single Supply Operation: 7.2 to 16.5 V
  • 350 mA/Coil Drive Capability
  • Clamp Diodes Provided for Back-EMF Suppression
  • Selectable CW/CCW and Full/Half Step Operation
  • Selectable High/Low Output Impedance (Half Step Mode)
  • TTL/CMOS Compatible Inputs

On the plus side the inputs can be standard TTL (5-volt logic) or CMOS, while the power supply must be at least 7-volts or the inputs won't operate correctly. Thus it's the power supply requirements that won't allow the use of 5-volt stepper motors. The 350 mA drive coil current is on the low side. That current can be controlled by the resistor Rb from a calculation in the spec sheet. The logic control circuits in the IC are powerful and work very well. The part is getting hard to find.

My goal here is to overcome these problems while using the power logic features of the Mc3479. By the use of opto-couplers we can get beyond the voltage and current limitations of this component while utilizing its advanced features. This includes operating both unipolar and bipolar stepper motors, which use the same switching codes anyway.

MC3479 universal stepper motor control diagram.
MC3479 universal stepper motor control diagram.

Opto coupler connections MC3479 to unipolar stepper motor

Opto coupler connections Mc3479 to unipolar stepper motor. If being used with a L298 module as shown in video connect each opto-coupler emitter to ground through a 1000 ohm resistor.

MC3479 package and electrical connections.
MC3479 package and electrical connections.

In the program below SW0 SW1 SW7 are simply connected through Arduino to the Mc3479 pins. A clock pulse is produced to whose speed is based on the values of a potentiometer connected to Analog pin 0.




/* Mc3479 Demo */


#define Sw0 3 // input sw0
#define Sw1 4  // Sw1 input 
#define Sw7 8  // Sw7 input

#define Mc3479_clk 10 // connect to Mc3479 pin 7
#define Mc3479_HF_step 12 // connect to Mc3479 pin 9
#define Mc3479_dir 11 // connect to Mc3479 pin 10 
#define Mc3479_enable 9
int temp;


void   setup() {
     pinMode(Sw0, INPUT);
     pinMode(Sw1, INPUT);
     pinMode(Sw7, INPUT);
     
     pinMode(Mc3479_clk, OUTPUT);
     pinMode(Mc3479_HF_step, OUTPUT);
     pinMode(Mc3479_dir, OUTPUT);
     pinMode(Mc3479_enable, OUTPUT);
     
     digitalWrite(Mc3479_clk, LOW);
     digitalWrite(Mc3479_HF_step, LOW);
     digitalWrite(Mc3479_dir, LOW);
     digitalWrite(Mc3479_enable, LOW);
     
   }
   
   void loop()   {
     
     
     temp = analogRead(0) / 2;
     toggle(Mc3479_clk);
     delay(3);
     toggle(Mc3479_clk);
     delay(temp);
    // read switch transfer to output
    digitalWrite(Mc3479_HF_step, digitalRead(Sw0));
     
    digitalWrite(Mc3479_dir, digitalRead(Sw1));
    
    digitalWrite(Mc3479_enable, digitalRead(Sw7));
    
   // steps(5000);
     
     
  }
  
  
  
  void steps(int j) {

    for(int i=0; i<j; i++)  {
      digitalWrite(Mc3479_clk,1);
      delay(3);
      digitalWrite(Mc3479_clk,0);
      delay(analogRead(0) / 2);
    }  // end for
    
  }  // end steps
  
    
 void toggle(int pinNum) {  

  int pinState = digitalRead(pinNum);
  pinState = !pinState;
  digitalWrite(pinNum, pinState); 
}

Added September 20, 2013:



Added June 7, 2013:

You Tube Arduino Microcontroller Video Series March 2012: