![Texas Instruments eZ430-TMS37157 User Manual Download Page 34](http://html.mh-extra.com/html/texas-instruments/ez430-tms37157/ez430-tms37157_user-manual_1094628034.webp)
Start
Switch on red and
green LED
Calibrate DCO to
8MHz
While
time <47630 ,
time > 47700
// Cailbrate DCO to a certain number of
ACLK clock cycles , necessary for precise
time base
Set Trim EEPROM
of PaLFI to
prog _data
// prog _data , Trim Value , initializes as Zero
Reset Trim EEPROM
Prog _data
= 0x80 ?
Yes
Reset TimerA &B
CCIFG , IFG ,
Control Register
No
Trim PaLFI with
prog _data w /o
programming
Set Timer A , clock
source CLK _AM ,
count to TACCR 0
TACCR 0 = 800 ,
wait for rising edge
of CLK _AM
// Count 800 clocks of
CLK _AM
Start Timer B , clock
source SMCLK ,
cont . Mode
Wait until TimerA
CCIFG = 1
// Timer A counted
800
clocks of CLK _AM
Halt timer B ,switch
off CLK _AM ,Halt
TimerA
prog _data ++ ,
time = TBR
// set next trim value
TBR = Time for 800
clocks of CLK _ AM
Prog _data
= 0xFF ?
No
Prog _data = 0xFF
break
Yes
Program
Prog _data -1 to
Trim EEPROM
Power Down PaLFI
No
Yes
Blink red LED fast
Program Page 2=1
Switch off PaLFI
Switch off red LED
Finish
// Autotrim failed ,
Trap CPU
// Mark that PaLFI is
trimmed
// Timer A counts
134 , 2kHz ( CLK _ AM )
clocks
// Timer B counts with
8MHz (SMCLK )
// Timer B is critical , stop
it first
// Last valid trim value is
0x 7F
l
Trimming failed
// Indicate PaLFI is trimed
Calibrate DCO to
2 MHz
Switch off green
LED
Delay 1 second
Time -47630
<
47630 -previous ?
Yes
Program
Prog _data -2 to
Trim EEPROM
MSP430F2274 Firmware Flow Diagrams
www.ti.com
Figure 34. Flow Diagram of Auto Trim Routine
34
eZ430-TMS37157 Development Tool
SLAU281B
–
November 2009
–
Revised March 2010
Submit Documentation Feedback
Copyright
©
2009
–
2010, Texas Instruments Incorporated