AVR and C Programming Final
AVR and C Programming Final
1. Introduction to Microcontrollers
5. 4*3 Keypad
9. Stepper Motor
a. Normal mode
b. CTC mode
Microprocessor To Memory
interface
Microcontroller Definition
y A microcontroller is a device which integrates a
number of the components of a microprocessor
system onto a single microchip.
Block diagram
y Advanced peripherals include:
Block Diagram
Why use a microcontroller?
y Reduce chip count
Since all AVR instructions are 16 or 32 bits wide, the Flash is organized as 4K x 16.
The 608 (000 to 25F Hexadecimal) Data Memory locations address the Register File,
the I/O Memory, and the internal data SRAM.
The first 96 (000 to 05F Hexadecimal) locations address the Register File and I/O
Memory
All ATmega8535 I/Os and peripherals are placed in the I/O space.
AVR Pins
VCC (Pin 10) +5V of the power supply should be connected to this pin
GND(Pin 11) 0V of the power supply should be connected to this pin
XTAL2 Oscillator I/P and O/P
XTAL1 pins (used to connect
crystals or other
sources).
AVCC (Pin 30) +5V for supplying the ADC on PORTA should be connected to this pin
GND (Pin 31) 0V for supplying the ADC on PORTA should be connected to this pin
AREF Reference voltage for the ADC on PORTA
Note:
The ATMEGA8535 has an internal oscillator that runs from 1 MHz to 8 MHz and can
be configured to use it or override it and use external oscillators like crystals.
The choice can be done by programming fuses of the controller which has many other
functions like protection.
Major fuses
1- lock bits
2- clock options fuses (CKSEL3- CKSEL2- CKSEL1- CKSEL0)
I/O-Ports
All AVR ports have true Read-Modify-Write functionality when used as general digital I/O
ports. This means that the direction of one port pin can be changed without unintentionally
changing the direction of any other pin
Three I/O memory address locations are allocated for each port, one each for the Data
Register – PORTx, Data Direction Register – DDRx, and the Port Input Pins – PINx.
The Port Input Pins I/O location is read only, while the Data Register and the Data Direction
Register are read/write.
while(1)
{
a = PINA;
delay_ms(100);
b = PINB;
delay_ms(100);
c = a+b;
delay_ms(100);
PORTC = c;
}
}
Page 1
R9 R10 R11 R12 R13 R14 R15 R16
R8 R7 R6 R5 R4 R3 R2 R1 330R 330R 330R 330R 330R 330R 330R 330R
330R 330R 330R 330R 330R 330R 330R 330R
DSW1 U1 DSW2
OFF ON OFF ON
16 1 1 40 16 1
PB0/T0/XCK PA0/ADC0
15 2 2 39 15 2
PB1/T1 PA1/ADC1
14 3 3 38 14 3
PB2/AIN0/INT2 PA2/ADC2
13 4 4 37 13 4
PB3/AIN1/OC0 PA3/ADC3
12 5 5 36 12 5
PB4/SS PA4/ADC4
11 6 6 35 11 6
PB5/MOSI PA5/ADC5
10 7 7 34 10 7
PB6/MISO PA6/ADC6
9 8 8 33 9 8
PB7/SCK PA7/ADC7
DIPSW_8 14 22 DIPSW_8
PD0/RXD PC0/SCL
15 23
PD1/TXD PC1/SDA
16 24
PD2/INT0 PC2
17 25
PD3/INT1 PC3
18 26
PD4/OC1B PC4
19 27
PD5/OC1A PC5
20 28
PD6/ICP1 PC6/TOSC1
21 29
PD7/OC2 PC7/TOSC2
13
XTAL1
12 32
XTAL2 AREF
9 30
RESET AVCC
ATMEGA8535
LCD Functions
The LCD Functions are intended for easy interfacing between C programs and alphanumeric
LCD modules built with the Hitachi HD44780 chip or equivalent.
The prototypes for these functions are placed in the file lcd.h located in the ..\INC subdirectory.
This files must be #include ‐ed before using the functions.
Prior to #include ‐ing the lcd.h file, you must declare which microcontroller port is used for
communication with the LCD module.
Example:
/* the LCD module is connected to PORTC */
#asm
.equ __lcd_port=0x15
#endasm
/* now you can include the LCD Functions */
#include <lcd.h>
The following LCD formats are supported in lcd.h: 1x8, 2x12, 3x12, 1x16, 2x16, 2x20, 4x20, 2x24
and 2x40 characters.
The LCD module must be connected to the port bits as follows:
[LCD] [AVR Port]
RS (pin4) Bit 0
RD (pin 5) Bit 1
EN (pin 6) Bit2
DB4 (pin 11) Bit 4
DB5 (pin 12) Bit 5
DB6 (pin 13) Bit 6
DB7 (pin 14) Bit 7
You must also connect the LCD power supply and contrast control voltage, according to the
data sheet.
lcd.c
#asm
.equ __lcd_port=0x12 ;PORTd
#endasm
// include the LCD driver routines
#include <LCD.H>
#include <mega8535.h>
#include <delay.h>
#include <stdlib.h>
void main(void)
{
unsigned long int temp=0 ;
char str[25];
lcd_init(16);
lcd_putsf(" Hello");
delay_ms(1000);
lcd_clear();
lcd_gotoxy(0,1);
temp = 512;
ltoa(temp, str);
lcd_puts(str);
Page 1
LCD1
LM016L
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
U1
E
1 40
PB0/T0/XCK PA0/ADC0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2 39
PB1/T1 PA1/ADC1
3 38
PB2/AIN0/INT2 PA2/ADC2
4 37
PB3/AIN1/OC0 PA3/ADC3
5 36
PB4/SS PA4/ADC4
6 35
PB5/MOSI PA5/ADC5
7 34
PB6/MISO PA6/ADC6
8 33
PB7/SCK PA7/ADC7
14 22
R1
PD0/RXD PC0/SCL
15 23 330R
PD1/TXD PC1/SDA
16 24
PD2/INT0 PC2
17 25
18
PD3/INT1 PC3
26
R2
PD4/OC1B PC4
19 27 330R
3
PD5/OC1A PC5
20 28
PD6/ICP1 PC6/TOSC1 R3
21
PD7/OC2 PC7/TOSC2
29
330R
A
1 2 3
13
12
XTAL1
32
R4
XTAL2 AREF
9
RESET AVCC
30 330R
R5
B
4 5 6
ATMEGA8535
330R
R6 C
7 8 9
330R
R7
330R
D
0 #
keypad.c
#asm
.equ __lcd_port=0x12 ;PORTd
#endasm
// include the LCD driver routines
#include <LCD.H>
#include <mega8535.h>
#include <delay.h>
#include <stdlib.h>
#include <keys.h>
void main(void)
{
unsigned long int temp=0 ;
char str[25];
lcd_init(16);
lcd_putsf("Enter Number");
//delay_ms(1000);
//lcd_clear();
temp=getkey();
Page 1
Interrupts
Execution of a program happens serially. Commands are executed one by one; processors
can handle a single task at a time.
Interrupts are internal or external events asynchronous with the main program flow that
when they trigger, they get the microcontroller's attention.
We do not know in advance when they will occur, we just define how they are going to
be serviced.
When an interrupt signal occurs, the interrupt service routine (ISR) is executed
asynchronously with the main flow and then normal execution carries on.
There are many different sources of interrupts and each one has a corresponding ISR. The
micro has to know which event triggers which ISR so it needs a table (the vector table).
It looks at the vector table, it jumps to the indicated ISR, it executes it and then returns
back to the main program flow.
At the end of the procedure the compiler generates a RETI instruction automatically.
The Global Interrupt Enable bit must be set for the interrupts to be
enabled.
The individual interrupt enable control is then performed in separate
control registers.
The I bit is cleared by hardware after an interrupt has occurred, and is set
by the RETI instruction to enable subsequent interrupts.
The I bit can also be set and cleared by the software with the SEI and CLI
instructions.
External Interrupts
The External Interrupts are triggered by the INT0, INT1, and INT2 pins.
The External Interrupts can be triggered by a falling or rising edge or a low level
(INT2 is only an edge triggered interrupt).
When the External Interrupt is enabled and is configured as level triggered (only
INT0/INT1), the interrupt will trigger as long as the pin is held low.
The External Interrupt 1 is activated by the external pin INT1 if the SREG I-bit and the
corresponding interrupt mask in the GICR are set.
The level and edges on the external INT1 pin that activate the interrupt are defined in the
next Table.
If edge or toggle interrupt is selected, pulses that last longer than one clock period will
generate an interrupt. Shorter pulses are not guaranteed to generate an interrupt.
If low level interrupt is selected, the low level must be held until the completion of the
currently executing instruction to generate an interrupt.
The External Interrupt 0 is activated by the external pin INT0 if the SREG I-flag and the
corresponding interrupt mask are set.
If ISC2 is written to zero, a falling edge on INT2 activates the interrupt. If ISC2 is written
to one, a rising edge on INT2 activates the interrupt.
Pulses on INT2 wider than the minimum pulse width will generate an interrupt. Shorter
pulses are not guaranteed to generate an interrupt.
General Interrupt Control Register – GICR
Activity on the pin will cause an interrupt request even if INT1 is configured as an output.
The corresponding interrupt of External Interrupt Request 1 is executed from the INT1
Interrupt Vector.
When the INT0 bit is set (one) and the I-bit in the Status Register (SREG) is set (one), the
external pin interrupt is enabled.
The Interrupt Sense Control0 bits 1/0 (ISC01 and ISC00) in the MCU General Control
Register (MCUCR) define whether the external interrupt is activated on rising and/or
falling edge of the INT0 pin or level sensed.
Activity on the pin will cause an interrupt request even if INT0 is configured as an
output.
The corresponding interrupt of External Interrupt Request 0 is executed from the INT0
Interrupt Vector.
The Interrupt Sense Control2 bit (ISC2) in the MCU Control and Status Register
(MCUCSR) defines whether the external interrupt is activated on the rising or falling
edge of the INT2 pin.
Activity on the pin will cause an interrupt request even if INT2 is configured as an
output.
The corresponding interrupt of External Interrupt Request 2 is executed from the INT2
Interrupt Vector.
When an edge or logic change on the INT1 pin triggers an interrupt request, INTF1
becomes set (one).
If the I-bit in SREG and the INT1 bit in GICR are set (one), the MCU will jump to the
corresponding Interrupt Vector.
The flag is cleared when the interrupt routine is executed. Alternatively, the flag can be
cleared by writing a logical one to it.
If the I-bit in SREG and the INT0 bit in GICR are set (one), the MCU will jump to the
corresponding Interrupt Vector.
The flag is cleared when the interrupt routine is executed. Alternatively, the flag can be
cleared by writing a logical one to it.
If the I-bit in SREG and the INT2 bit in GICR are set (one), the MCU will jump to the
corresponding
Interrupt Vector. The flag is cleared when the interrupt routine is executed.
Alternatively, the flag can be cleared by writing a logical one to it.
int.c
#include <delay.h>
#include <mega8535.h>
interrupt [2] void INT0(void)
{
PORTC= 0xFF;
delay_ms(600);
PORTC= 0x99;
delay_ms(600);
//GIFR!=0x40;
}
void main()
{
DDRC = 0xff;
PORTC= 0x00;
MCUCR=0x03;
GICR=0x40;
#asm
sei
#endasm
while(1)
{
PORTC= 0x00;
delay_ms(10);
}
}
Page 1
U1
1 40
PB0/T0/XCK PA0/ADC0
2 39
PB1/T1 PA1/ADC1
3 38
PB2/AIN0/INT2 PA2/ADC2
4 37
PB3/AIN1/OC0 PA3/ADC3
5 36
PB4/SS PA4/ADC4
6 35
PB5/MOSI PA5/ADC5
7 34
PB6/MISO PA6/ADC6
8 33
PB7/SCK PA7/ADC7
14 22
PD0/RXD PC0/SCL
15 23
PD1/TXD PC1/SDA
R1 16
PD2/INT0 PC2
24
150R 17 25
PD3/INT1 PC3
18 26
PD4/OC1B PC4
19 27
PD5/OC1A PC5
20 28
PD6/ICP1 PC6/TOSC1
21 29
PD7/OC2 PC7/TOSC2
13
XTAL1
12 32
XTAL2 AREF
9 30
RESET AVCC
ATMEGA8535
Using the Built-in ADC in AVR
The ADC has a separate analog supply voltage pin, AVCC. AVCC must not differ
more than ±0.3V from VCC.
Operation
The ADC converts an analog input voltage to a 10-bit digital value through
successive approximation.
The minimum value represents GND and the maximum value represents the
voltage on the AREF pin minus 1 LSB.
The ADC is enabled by setting the ADC Enable bit, ADEN in ADCSRA.
Voltage reference and input channel selections will not go into effect until ADEN
is set.
The ADC generates a 10-bit result which is presented in the ADC Data
Registers,
ADCH and ADCL.
By default, the result is presented right adjusted, but can optionally be presented
left adjusted by setting the ADLAR bit in ADMUX.
Once ADCL is read, ADC access to data registers is blocked. This means that if
ADCL has been read, and a conversion completes before ADCH is read, neither
register is updated and the result from the conversion is lost. When ADCH is
read, ADC access to the ADCH and ADCL Registers is re-enabled.
The ADC has its own interrupt which can be triggered when a conversion
completes.
Starting a Conversion
1- Single Conversion Mode
A single conversion is started by writing a logical one to the ADC Start
Conversion bit, ADSC. This bit stays high as long as the conversion is in
progress and will be cleared by hardware when the conversion is completed. If a
different data channel is selected while a conversion is in progress, the ADC will
finish the current conversion before performing the channel change.
When a positive edge occurs on the selected trigger signal, the ADC prescaler is
reset and a conversion is started. This provides a method of starting conversions
at fixed intervals. If the trigger signal still is set when the conversion completes, a
new conversion will not be started. If another positive edge occurs on the trigger
signal during conversion, the edge will be ignored.
Using the ADC Interrupt Flag as a trigger source makes the ADC start a new
conversion as soon as the ongoing conversion has finished. The ADC then
operates in Free Running mode, constantly sampling and updating the ADC Data
Register.
The first conversion must be started by writing a logical one to the ADSC bit in
ADCSRA.
Note:
ADSC can also be used to determine if a conversion is in progress.
The ADSC bit will be read as one during a conversion, independently of how the
conversion was started.
These bits select the voltage reference for the ADC, as shown in Table 84. If
these bits are changed during a conversion, the change will not go in effect until
this conversion is complete (ADIF in ADCSRA is set). The internal voltage
reference options may not be used if an external reference voltage is being
applied to the AREF pin.
The value of these bits selects which combination of analog inputs is connected
to the ADC. These bits also select the gain for the differential channels. See
Table 85 for details. If these bits are changed during a conversion, the change
will not go in effect until this conversion is complete (ADIF in ADCSRA is set).
ADC Control and Status Register A – ADCSRA
A conversion will be triggered by the rising edge of the selected interrupt flag.
ADC.c
#include <mega8535.h>
#include <delay.h>
#include <stdlib.h>
void main(void)
{
// ADC initialization
// ADC Clock frequency: 500.000 kHz
// ADC Voltage Reference: AREF pin
// ADC High Speed Mode: Off
Page 1
ADC.c
// ADC Auto Trigger Source: None
ADMUX=ADC_VREF_TYPE & 0xff;
ADCSRA=0x89;
SFIOR&=0xEF;
ADCSRA|=0x40;
while (1)
{
delay_ms(50);
ADCSRA|=0x40;
};
}
Page 2
LCD1
LM016L
1
VDD
VSS
VEE
RW
RS
D0
D1
D2
D3
D4
D5
D6
D7
U2
E
24.0 LM35
1
2
3
4
5
6
7
8
9
10
11
12
13
14
U1
1 40 2
PB0/T0/XCK PA0/ADC0 VOUT
2 39
PB1/T1 PA1/ADC1
3 38
PB2/AIN0/INT2 PA2/ADC2
4 37
PB3/AIN1/OC0 PA3/ADC3
5 36 3
PB4/SS PA4/ADC4
6 35
PB5/MOSI PA5/ADC5
7 34
PB6/MISO PA6/ADC6
8 33
PB7/SCK PA7/ADC7
14 22
PD0/RXD PC0/SCL
15 23
PD1/TXD PC1/SDA
16 24
PD2/INT0 PC2
17 25
PD3/INT1 PC3
18 26
PD4/OC1B PC4
19 27
PD5/OC1A PC5
20 28
PD6/ICP1 PC6/TOSC1
21 29
PD7/OC2 PC7/TOSC2
13
XTAL1
12 32
XTAL2 AREF
9 30
RESET AVCC
ATMEGA8535
Accessing the EEPROM
Accessing the AVR internal EEPROM is accomplished using global
variables, preceded by the
keyword eeprom
Example:
I
Serial Communication
The name "serial" comes from the fact that a serial port "serializes" data. That is, it takes
a byte of data and transmits the 8 bits in the byte one at a time
Baud rate is a measure of how fast data is moving between instruments that use serial
communication.
Serial Socket
Male Female
#include <mega8535.h>
void main(void)
{
// Declare your local variables here
unsigned int n;
char str[15]={'m','b','v','c','1'};
float x ;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 9600
UCSRA=0x00;
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x47;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;
while (1)
{
delay_ms(500);
delay_ms(500);
printf("\n Please enter a char: ");
scanf("%c", &str[2]);
printf(" the character 2 in string is %c\n ",
str[2]);
delay_ms(500);
x =1.7;
ftoa(x,2,str);
printf(" the float is %s\n ",str);
delay_ms(500);
printf("\n Please enter a string: ");
scanf("%s", &str);
printf(" the string is %s\n ", str);
delay_ms(500);
delay_ms(500);
ftoa(x,5,str);
printf(" the float is %s\n ",str);
delay_ms(500);
};
}
Page 2
AVR Timers
Introduction
The AVR has different Timer types. Not all AVRs have
all Timers.
1
The Prescaler
It’s an internal device that divides the
system clock on preset division values to
slow the i/p pulses to the timer (make the
timer count more pulses)
Examples
Ex1: if timer use no prescaler and the
Microcontroller works on 1MHz the timer
will count 1Million clock / second
2
Counters
The AVR timer can act as a timer or a
counter.
Timers count clock pulses (with or without
prescaler)
Counters count external pulses on i/o pins
(without prescaler)
Ex1:T0 (pin 1, PortB.0) for counter 0
Ex2:T1 (pin 2, PortB.1) for counter 1
3
ATmega8535 has 3 timers
16 bit timer 1 (because it counts in 16 bits
register TCNT1)
8 bit timer 0 (because it counts in 8 bits
register TCNT0)
8 bit timer 2 (because it counts in 8 bits
register TCNT2)
Modes of Operation
Normal Mode
In this mode the counting starts from 0 to the MAX
of the counting register.
Then restarts from the BOTTOM (0).
4
Note: the compare match registers are registers
that holds values set buy user
Timer Events
1- Over flow event:
It happens when the timer finishes a full cycle
and start a new one.
It generates an overflow interrupt if the
interrupt is enabled.
Each timer has its own overflow interrupt with
its own enable , flag and ISR.
5
2-Compare Match event
Ithappens when the timer value matches the
value in the OCR register.
6
Applications
Make a motor work for 2 seconds then
stop for 3 seconds and so on.
T : desired delay time
1sÆf/pre F : microcontroller frequency
7
CLK
CE
RST
U1
1 40
PB0/T0/XCK PA0/ADC0
2 39
PB1/T1 PA1/ADC1
3 38
PB2/AIN0/INT2 PA2/ADC2
4 37
PB3/AIN1/OC0 PA3/ADC3
5 36
PB4/SS PA4/ADC4
6 35
PB5/MOSI PA5/ADC5
7 34
PB6/MISO PA6/ADC6
8 33
PB7/SCK PA7/ADC7
14 22
R1
PD0/RXD PC0/SCL
15 23 110R
PD1/TXD PC1/SDA
16 24
PD2/INT0 PC2
17 25
PD3/INT1 PC3
18 26
PD4/OC1B PC4
19 27
PD5/OC1A PC5
20 28
PD6/ICP1 PC6/TOSC1
21 29
PD7/OC2 PC7/TOSC2
13
XTAL1
12 32
XTAL2 AREF
9 30
RESET AVCC
ATMEGA8535
timer.c
#include <mega8535.h>
// Declare your global variables here
unsigned int temp1=31250;
unsigned int temp2=46875;
void main(void)
{
// Declare your local variables here
// Port C initialization
// Func7=out Func6=out Func5=out Func4=out Func3=out
Func2=out Func1=out Func0=out
// State7=T State6=T State5=T State4=T State3=T State2=T
State1=T State0=T
PORTC=0x00;
DDRC=0xff;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: 15.625 kHz
// Mode: CTC top=OCR1A
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
Page 1
timer.c
// Input Capture Interrupt: Off
// Compare A Match Interrupt: On
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x0B;
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x7A;
OCR1AL=0x12;
OCR1BH=0x00;
OCR1BL=0x00;
};
}
Page 2
6/29/2010
General Description of permanent magnet
stepper motors
• 1‐Introduction:‐
9 Stepper motors are a kind of motors
St t ki d f t
that rotate in precise steps.
9 There are different types of stepper
motors as Permanent magnet motors,
V i bl R l
Variable Reluctance motors and d
Hybrid motors.
Figure1:Stepper motor
2‐ Permanent Magnet Stepper Motors:
9 Stepper Motors have several features which distinguish them
from AC Motors, and DC Servo Motors including
1‐Brushless
brushes create sparks, undesirable in certain environments
Space missions, for example
2‐Holding Torque
Steppers have very good low speed and holding torque
1
6/29/2010
3‐Open loop positioning
Steppers can run 'open‐loop' without the
y
need for any kind of encoder to determine the
shaft position. Closed loop systems‐ systems
that feed back position information
4‐Load Independent
rotation speed of a stepper is independent of
rotation speed of a stepper is independent of
load, provided it has sufficient torque to
overcome slipping
PERMENANT MAGNET STEPPER MOTOR
TYPES
1‐ Bipolar stepper motors
2‐ Unipolar stepper motors
2
6/29/2010
2.1 Bipolar Stepper Motors
9The Bipolar Stepper motor has 2 coils. The
coils are identical and are not electrically
coils are identical and are not electrically
connected
9The coils are activated, in sequence, to attract
the rotor
2.2 Unipolar Stepper Motors
• The Unipolar Stepper motor
has 2 coils, simple lengths of
has 2 coils simple lengths of
wound wire. The coils are
identical and are not
electrically connected.
• Each coil has a center tap ‐ a
wire coming out from the coil
wire coming out from the coil
that is midway in length
between its two terminals.
3
6/29/2010
FINDING THE CENTER TAP IN A UNIPOLAR
STEPPER
• Because of the long length of the wound wire,
it h
it has a significant resistance (and inductance).
i ifi t i t ( di d t )
You can identify the center tap by measuring
resistance with a suitable ohm‐meter (capable
of measuring low resistance <10 ohm) The
resistance from a terminal to the center tap is
half the resistance from the two terminals of a
coil.
3‐ Driving Unipolar Stepper Motors
• There are three ways to drive stepper motors
(
(one phase on, two phase on or Half step),
h t h H lf t )
each one has some advantages and
disadvantages.
1‐One phase on
2‐Two Phases On Mode
2‐Two Phases On Mode
3‐Half Step Mode
4
6/29/2010
3.1 One phase on
• In one phase mode,
Step 1a 1b 2a 2b
each successive coil is
each successive coil is
energized in turn. 1 1 0 0 0
• One phase mode
produces Smooth 2 0 1 0 0
rotations and the
lowest power
lowest power 3 0 0 1 0
consumption of the
three modes. 4 0 0 0 1
4‐ How to find the sequence of any stepper
motor coils
• There are two stages to
sort out which wire is
sort out which wire is
which in a 5 or 6 wire
unipolar stepper motor
1‐ Isolate the Common
Power wire(s)
2‐ Identify the wires to the
coils by applying pulses
il b l i l
and analyzing the motor
behavior
5
6/29/2010
ISOLATION AND POWER INTERFACE