Download: 8-bit Microcontroller Application Note

8-bit Microcontroller Application Note Rev. 1181B–AVR–04/03 AVR360: Step Motor Controller Features • High-speed Step Motor Controller • Interrupt Driven • Compact Code (Only 10 Bytes Interrupt Routine) • Very High Speed • Low Computing Requirement • Supports all AVR Devices Introduction This application note describes how to implement a compact size and high-speed interrupt driven step motor controller. Step motors are typically used in applications like camera zoom/film feeder, fax machines, printers, copying machines, paper feed- ers/sorters and disk drives. The high performance of the AVR c...
Author: Zoble1980 Shared: 8/19/19
Downloads: 417 Views: 3823

Content

8-bit

Microcontroller Application Note

Rev. 1181B–AVR–04/03

AVR360: Step Motor Controller Features

• High-speed Step Motor Controller • Interrupt Driven • Compact Code (Only 10 Bytes Interrupt Routine) • Very High Speed • Low Computing Requirement • Supports all AVR Devices

Introduction

This application note describes how to implement a compact size and high-speed interrupt driven step motor controller. Step motors are typically used in applications like camera zoom/film feeder, fax machines, printers, copying machines, paper feed- ers/sorters and disk drives. The high performance of the AVR controller enables the designer to implement high speed step motor applications with low computing requirements of the controller.

Theory of Operation

A DC step motor translates current pulses into motor rotation. A typical motor contains four winding coils. The coils are often labeled red, yellow/white, red/white and yellow, but may have other colors. Applying voltage to these coils forces the motor to step one step. In normal operation, two winding coils are activated at the same time. The step motor moves clockwise one step per change in winding activated. If the sequence is applied in reverse order, the motor will run counterclockwise. The speed of rotation is controlled by the frequency of the pulses. Every time a pulse is applied to the step motor the motor will rotate a fixed distance. A typical step rota- tion is 1.8 degrees. With 1.8 degree rotation in each step will a complete rotation of the motor (360 degrees) require 200 steps. By changing the interval of the timer interrupts, the speed of the motor can be regu- lated, and by counting the number of steps, the rotation angle can be controlled., Figure 1. Step Motor Step Sequence STEP 0 STEP 1 STEP 2 STEP3

YELLOW

RED/WHITE YELLOW/WHITE

RED

Table 1 shows the hexadecimal values to be output to the step motor to perform each step. Table 1. Step Motor Values Step Yellow Red/White Yellow/White Red Hex Value01001911100C201106300113

Software Description The software uses a 16 bits timer with capture function to generate interrupt every

100 µs. When the interrupt is executed, a new step value is output to PORTB. Values for the step motor are stored in Flash memory. At startup, the values are copied to SRAM to achieve faster access and maximum speed performance. In this implementation, the interrupt routine takes seven cycles + four cycles to enter and four cycles to exit the interrupt. This totals 15 cycles. The step motor control takes less than 2 µs. If interrupt is required every 100 µs, the step motor handling takes only 2% of the processing power in the CPU. In this example the values for the step motor are stored at RAM address 0100 (hex). The upper byte of the RAM address is constant and only the low nibble of the low byte is used to access the address information. See Figure 2. The lower nibble (four bits) of the variables is the actual value to control the step motor, the upper nibble holds the address of the next value. 2 AVR360,

AVR360

Figure 2. Step Motor Addresses and Values ADDRESS (HEX) ADDRESS VALUE VALUE (HEX) 0100 0001 1001 19 ADDRESS VALUE 0101 0010 1100 2C 0102 0011 0110 36 0103 0000 0011 03 By using this method, maximum speed can be achieved, combined with a minimum of processor resources.

Resources

Table 2. CPU and Memory Usage Function Code Size Cycles Register Usage Interrupt Description Main 38 words – R16, XL, XH, ZL, ZH – Initialization and example program OC1A 10 words 13 + return R16, XL, XH Timer 1 Output step Output motor value Compare A and calculate next value TOTAL 48 words – R16, XL, XH, ZL, ZH Table 3. Peripheral Usage Peripheral Description Interrupts Enabled 4 I/O pins Step motor output pins Timer 1 Generate timer interrupt for step motor frequency Timer 1 Output Compare A generation,

