The general purpose 8-bit mcu development system (9 pages)
Summary of Contents for Freescale Semiconductor RS08
Page 1
Variable Speed DC Fan Control using the MC9RS08KA2 Designer Reference Manual RS08 Microcontrollers DRM079 Rev. 0 5/2006 freescale.com...
Page 3
Variable Speed DC Fan Control using the MC9RS08KA2 Designer Reference Manual by: Vincent Ko Freescale Semiconductor, Inc. Hong Kong To provide the most up-to-date information, the revision 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...
Page 4
Revision History Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Temperature Conversion ........... 20 Appendix A. Schematic Appendix B. Program Listing Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 6
Table of Contents Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
The MCU chosen for this purpose must be low cost and it must provide small geometry package to integrate into the fan controller printed circuit board (PCB). The MC9RS08KA2 is ideal for this application. Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
DC fan controller. This device is composed of standard on-chip modules including a very small and highly efficient RS08 CPU core, 62 bytes RAM, 2K bytes FLASH, an 8-bit modulo timer, keyboard interrupt, and analog comparator. The device is available in small 6- and 8-pin packages.
The BLDC has no brushes on the rotor and the commutation is performed electronically at certain rotor positions. Hall Effect Sensor Stator Coil Fan Hub Axle Permanent Magnets Figure 1-2. Bi-Phase BLDC Motor Diagram Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 10
Introduction Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
2-1, can effectively detect the rotor position. In this case the hall sensor output toggles when the rotor magnets is aligned to the coils. Commutation should switch at this time from one coil-pair to the next coil-pair. Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
As a result the motor speed decreases. The target motor speed against temperature is predefined. It is updated periodically based on the information from the temperature sensor. Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
In this design, when a motor fault occurs, a buzzer is activated as the alarm. Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 14
Motor Control Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
PWM period that is less the 3.75ms per commutation step. Timer prescalar is selected as 256 and the timer resolution becomes 64µs. Table 3-1. Hardware Configuration Bus Frequency 4MHz Timer Clock for motor speed monitoring 4MHz/256 = 16kHz Timer Resolution 64µs Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
As described in the previous section, the motor speed is controlled by varying 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 notify the MCU to refresh the target PWM period every 128ms.
Page 17
Modify Target PWM period value every 128ms based on temperature Update TargetPWMPeriod reading Target > Target = Actual? Actual? Decrement DeadTime Increment DeadTime Figure 3-2. Firmware Control Loop Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Implementation 3.4 Temperature Sensor Measurement The temperature sensor measurement is performed based on the methodology of an emulated ADC described in the application note, AN3266 “Getting Started with RS08”. ON-CHIP COMPARATOR – TEMP SENSOR 22nF MCU BOUNDARY Figure 3-3. Emulated ADC Schematic...
Page 19
($00C0 to $00FF) in the MC9RS08KA2. The timer value captured can be used directly as an index to the paging window for the target PWM period value lookup. The code below shows how the timer value is captured using RS08 instructions. ReadSensor: #(MTIM_BUS_CLK|MTIM_DIV_8), MTIMCLK;...
Table 3-3. The table is stored in the upper memory (FLASH). In RS08 architecture upper memory access is done through the paging window (address $00C0 to $00FF) where the PAGESEL register is defining the page to be accessed. Simple table lookup method which uses the captured timer value from the temperature sensor readout as an index in the paging window for the target PWM period conversion.
Page 21
90 – 94 0.962 0.57 3600 95 – 99 0.831 0.50 3800 100 or above 0.698 0.43 4000 NOTES: 1. The resolution of a timer count is 64µs. Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 22
Implementation Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 23
Temperature Sensor Measurement Appendix A. Schematic Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 24
Implementation Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 25
Temperature Sensor Measurement Appendix B. Program Listing ;************************************************************** (c) copyright Freescale Semiconductor. 2006 ALL RIGHTS RESERVED ;************************************************************** ;************************************************************** ;* DC Fan Coding for 9RS08KA2 ;* Author: Vincent Ko ;* Date: Jan 2006 ;* PTA0/KBI0/ACMP+ RC input ;* PTA1/KBI1/ACMP- Temp sensor input ;* PTA2/KBI2/TCLK/RESETb/VPP...
Page 26
TableStart: $00003E00 ;========================================================================= ; Application Macro ;========================================================================= StartTimer: macro DeadTime, MTIMMOD ; OF period #(mMTIMSC_TRST|mMTIMSC_TOIE), MTIMSC; Reset and Start Timer endm TINY_RAMStart ; variable/data section DeadTime ds.b 1 Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 27
; RC - init L ; Buzzer - init L ; PWMn/PWMp - init L ;------------------------------------------------------- PTAD ; Initial low #(mRC|mPWM1|mPWM2), PTADD ; Set Output pins ;------------------------------------------------------- ; Config KBI ;------------------------------------------------------- #mHALL Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 28
#(mMTIMSC_TSTP|mMTIMSC_TRST), MTIMSC; mask interrupt and clear flag ;4) Drive L2 coil bset HALL, KBIES ; HALL rising edge trigger #mPWM2 ; Select L2 Coil SetPWM ; Drive coil Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 29
Delay: #255, MTIMMOD ; OF period #(mMTIMSC_TRST|mMTIMSC_TOIE), MTIMSC; Reset and Start Timer wait #(mMTIMSC_TSTP|mMTIMSC_TRST), MTIMSC; mask interrupt and clear flag MAP_ADDR_6(SRS) ; Bump COP ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; Drive coil Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 30
ACMPSC_ACF, ACMPSC, NoReading MTIMCNT, SensorReading bset ACMPSC_ACF, ACMPSC ; Clear ACMP Flag ACMPSC ; disable ACMP wait #(mMTIMSC_TSTP|mMTIMSC_TRST), MTIMSC; mask interrupt and clear flag #(MTIM_BUS_CLK|MTIM_DIV_256), MTIMCLK; Reset Timer resolution Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 31
BUZZER, PTAD ; Clear buzzer #24, MTIMMOD #(mMTIMSC_TRST|mMTIMSC_TOIE), MTIMSC; Reset and Start Timer wait #(mMTIMSC_TSTP|mMTIMSC_TRST), MTIMSC; mask interrupt and clear flag MAP_ADDR_6(SRS) ; Bump COP dbnza Beep Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 32
57, 57, 57, 57, 57, 60, 63, 67, 71, 76, 82, 82, 88, 88, 96, 96 dc.b 105,105,115,115,115,128,128,128,128,144,144,144,144,165,165,165 dc.b 165,193,193,193,193,193,232,232,232,232,232,232,232,232,232,232 dc.b 232,232,232,232,232,232,232,232,232,232,232,232,232,232,232,232 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ; Reset Vector ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $3ffc Security: dc.b main Variable Speed DC Fan Control using the MC9RS08KA2, Rev. 0 Freescale Semiconductor...
Page 34
Freescale Semiconductor assume any liability arising out of the application or use of any Japan: product or circuit, and specifically disclaims any and all liability, including without Freescale Semiconductor Japan Ltd.
Need help?
Do you have a question about the RS08 and is the answer not in the manual?
Questions and answers