Freescale Semiconductor RS08 Designer Reference Manual Download Page 34

How to Reach Us:

Home Page:

www.freescale.com

E-mail:

[email protected]

USA/Europe or Locations Not Listed:

Freescale Semiconductor
Technical Information Center, CH370
1300 N. Alma School Road
Chandler, Arizona 85224
+1-800-521-6274 or +1-480-768-2130
[email protected]

Europe, Middle East, and Africa:

Freescale Halbleiter Deutschland GmbH
Technical Information Center
Schatzbogen 7
81829 Muenchen, Germany
+44 1296 380 456 (English)
+46 8 52200080 (English)
+49 89 92103 559 (German)
+33 1 69 35 48 48 (French)
[email protected]

Japan:

Freescale Semiconductor Japan Ltd.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku,
Tokyo 153-0064
Japan
0120 191014 or +81 3 5437 9125
[email protected]

Asia/Pacific:

Freescale Semiconductor Hong Kong Ltd.
Technical Information Center
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
+800 2666 8080
[email protected]

For Literature Requests Only:

Freescale Semiconductor Literature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-441-2447 or 303-675-2140
Fax: 303-675-2150
[email protected]

RoHS-compliant and/or Pb-free versions of Freescale products have the functionality 
and electrical characteristics of their non-RoHS-compliant and/or non-Pb-free 
counterparts. For further information, see 

http://www.freescale.com

 or contact your 

Freescale sales representative.

For information on Freescale’s Environmental Products program, go to 

http://www.freescale.com/epp

.

Information in this document is provided solely to enable system and software 
implementers to use Freescale Semiconductor products. There are no express or 
implied copyright licenses granted hereunder to design or fabricate any integrated 
circuits or integrated circuits based on the information in this document.

Freescale Semiconductor reserves the right to make changes without further notice to 
any products herein. Freescale Semiconductor makes no warranty, representation or 
guarantee regarding the suitability of its products for any particular purpose, nor does 
Freescale Semiconductor assume any liability arising out of the application or use of any 
product or circuit, and specifically disclaims any and all liability, including without 
limitation consequential or incidental damages. “Typical” parameters that may be 
provided in Freescale Semiconductor data sheets and/or specifications can and do vary 
in different applications and actual performance may vary over time. All operating 
parameters, including “Typicals”, must be validated for each customer application by 
customer’s technical experts. Freescale Semiconductor does not convey any license 
under its patent rights nor the rights of others. Freescale Semiconductor products are 
not designed, intended, or authorized for use as components in systems intended for 
surgical implant into the body, or other applications intended to support or sustain life, 
or for any other application in which the failure of the Freescale Semiconductor product 
could create a situation where personal injury or death may occur. Should Buyer 
purchase or use Freescale Semiconductor products for any such unintended or 
unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and 
its officers, employees, subsidiaries, affiliates, and distributors harmless against all 
claims, costs, damages, and expenses, and reasonable attorney fees arising out of, 
directly or indirectly, any claim of personal injury or death associated with such 
unintended or unauthorized use, even if such claim alleges that Freescale 
Semiconductor was negligent regarding the design or manufacture of the part. 

Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
All other product or service names are the property of their respective owners.

© Freescale Semiconductor, Inc. 2006. All rights reserved.

DRM079
Rev. 0, 5/2006

Summary of Contents for RS08

Page 1: ...RS08 Microcontrollers freescale com DRM079 Rev 0 5 2006 Designer Reference Manual Variable Speed DC Fan Control using the MC9RS08KA2...

Page 2: ......

Page 3: ...of our documents on the World Wide Web will be the most current Your printed copy may be an earlier revision To verify that you have the latest information available refer to http www freescale com Th...

Page 4: ...Revision History Variable Speed DC Fan Control using the MC9RS08KA2 Rev 0 4 Freescale Semiconductor...

Page 5: ...sign Targets 8 1 4 Bi Phase BLDC Motor 9 Chapter 2 Motor Control 2 1 Commutation 11 2 2 Rotor Position Control 11 2 3 Commutation Waveforms 12 2 4 Speed Control 12 2 5 Motor Startup 13 2 6 Fault Detec...

Page 6: ...Table of Contents Variable Speed DC Fan Control using the MC9RS08KA2 Rev 0 6 Freescale Semiconductor...

Page 7: ...es more and more sophisticated MCU approach provides a cost effective solution to this application There are several advantages of a MCU based design over traditional solutions 1 Instead of having a c...

Page 8: ...ccess RAM Allows emulation of HC08 HCS08 zero offset index addressing mode instructions Third generation Flash and RAM extremely fast byte writable programming 63 Byte RAM 2K Byte Flash Flexible clock...

Page 9: ...is commonly consist of a permanent magnet attached on the rotor and the stator phase coil windings are mounted on the motor shaft as illustrated in Figure 1 2 The BLDC has no brushes on the rotor and...

Page 10: ...Introduction Variable Speed DC Fan Control using the MC9RS08KA2 Rev 0 10 Freescale Semiconductor...

Page 11: ...grees or one motor phase One mechanical revolution is contributed by four commutation steps To avoid conflict to the magnetic field adjacent coils cannot be energized at the same time Dead time where...

Page 12: ...ation period could be considered as a pulse width modulation PWM output cycle The PWM period defines the motor speed in this case The coils energization time is in fact the PWM driving period which is...