Atmel Corporation Atmel Operations

2325 Orchard Parkway Memory RF/Automotive San Jose, CA 95131 2325 Orchard Parkway Theresienstrasse 2 Tel: 1(408) 441-0311 San Jose, CA 95131 Postfach 3535 Fax: 1(408) 487-2600 Tel: 1(408) 441-0311 74025 Heilbronn, Germany Fax: 1(408) 436-4314 Tel: (49) 71-31-67-0 Fax: (49) 71-31-67-2340

Regional Headquarters Microcontrollers Europe 2325 Orchard Parkway 1150 East Cheyenne Mtn. Blvd.

Atmel Sarl San Jose, CA 95131 Colorado Springs, CO 80906 Route des Arsenaux 41 Tel: 1(408) 441-0311 Tel: 1(719) 576-3300 Case Postale 80 Fax: 1(408) 436-4314 Fax: 1(719) 540-1759 CH-1705 Fribourg Switzerland La Chantrerie Biometrics/Imaging/Hi-Rel MPU/ Tel: (41) 26-426-5555 BP 70602 High Speed Converters/RF Datacom Fax: (41) 26-426-5500 44306 Nantes Cedex 3, France Avenue de Rochepleine Tel: (33) 2-40-18-18-18 BP 123

Asia Fax: (33) 2-40-18-19-60 38521 Saint-Egreve Cedex, France

Room 1219 Tel: (33) 4-76-58-30-00 Chinachem Golden Plaza ASIC/ASSP/Smart Cards Fax: (33) 4-76-58-34-80 77 Mody Road Tsimshatsui Zone Industrielle East Kowloon 13106 Rousset Cedex, France Hong Kong Tel: (33) 4-42-53-60-00 Tel: (852) 2721-9778 Fax: (33) 4-42-53-60-01 Fax: (852) 2722-1369 1150 East Cheyenne Mtn. Blvd.

Japan Colorado Springs, CO 80906

9F, Tonetsu Shinkawa Bldg. Tel: 1(719) 576-3300 1-24-8 Shinkawa Fax: 1(719) 540-1759 Chuo-ku, Tokyo 104-0033 Japan Scottish Enterprise Technology Park Tel: (81) 3-3523-3551 Maxwell Building Fax: (81) 3-3523-7581 East Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000 Fax: (44) 1355-242-743 e-mail email is hidden

Web Site

http://www.atmel.com Disclaimer: Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical components in life support devices or systems. © Atmel Corporation 2003. All rights reserved. Atmel® and combinations thereof, AVR® are the registered trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be the trademarks of others. Printed on recycled paper. 1181B–AVR–04/03 0M]
15

Similar documents

8-bit RISC Microcontroller Application Note AVR335: Digital Sound Recorder with AVR and Serial DataFlash Features
8-bit RISC Microcontroller Application Note Rev. 1456B–01/04 AVR335: Digital Sound Recorder with AVR and Serial DataFlash Features • Digital Voice Recorder • 8-bit Sound Recording • 8 KHz Sampling Rate • Sound Frequency up to 4000 Hz • Maximum Recording Time 2 1/4 Minutes • Very Small Board Size • O
USB in a Nutshell. Making Sense of the USB Standard.
USB in a Nutshell. Making Sense of the USB Standard. Starting out new with USB can be quite daunting. With the USB 2.0 specification at 650 pages one could easily be put off just by the sheer size of the standard. This is only the beginning of a long list of associated standards for USB. There are U
What is USB Enumeration? What does enumeration look like?
What is USB Enumeration? Enumeration is the process by which a USB device is attached to a system and is assigned a specific numerical address that will be used to access that particular device. It is also the time at which the USB host controller queries the device in order to decide what type of d
Draft
CYCLIC REDUNDANCY CHECKS IN USB Introduction The USB specification calls for the use of Cyclic Redundancy Checksums (CRC) to protect all non-PID fields in token and data packets from errors during transmission. This paper describes the mathematical basis behind CRC in an intuitive fashion and then e
File: X:\USERS\IGOR\DOC\WORD\Atmel\USB to RS232 Application Note\Firmware\USBtoRS232_ATmega8\AVR Studio 4 project\USBtoRS232.asm 1.2.2004
1 ;*************************************************************************** 2 ;* USBSTACKFORTHEAVRFAMILY3;* 4 ;* File Name :"USBtoRS232.asm" 5 ;* Title :AVR309:USB to UART protocol converter 6 ;* Date :01.02.2004 7 ;* Version :2.8 8 ;* Target MCU :ATmega8 9 ;* AUTHOR :Ing. Igor Cesko 10 ;* Slovak
File: X:\USERS\IGOR\DOC\WORD\Atmel\USB to RS232 Application Note\Firmware\USBtoRS232_AT90S2313\AVR Studio 4 project\USB90S2313.asm 26.1.2004
1 ;*************************************************************************** 2 ;* USBSTACKFORTHEAVRFAMILY3;* 4 ;* File Name :"USB90S2313.asm" 5 ;* Title :AVR309:USB to UART protocol converter (simple - small FIFO) 6 ;* Date :26.01.2004 7 ;* Version :2.2 8 ;* Target MCU :AT90S2313-10 9 ;* AUTHOR :I
AVR309: Software Universal Serial Bus (USB)
AVR309: Software Universal Serial Bus (USB) Features • USB (Universal Serial Bus) protocol implemented in firmware • Supports Low Speed USB (1.5Mbit/s) in accordance with USB2.0 • Implementation runs on very small AVR devices, from 2kBytes and up • Few external components required - One resistor for
Application Note
8-bit Microcontrollers Application Note AVR270: USB Mouse Demonstration Features • Runs with AT90USB Microcontrollers at 8MHz • USB Low Power Bus Powered Device (less then 100mA) • Supported by any PC running Windows® (98SE or later), Linux® or Mac OS®. • 3Kbytes of Code Required • X, Y Movement, Le
8-bit Microcontroller Application Note
8-bit Microcontroller Application Note Rev. 2547A–AVR–11/03 AVR244: AVR UART as ANSI Terminal Interface Features • Make use of standard terminal software as user interface to your application. • Enables use of a PC keyboard as input and ascii graphic to display status and control information. • Driv
MPASM USER'S GUIDE with MPLINK and MPLIB MPASM USER'S GUIDE with MPLINK and MPLIB
Adjust Spine to fit MPASM USER'S GUIDE with MPLINK and MPLIB Microchip Technology Inc. 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 602.786.7200 Fax: 602.899.9210 © 1999 Microchip Technology Inc., Printed in the U.S.A. 3/99 DS33014 MPASM USER'S GUIDE with MPLINK and MPLIB Information only.
Microcontroller Core Features: RA5/SS/AN4 7 34 RB1RE0/RD/AN5 8 33 RB0/INT
Device Pins A/D PSP Pin Diagram PIC16C63A 28 NO NO PDIP, Windowed CERDIP PIC16C73B 28 YES NO MCLR/VPP 1 40 RB7 PIC16C65B 40 NO YES RA0/AN0 2 39 RB6 RA1/AN1 3 38 RB5 PIC16C74B 40 YES YES RA2/AN2 4 37 RB4 RA3/AN3/VREF 5 36 RB3 RA4/T0CKI 6 35 RB2 Microcontroller Core Features: RA5/SS/AN4 7 34 RB1RE0/RD
PACKAGE OPTION ADDENDUM
PCM2704 and PCM2705 Not Recommended For New Designs PCM2704, PCM2705 PCM2706, PCM2707 Burr-Brown Audio www.ti.com... SLES081F–JUNE 2003–REVISED JANUARY 2009 STEREO AUDIO DAC WITH USB INTERFACE, SINGLE-ENDED HEADPHONE OUTPUT AND S/PDIF OUTPUT 1FEATURES – External ROM Interface (PCM2704/6) 2345• On-Ch
14 + 14W STEREO AMPLIFIER WITH MUTE & ST-BY
TDA7269A 14 + 14W STEREO AMPLIFIER WITH MUTE & ST-BY WIDE SUPPLY VOLTAGE RANGE UP TO ±20V SPLIT SUPPLY HIGH OUTPUT POWER 14 + 14W @ THD =10%, RL = 8Ω, VS = +16V NO POP AT TURN-ON/OFF MUTE (POP FREE) STAND-BY FEATURE (LOW Iq) SHORT CIRCUIT PROTECTION TO GND THERMAL OVERLOAD PROTECTION Multiwatt11 OR
FOREWORD This repair manual has been prepared to provide essential in-
FOREWORD This repair manual has been prepared to provide essential in- formation on body panel repair methods (including cutting and welding operations, but excluding painting) for the TOYOTA YARIS. Applicable models: KSP90 series Applicable models: NCP90, 91 series This manual consists of body repa
MPASM and MPLINK PICmicro® QUICK REFERENCE GUIDE
MPASM and MPLINK PICmicro® QUICK REFERENCE GUIDE The Embedded Control Solutions Company® MPASM Quick Reference Guide This Quick Reference Guide gives all the instructions, directives, and command line options for the Microchip MPASM Assembler. MPASM Directive Language Summary Directive Description S
M INTRODUCTION
M Author: Mark Palmer Microchip Technology Inc. INTRODUCTION The PICmicro™ families of RISC microcontrollers are designed to provide advanced performance and a cost-effective solution for a variety of applications. To address these applications, there is the PIC16CXXX microcontroller family of produ
M ENGINE ON-VEHICLE INSPECTION ASSEMBLY
1NZ-FE ENGINE MECHANICAL – ENGINE EM–1 M ENGINE ON-VEHICLE INSPECTION 1. INSPECT ENGINE COOLANT (See page CO-1) 2. INSPECT ENGINE OIL (See page LU-1) 3. INSPECT BATTERY (See page CH-4) 4. INSPECT AIR CLEANER FILTER ELEMENT SUB- ASSEMBLY (a) Remove the air cleaner filter element sub-assembly. (b) Vis
FOREWORD This wiring diagram manual has been prepared to provide information on the electrical system of the 2007 YARIS. Applicable models: NCP91, 93 Series
FOREWORD This wiring diagram manual has been prepared to provide information on the electrical system of the 2007 YARIS. Applicable models: NCP91, 93 Series Refer to the following manuals for additional service specifications and repair procedures for these models: Manual Name Pub. No. 2007 YARIS Re
X AUTOMATIC TRANSAXLE SYSTEM PRECAUTION
U340E AUTOMATIC TRANSAXLE – AUTOMATIC TRANSAXLE SYSTEM AX–1 X AUTOMATIC TRANSAXLE SYSTEM PRECAUTION NOTICE: • Perform the RESET MEMORY (AT initialization) when replacing the automatic transaxle assembly, engine assembly or ECM (See page AX-14). • Perform the REGISTRATION (VIN registration) when repl
ON Semiconductor 2N5550 Amplifier Transistors NPN Silicon 2N5551*
ON Semiconductor 2N5550 Amplifier Transistors NPN Silicon 2N5551* *ON Semiconductor Preferred Device MAXIMUM RATINGS Rating Symbol 2N5550 2N5551 Unit Collector–Emitter Voltage VCEO 140 160 Vdc Collector–Base Voltage VCBO 160 180 Vdc Emitter–Base Voltage VEBO 6.0 Vdc Collector Current — Continuous IC
GENERAL DESCRIPTION QUICK REFERENCE DATA PINNING - TO92 variant PIN CONFIGURATION SYMBOL
GENERAL DESCRIPTION QUICK REFERENCE DATA Glass passivated sensitive gate SYMBOL PARAMETER MAX. UNIT thyristor in a plastic envelope, intended for use in general purpose VDRM, Repetitive peak off-state voltages 200 V switching and phase control VRRM applications. This device is intended IT(AV) Averag
N-Channel JFETs
N-Channel JFETs 2N4117A PN4117A SST4117 2N4118A PN4118A SST4118 2N4119A PN4119A SST4119 Part Number VGS(off) (V) V(BR)GSS Min (V) gfs Min (S) IDSS Min (A) 4117 –0.6 to –1.8 –40 70 30 4118 –1 to –3 –40 80 80 4119 –2 to –6 –40 100 200 Ultra-Low Leakage: 0.2 pA Insignificant Signal Loss/Error Voltage
Order this document SEMICONDUCTOR TECHNICAL DATA by 2N3903/D NPN Silicon
Order this document SEMICONDUCTOR TECHNICAL DATA by 2N3903/D NPN Silicon *Motorola Preferred Device COLLECTOR BASE EMITTER 1 MAXIMUM RATINGS Rating Symbol Value Unit CASE 29–04, STYLE 1 TO–92 (TO–226AA) Collector–Emitter Voltage VCEO 40 Vdc Collector–Base Voltage VCBO 60 Vdc Emitter–Base Voltage VEB
DISCRETE SEMICONDUCTORS DATA SHEET 2N2222; 2N2222A NPN switching transistors Product specification 1997 May 29 Supersedes data of September 1994 File under Discrete Semiconductors, SC04
DISCRETE SEMICONDUCTORS DATA SHEET M3D125 2N2222; 2N2222A NPN switching transistors Product specification 1997 May 29 Supersedes data of September 1994 File under Discrete Semiconductors, SC04 FEATURES PINNING • High current (max. 800 mA) PIN DESCRIPTION • Low voltage (max. 40 V). 1 emitter 2 base A
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide V TYPE CEO IC Ptot fhhTPNP PACKAGE max. max. max. FE FE min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) BC846 SOT23 65 100 250 110 450 100 BC856 305 BC846A SOT23 65 100 250 110 220 100 BC856A 305 BC846AT SC-75 65 100 150 110 220 1
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide SURFACE-MOUNT DEVICES NPN GENERAL PURPOSE LOW-POWER TRANSISTORSVIPfTYPE CEO C tothhTPNP PACKAGE max. max. max. FE FE min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) 2PC4081 SC-70 40 100 200 120 560 100 2PA1576 210 2PC4081Q SC-70 4
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide LEADED DEVICES (continued) NPN HIGH-VOLTAGE POWER TRANSISTORSVIPfTYPE CEO C tothhTPACKAGE max. max. max. FE FE PNP min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) BF419 TO-126 250 300 6000 45 typ. >45 90 – 532 BF457 TO-126 160 100
DISCRETE SEMICONDUCTORS DATA SHEET 1PS302 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01
DISCRETE SEMICONDUCTORS DATA SHEET handbook, halfpage M3D114 1PS302 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01 FEATURES DESCRIPTION PINNING • Very small plastic SMD package The 1PS302 consists of two PIN DESCRIPTION • High switching speed: max.
Small-signal Transistors Selection guide
Philips Semiconductors Small-signal Transistors Selection guide LEADED DEVICES NPN GENERAL PURPOSE LOW-POWER TRANSISTORSVIPfTYPE CEO C tothhTPACKAGE max. max. max. FE FE PNP min. PAGE NUMBER min. max. COMPL. (V) (mA) (mW) (MHz) 2N2484 TO-18 60 50 360 250 800 60 – 131 2N4124 TO-92 25 200 500 120 360
DISCRETE SEMICONDUCTORS DATA SHEET 1PS301 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01
DISCRETE SEMICONDUCTORS DATA SHEET handbook, halfpage M3D114 1PS301 High-speed double diode Product specification 1996 Apr 03 File under Discrete Semiconductors, SC01 FEATURES DESCRIPTION PINNING • Very small plastic SMD package The 1PS301 consists of two PIN DESCRIPTION • High switching speed: max.