Page 13: ...rgized at the same time there are equal pulling pushing force induced on the rotor in both directions There is chance for the rotor to startup in either direction It is necessary to monitor the initia...

Page 14: ...Motor Control Variable Speed DC Fan Control using the MC9RS08KA2 Rev 0 14 Freescale Semiconductor...

Page 15: ...rature sensor In the faulty situation such as motor jam the buzzer alarm is driven by the MCU through a pulse width modulated PWM output Figure 3 1 DC Fan Design Block Diagram 3 2 Hardware Resources I...

Page 16: ...arying the absolute dead time This is updated every 128ms in the application As in all RS08 S08 devices the MC9RS08KA2 MCU has a programmable real time interrupt RTI feature In this case it is used to...

Page 17: ...eriod Increment DeadTime Target Actual Target Actual De energized coils DeadTime N Y Y N N Y During the dead time delay update PWM period for the next commutation Modify Target PWM period value every...

Page 18: ...d the comparator is then enabled and the terminal turns to analog input voltage across C starts to ramp up The 8 bit internal modulo timer is used to monitor the time taken for the RC to charge to a l...

Page 19: ...et and Start Timer mov mACMPSC_ACME mACMPSC_ACIE ACMP_OUTPUT_RAISING ACMPSC Enable ACMP start RC rise bset ACMPSC_ACF ACMPSC Clear ACMP Flag wait brclr ACMPSC_ACF ACMPSC NoReading mov MTIMCNT SensorRe...

Page 20: ...ecific temperature range are also defined and shown in Table 3 3 EQ 3 2 shows how the target PWM period value is calculated The target value is compared with the measured PWM period every 180 degrees...

Page 21: ...Timer Counts 1 NOTES 1 The resolution of a timer count is 64 s 25 or below 10 2 86 1000 232 30 34 8 082 2 59 1200 193 35 39 6 577 2 34 1400 165 40 44 5 387 2 09 1600 144 45 49 4 441 1 86 1800 128 50...

Page 22: ...Implementation Variable Speed DC Fan Control using the MC9RS08KA2 Rev 0 22 Freescale Semiconductor...

Page 23: ...K4 PA1 K1 A PA0 K0 A 9RS08KA2DN U1 1 2 3 4 5 6 7 8 FMMT491A Q1 1 2 3 R7 1 2 1K5 FMMT491A Q2 1 2 3 R6 1 2 1K5 C4 1 2 2u2F 25V LL4148 D3 1 2 R9 1 2 7 5K 1 LL4148 D2 1 2 P1 1 2 BUZ1 1 2 0 1uF DC1 1 2 ZM...

Page 24: ...Implementation Variable Speed DC Fan Control using the MC9RS08KA2 Rev 0 24 Freescale Semiconductor...

Page 25: ...BI1 ACMP Temp sensor input PTA2 KBI2 TCLK RESETb VPP Hall input PTA3 ACMPO BKGD MS Buzzer PTA4 KBI4 PWM PTA5 KBI5 PWM include derivative specific macros XDEF Entry include MC9RS08KA2 inc ICS Definitio...

Page 26: ..._512MS equ 06 RTI_1024MS equ 07 Application Definition RC equ PTAD_PTAD0 mRC equ mPTAD_PTAD0 TEMPSEN equ PTAD_PTAD1 mTEMPSEN equ mPTAD_PTAD1 HALL equ PTAD_PTAD2 mHALL equ mPTAD_PTAD2 BUZZER equ PTAD_P...

Page 27: ...SEL mov MAP_ADDR_6 NV_FTRIM ICSSC 3FFB mov MAP_ADDR_6 NV_ICSTRM ICSTRM 3FFA mov ICS_DIV_2 ICSC2 Use 4MHz Config System mov HIGH_6_13 SOPT PAGESEL Init Page register mov mSOPT_COPT mSOPT_STOPE MAP_ADDR...

Page 28: ...for Delay 0 5s dbnza Dly1 clr PTAD de energize coils bsr Delay Drive L2 ldx mPWM2 Select L2 Coils bsr SetPWM Drive coil bsr Delay De energize coils inc MotorRunning otherwise Update Software flag Fan...

Page 29: ...same Fan speed reach target then exit DecPeriod if bigger decrement DeadTime lda DeadTime cmp MinDeadTime blo WaitAgain dec DeadTime bra WaitAgain IncPeriod if smaller increment DeadTime lda DeadTime...

Page 30: ...isconnect coil mov mKBISC_KBACK KBISC Clear Flag and mask interrupt mov mMTIMSC_TSTP mMTIMSC_TRST MTIMSC mask interrupt and clear flag rts Read Temperature Sensor Value Timer prescalar 8 Timer clk 250...

Page 31: ...Error Handling Stop the motor Sound the buzzer about 520Hz MotorHang clr PTAD clear PWMp and PWMn lda MotorRunning Check software flag bne SoundBuzzer 1 Motor is running jmp ResetPosition SoundBuzzer...

Page 32: ...MTIMSC_TRST MTIMSC mask interrupt and clear flag sta MAP_ADDR_6 SRS Bump COP dbnza Quiet bra SoundBuzzer Lookup Table org TableStart dc b 57 57 57 57 57 60 63 67 71 76 82 82 88 88 96 96 dc b 105 105 1...

Page 33: ......

Page 34: ...right to make changes without further notice to any products herein Freescale Semiconductor makes no warranty representation or guarantee regarding the suitability of its products for any particular p...

Reviews: