NEW DATABASE - 350 MILLION DATASHEETS FROM 8500 MANUFACTURERS
8/16/32-BIT AN683 AN1501 AN1369 AN676 AN677 AN839 AN840 AN841 AN842 AN885 AN417 - Datasheet Archive
MICROCONTROLLERS (MCUs) APPLICATION NOTES ABSTRACTS BY TOPIC Rev. 6 November 2005 Ref. AN683 1 Table of Contents 1 ST6 FAMILY . .
8/16/32-BIT 8/16/32-BIT MICROCONTROLLERS (MCUs) APPLICATION NOTES ABSTRACTS BY TOPIC Rev. 6 November 2005 Ref. AN683 AN683 1 Table of Contents 1 ST6 FAMILY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10 1.1 APPLICATION EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 AN1501 AN1501:SIMPLE MICROCONTROLLED BALLAST . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.2 PROGRAMMING AND TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 AN1369 AN1369:GETTING STARTED WITH RAISONANCE IDE FOR ST6 MCUS . . . . . . . 10 1.3 SYSTEM DESIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.3.1 AN676 AN676: AN677 AN677: AN839 AN839: AN840 AN840: AN841 AN841: AN842 AN842: GRAPHICAL DESIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BATTERY CHARGER USING THE ST6-REALIZER ® . . . . . . . . . . . . . . . . PAINLESS "MCU" CODE BY GRAPHICAL APPLICATION DESCRIPTION ANALOG MULTIPLE KEY DECODING USING THE ST6-REALIZER . . . . CODED LOCK USING THE ST6-REALIZER. . . . . . . . . . . . . . . . . . . . . . . . A CLOCK DESIGN USING THE ST6-REALIZER . . . . . . . . . . . . . . . . . . . . 7 SEGMENT DISPLAY DRIVE USING THE ST6-REALIZER . . . . . . . . . . . 11 11 11 11 11 12 12 1.3.2 HOME APPLIANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 AN885 AN885: ST62 MICROCONTROLLERS DRIVE HOME APPLIANCE MOTOR TECHNOLOGY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.3.3 BATTERY MANAGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 AN417 AN417: FROM NICD TO NIMH FAST BATTERY CHARGING. . . . . . . . . . . . . . . . . 13 AN859 AN859: AN INTELLIGENT ONE HOUR MULTICHARGER FOR LI-ION, NIMH AND NICD BATTERIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 AN1464 AN1464:LOW-COST DOUBLE LI-ION BATTERY CHARGER USING ST6255C/ ST6255C/ ST6265C ST6265C MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 1.3.4 AN392 AN392: AN414 AN414: AN416 AN416: AN422 AN422: AN863 AN863: MOTOR CONTROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 MICROCONTROLLER AND TRIACS ON THE 110/240V 110/240V MAINS. . . . . . . . 16 CONTROLLING A BRUSH DC MOTOR WITH AN ST6265 ST6265 MCU . . . . . . . . 16 SENSORLESS MOTOR DRIVE WITH THE ST62 MCU + TRIAC. . . . . . . . 17 IMPROVES UNIVERSAL MOTOR DRIVE. . . . . . . . . . . . . . . . . . . . . . . . . . 17 IMPROVED SENSORLESS CONTROL WITH THE ST62 MCU FOR UNIVERSAL MOTOR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 AN1448 AN1448:HOW TO REDUCE 3RD HARMONICS WITH ST6200C ST6200C MOTOR CONTROL SOFTWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 AN1449 AN1449:ST6200C ST6200C UNIVERSAL MOTOR DRIVE SOFTWARE . . . . . . . . . . . . . . . . . 18 1.4 SYSTEM OPTIMIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.4.1 AN431 AN431: AN594 AN594: AN672 AN672: AN673 AN673: 2/89 1 COST REDUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USING ST6 ANALOG INPUTS FOR MULTIPLE KEY DECODING. . . . . . . DIRECT SOFTWARE LCD DRIVE WITH ST621X ST621X AND ST626X ST626X . . . . . . . . OPTIMIZING THE ST6 A/D CONVERTER ACCURACY . . . . . . . . . . . . . . . REDUCING CURRENT CONSUMPTION AT 32KHZ 32KHZ WITH ST62 . .89. . . . . 19 19 20 20 20 Table of Contents 1.4.2 AN420 AN420: AN432 AN432: AN434 AN434: AN435 AN435: AN669 AN669: AN670 AN670: AN671 AN671: AN911 AN911: AN975 AN975: DESIGN IMPROVEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EXPANDING A/D RESOLUTION OF THE ST6 A/D CONVERTER. . . . . . . USING ST62XX ST62XX I/O PORTS SAFELY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MOVEMENT DETECTOR CONCEPTS FOR NOISY ENVIRONMENTS . . DESIGNING WITH MICROCONTROLLERS IN NOISY ENVIRONMENTS SIMPLE RESET CIRCUITS FOR THE ST62 . . . . . . . . . . . . . . . . . . . . . . . . OSCILLATOR SELECTION FOR ST62 . . . . . . . . . . . . . . . . . . . . . . . . . . . . PREVENTION OF DATA CORRUPTION IN ST6 ON-CHIP EEPROM . . . . ST6 MICRO IS EMC CHAMPION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . UPGRADING FROM ST625X/6XB ST625X/6XB TO ST625X/6XC ST625X/6XC . . . . . . . . . . . . . . . . . 21 21 21 22 22 23 23 23 24 24 1.4.3 PERIPHERAL OPERATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN590 AN590: PWM GENERATION WITH ST62 AUTO-RELOAD TIMER . . . . . . . . . . . . . AN591 AN591: INPUT CAPTURE WITH ST62 AUTO-RELOAD TIMER . . . . . . . . . . . . . . . AN592 AN592: PLL GENERATION USING THE ST62 AUTO-RELOAD TIMER . . . . . . . . . AN593 AN593: ST62 IN-CIRCUIT PROGRAMMING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN678 AN678: LCD DRIVING WITH ST6240 ST6240. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN913 AN913: PWM GENERATION WITH ST62 16-BIT 16-BIT AUTO-RELOAD TIMER . . . . . . . AN914 AN914: USING ST626X ST626X SPI AS UART. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN1016 AN1016:ST6 USING THE ST623XB/ST628XB ST623XB/ST628XB UART. . . . . . . . . . . . . . . . . . . . . . . . AN1050 AN1050:ST6 INPUT CAPTURE WITH ST62 16-BIT 16-BIT AUTO-RELOAD TIMER . . . . . AN1127 AN1127:USING THE ST62T6XC/5XC ST62T6XC/5XC SPI IN MASTER MODE . . . . . . . . . . . . . . . . AN1447 AN1447:SOFTWARE DRIVER FOR 4-MULTIPLEXED LCD WITH A STANDARD ST62 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 25 25 25 26 26 26 26 27 27 27 27 2 ST7 FAMILY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 2.1 APPLICATION EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 AN1658 AN1658:SERIAL NUMBERING IMPLEMENTATION. . . . . . . . . . . . . . . . . . . . . . . . . 28 AN1755 AN1755:A HIGH RESOLUTION / PRECISION THERMOMETER USING ST7 AND NE555 NE555. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 AN1756 AN1756:CHOOSING A DALI IMPLEMENTATION STRATEGYWITH ST7DALI . . . . 28 AN1812 AN1812: A HIGH PRECISION, LOW COST, SINGLE SUPPLY ADC FOR POSITIVE AND NEGATIVE INPUT VOLTAGES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 2.2 EXAMPLE DRIVERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 AN969 AN969: AN970 AN970: AN971 AN971: AN972 AN972: AN973 AN973: SCI COMMUNICATION BETWEEN ST7 AND PC . . . . . . . . . . . . . . . . . . . 30 SPI COMMUNICATION BETWEEN ST7 AND EEPROM . . . . . . . . . . . . . . 30 I²C COMMUNICATION BETWEEN ST7 AND M24CXX M24CXX EEPROM . . . . . . . 30 ST7 SOFTWARE SPI MASTER COMMUNICATION. . . . . . . . . . . . . . . . . . 30 SCI SOFTWARE COMMUNICATION WITH A PC USING ST72251 ST72251 16-BIT 16-BIT TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 AN974 AN974: REAL TIME CLOCK WITH THE ST7 TIMER OUTPUT COMPARE . . . . . . 31 AN976 AN976: DRIVING A BUZZER USING THE ST7 PWM FUNCTION . . . . . . . . . . . . . 31 AN979 AN979: DRIVING AN ANALOG KEYBOARD WITH THE ST7 ADC . . . . . . . . . . . . . 31 3/89 1 Table of Contents AN980 AN980: ST7 KEYPAD DECODING TECHNIQUES, IMPLEMENTING WAKE-UP ON KEYSTROKE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 AN1017 AN1017:USING THE ST7 USB MICROCONTROLLER . . . . . . . . . . . . . . . . . . . . . . 31 AN1041 AN1041:USING ST7 PWM SIGNAL TO GENERATE ANALOG OUTPUT (SINUSOID) 31 AN1042 AN1042:ST7 ROUTINE FOR I²C SLAVE MODE MANAGEMENT . . . . . . . . . . . . . . 32 AN1044 AN1044:MULTIPLE INTERRUPT SOURCES MANAGEMENT FOR ST7 MCUS . . . 32 AN1045 AN1045:ST7 SOFTWARE IMPLEMENTATION OF I²C BUS MASTER . . . . . . . . . . 32 AN1046 AN1046:ST7 UART EMULATION SOFTWARE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 AN1047 AN1047:MANAGING RECEPTION ERRORS WITH THE ST7 SCI PERIPHERAL. . 32 AN1048 AN1048:ST7 SOFTWARE LCD DRIVER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 AN1078 AN1078:ST7 TIMER PWM DUTY CYCLE SWITCH FOR TRUE 0% OR 100% DUTY CYCLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 AN1082 AN1082:DESCRIPTION OF THE ST72141 ST72141 MOTOR CONTROL PERIPHERAL REGISTERS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 AN1083 AN1083:ST72141 ST72141 BLDC MOTOR CONTROL SOFTWARE AND FLOWCHART EXAMPLE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 AN1105 AN1105: ST7 PCAN PERIPHERAL DRIVER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 AN1129 AN1129:PWM MANAGEMENT FOR BLDC MOTOR DRIVES USING THE ST7214134 ST7214134 AN1130 AN1130:AN INTRODUCTION TO SENSORLESS BRUSHLESS DC MOTOR DRIVE APPLICATIONS WITH THE ST72141 ST72141 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 AN1148 AN1148:USING THE ST7263 ST7263 FOR DESIGNING A USB MOUSE. . . . . . . . . . . . . . . 35 AN1149 AN1149:HANDLING SUSPEND MODE ON A USB MOUSE . . . . . . . . . . . . . . . . . . 35 AN1180 AN1180:USING THE ST7263 ST7263 KIT TO IMPLEMENT A USB GAME PAD . . . . . . . . . 36 AN1276 AN1276:BLDC MOTOR START ROUTINE FOR THE ST72141 ST72141 MICROCONTROLLER 36 AN1321 AN1321:USING THE ST72141 ST72141 MOTOR CONTROL MCU IN SENSOR MODE . . . . 37 AN1325 AN1325:USING THE ST7 USB LOW-SPEED FIRMWARE V4.X . . . . . . . . . . . . . . . 37 AN1445 AN1445:USING THE ST7 SPI TO EMULATE A 16-BIT 16-BIT SLAVE . . . . . . . . . . . . . . . . 37 AN1475 AN1475:DEVELOPING AN ST7265X ST7265X MASS STORAGE APPLICATION . . . . . . . . . 38 AN1504 AN1504:STARTING A PWM SIGNAL DIRECTLY AT HIGH LEVEL USING THE ST7 16BIT 16BIT TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 AN1602 AN1602:16-BIT 16-BIT TIMING OPERATIONS USING ST7262 ST7262 OR ST7263B ST7263B MCUS. . . . . 38 AN1633 AN1633:DEVICE FIRMWARE UPGRADE (DFU) IMPLEMENTATION IN NON-USB APPLICATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 AN1712 AN1712:GENERATING A HIGH RESOLUTION SINEWAVE USING ST7 PWMART 39 AN1713 AN1713:SMBUS SLAVE DRIVER FOR ST7 I2C PERIPHERAL . . . . . . . . . . . . . . . . 39 AN1753 AN1753:SOFTWARE UART USING ST7 12-BIT 12-BIT AUTORELOAD TIMER. . . . . . . . . 39 AN1947 AN1947:ST7MC PMAC SINE WAVE MOTOR CONTROL SOFTWARE LIBRARY . 39 2.3 PRODUCT EVALUATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 AN910 AN910: ST7 AND ST9 PERFORMANCE BENCHMARKING . . . . . . . . . . . . . . . . . . 40 AN990 AN990: ST7 BENEFITS VERSUS INDUSTRY STANDARD . . . . . . . . . . . . .89. . . . 40 . AN1077 AN1077:OVERVIEW OF ENHANCED CAN CONTROLLERS FOR ST7 AND ST9 MCUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4/89 1 Table of Contents AN1086 AN1086:ST7 / ST10 U435 CAN-DO SOLUTIONS FOR CAR MULTIPLEXING . . . . AN1150 AN1150:BENCHMARK ST72 VS PC16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN1151 AN1151:PERFORMANCE COMPARISON BETWEEN ST72254 ST72254 & PC16F8 PC16F8 . . . . . . AN1278 AN1278: LIN (LOCAL INTERCONNECT NETWORK) SOLUTIONS . . . . . . . . . . . . . 41 41 42 42 2.4 PRODUCT MIGRATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 AN1131 AN1131:MIGRATING APPLICATIONS FROM ST72511/311/214/124 ST72511/311/214/124 TO ST72521/321/ ST72521/321/ 324 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 AN1322 AN1322:MIGRATING AN APPLICATION FROM ST7263 ST7263 REV.B TO ST7263B ST7263B . . . . 43 AN1365 AN1365:GUIDELINES FOR MIGRATING ST72C254 ST72C254 APPLICATIONS TO ST72F264 ST72F264. 43 AN1604 AN1604:HOW TO USE ST7MDT1-TRAIN WITH ST72F264 ST72F264 . . . . . . . . . . . . . . . . . . . 43 AN1752 AN1752:ST72324 ST72324 QUICK REFERENCE NOTE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 AN2197 AN2197:GUIDELINES FOR MIGRATING ST72F324 ST72F324 & ST72F321APPLICATIONS ST72F321APPLICATIONS TO ST72F324B ST72F324B, ST72F321B ST72F321B OR ST72F325 ST72F325 . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 AN2200 AN2200:GUIDELINES FOR MIGRATING ST7LITE1X APPLICATIONS TO ST7FLITE1XB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.5 PRODUCT OPTIMIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 AN982 AN982: USING CERAMIC RESONATORS WITH THE ST7 . . . . . . . . . . . . . . . . . . 45 AN1014 AN1014:HOW TO MINIMIZE THE ST7 POWER CONSUMPTION . . . . . . . . . . . . . . 45 AN1040 AN1040:MONITORING THE VBUS SIGNAL FOR USB SELF-POWERED DEVICES45 DEVICES45 AN1070 AN1070:ST7 CHECKSUM SELFCHECKING CAPABILITY. . . . . . . . . . . . . . . . . . . . 45 AN1324 AN1324:CALIBRATING THE RC OSCILLATOR OF THE ST7FLITE0 MCU USING THE MAINS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 AN1477 AN1477:EMULATED DATA EEPROM WITH XFLASH MEMORY . . . . . . . . . . . . . . 46 AN1502 AN1502:EMULATED DATA EEPROM WITH ST7 HDFLASH MEMORY . . . . . . . . . 46 AN1529 AN1529:EXTENDING THE CURRENT & VOLTAGE CAPABILITY ON THE ST7265 ST7265 VDDF SUPPLY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 AN1530 AN1530:ACCURATE TIMEBASE FOR LOW-COST ST7 APPLICATIONS WITH INTERNAL RC OSCILLATOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 AN1605 AN1605:USING AN ACTIVE RC TO WAKEUP THE ST7LITE0 FROM POWER SAVING MODE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 AN1636 AN1636:UNDERSTANDING AND MINIMIZING ADC CONVERSION ERRORS . . . 47 AN1946 AN1946:SENSORLESS BLDC MOTOR CONTROL AND BEMF SAMPLING METHODS WITH ST7MC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 AN1953 AN1953:PFC FOR ST7MC STARTER KIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 AN1971 AN1971:ST7LITE0 MICROCONTROLLED BALLAST . . . . . . . . . . . . . . . . . . . . . . . . 48 2.6 PROGRAMMING AND TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 AN978 AN978: AN983 AN983: AN985 AN985: AN986 AN986: AN987 AN987: ST7 VISUAL DEBUG SOFTWARE KEY DEBUGGING FEATURES. . . . . . KEY FEATURES OF THE COSMIC ST7 C-COMPILER PACKAGE . . . . . . EXECUTING CODE IN ST7 RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . USING THE ST7 INDIRECT ADDRESSING MODE . . . . . . . . . . . . . . . . . . ST7 IN-CIRCUIT PROGRAMMING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 49 49 49 49 5/89 Table of Contents AN988 AN988: STARTING WITH ST7 ASSEMBLY TOOL CHAIN . . . . . . . . . . . . . . . . . . . 50 AN989 AN989: STARTING WITH ST7 HIWARE C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 AN1039 AN1039:ST7 MATH UTILITY ROUTINES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 AN1064 AN1064:WRITING OPTIMIZED HIWARE C LANGUAGE FOR ST7 . . . . . . . . . . . . . 50 AN1071 AN1071:HALF DUPLEX USB-TO-SERIAL BRIDGE USING THE ST72611 ST72611 USB MICROCONTROLLER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 AN1106 AN1106:TRANSLATING ASSEMBLY CODE FROM HC05 TO ST7 . . . . . . . . . . . . . 51 AN1179 AN1179:PROGRAMMING ST7 FLASH MICROCONTROLLERS IN REMOTE ISP . 51 AN1446 AN1446:USING THE ST72521 ST72521 EMULATOR TO DEBUG A ST72324 ST72324 TARGET APPLICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 AN1478 AN1478:PORTING AN ST7 PANTA PROJECT TO CODEWARRIOR IDE . . . . . . . . 52 AN1527 AN1527:DEVELOPING A USB SMARTCARD READER WITH ST7SCR . . . . . . . . . 52 AN1575 AN1575:ON-BOARD PROGRAMMING METHODS FOR XFLASH AND HDFLASH ST7 MCUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 AN1576 AN1576:IN-APPLICATION PROGRAMMING (IAP) DRIVERS FOR ST7 HDFLASH OR XFLASH MCUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 AN1577 AN1577:ST7 - DEVICE FIRMWARE UPGRADE (DFU) IMPLEMENTATION IN ST7 USB DEVICES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 AN1601 AN1601:SOFTWARE IMPLEMENTATION FOR ST7DALI-EVAL . . . . . . . . . . . . . . . 53 AN1603 AN1603:USING THE ST7 USB DEVICE FIRMWARE UPGRADE DEVELOPMENT KIT (DFU-DK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 AN1635 AN1635:ST7 CUSTOMER ROM CODE RELEASE INFORMATION. . . . . . . . . . . . . 53 AN1754 AN1754:DATA LOGGING PROGRAM FOR TESTING ST7 APPLICATIONS VIA ICC. 54 AN1796 AN1796:FIELD UPDATES FOR FLASH BASED ST7 APPLICATIONS USING A PC COMM PORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 AN1900 AN1900:HARDWARE IMPLEMENTATION FOR ST7DALI-EVAL . . . . . . . . . . . . . . . 54 AN1904 AN1904:ST7MC THREE-PHASE AC INDUCTION MOTOR CONTROL SOFTWARE LIBRARY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 AN1905 AN1905:ST7MC THREE-PHASE BLDC MOTOR CONTROL SOFTWARE LIBRARY55 LIBRARY55 2.7 SYSTEM OPTIMIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 AN1711 AN1711: SOFTWARE TECHNIQUES FOR COMPENSATING ST7 ADC ERRORS 56 AN1827 AN1827: IMPLEMENTATION OF SIGMA-DELTA ADC WITH ST7FLITE05/09 ST7FLITE05/09 . . . . 56 AN1828 AN1828: PIR (PASSIVE INFRARED) DETECTOR USING ST7FLITE05/09/SUPERLITE ST7FLITE05/09/SUPERLITE 56 AN1830 AN1830: ACHIEVING HIGH ACCURACY AND 13-BIT 13-BIT RESOLUTION WITH ST7LITE2 ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 AN2009 AN2009: PWM MANAGEMENT FOR 3-PHASE BLDC MOTOR DRIVES USING THE ST7FMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 AN2030 AN2030: BACK EMF DETECTION DURING PWM ON TIME BY ST7MC. . . . . . . . . 57 89 6/89 Table of Contents 3 STR7 FAMILY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 3.1 APPLICATION EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 AN1774 AN1774:STR71X STR71X SOFTWARE DEVELOPMENT GETTING STARTED . . . . . . . . . . AN1775 AN1775: STR71X STR71X HARDWARE DEVELOPMENT GETTING STARTED . . . . . . . . . AN1776 AN1776: INTERRUPT HANDLING FOR STR7 MICROCONTROLLERS . . . . . . . . . AN1777 AN1777: STR71X STR71X MEMORY MAPPING AND DEVELOPMENT TOOLSET . . . . . . . AN1778 AN1778: STR7 ARM MULTI-ICE SETUP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN1780 AN1780: STR71X STR71X RTC APPLICATION EXAMPLE . . . . . . . . . . . . . . . . . . . . . . . . . . AN1781 AN1781: STR71X STR71X GPIO DRIVING FOUR 7-SEGMENT DISPLAY . . . . . . . . . . . . . . AN1782 AN1782: STR71X STR71X I2C COMMUNICATION WITH M24CXX M24CXX EEPROM . . . . . . . . . . . AN1797 AN1797: STR71X STR71X UART COMMUNICATION WITH A PC USING RS232 RS232 . . . . . . . . AN1798 AN1798: STR71X STR71X ADC CONVERSION SPEED-UP . . . . . . . . . . . . . . . . . . . . . . . . . AN1799 AN1799: STR71X STR71X GPIO DRIVING A 4X4 MATRIX KEYPAD . . . . . . . . . . . . . . . . . . AN1800 AN1800: STR71X STR71X BSPI USED AS AN UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AN1809 AN1809: STR71X STR71X ADC DRIVING AN ANALOG KEYBOARD . . . . . . . . . . . . . . . . . . AN1810 AN1810: STR71X STR71X BSPI COMMUNICATION WITH M25P10-A M25P10-A SERIAL FLASH . . . . AN1907 AN1907: STR720 STR720 HARDWARE DEVELOPMENT GETTING STARTED. . . . . . . . . . AN1908 AN1908: STR720 STR720 SOFTWARE DEVELOPMENT GETTING STARTED . . . . . . . . . . AN2046 AN2046: STR71X STR71X CLOCK CONFIGURATIONS EASY SETUP. . . . . . . . . . . . . . . . . AN2156 AN2156: STR73X STR73X HARDWARE GETTING STARTED . . . . . . . . . . . . . . . . . . . . . . . AN2260 AN2260: STR73X STR73X SYSTEMMEMORY MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 58 58 58 58 59 59 59 59 59 60 60 60 60 60 60 60 61 61 3.2 PROGRAMMING AND TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 AN2077 AN2077:EEPROM EMULATION WITH STR71X STR71X . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 AN2078 AN2078:STR71X STR71X IN-APPLICATION PROGRAMMING USING UART . . . . . . . . . . . 62 AN2099 AN2099:GUIDELINES FOR CONNECTING VIA JTAG PROTOCOL TO THE STR71X STR71X MICROCONTROLLER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 4 ST9 FAMILY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 4.1 APPLICATION EXAMPLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 AN413 AN413: INITIALIZATION OF THE ST9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 AN415 AN415: USING THE I2C-BUS PROTOCOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 AN421 AN421: STACK OVERFLOW DETECTION USING THE ST9 TIMER WATCHDOG 65 AN910 AN910: ST7 AND ST9 PERFORMANCE BENCHMARKING . . . . . . . . . . . . . . . . . . 65 AN1069 AN1069:ADDRESSING UP TO 4 MBYTES OF MEMORY FROM A ST9+ WITH A 16BIT 16BIT EXTERNAL BUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 AN1076 AN1076:ST9 EXTERNAL MEMORY INTERFACE CONFIGURATION . . . . . . . . . . . 66 AN1087 AN1087:ST9+ INTERRUPT RESPONSE TIME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 AN1275 AN1275:IN APPLICATION PROGRAMMING FOR ST92F120 ST92F120 . . . . . . . . . . . . . . . . . 66 AN1450 AN1450:ST9 FLASH PROGRAMMING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 AN1479 AN1479:HIGH-PERFORMANCE MOTOR SYSTEM FOR WASHING MACHINES . 66 7/89 Table of Contents 4.2 EXAMPLE DRIVERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 AN1084 AN1084:GETTING STARTED WITH THE ST92141 ST92141 SOFTWARE LIBRARY - VERSION 1.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 AN1277 AN1277:ST92141 ST92141 AC MOTOR CONTROL SOFTWARE LIBRARY VERSION 2.0 UPDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 AN1367 AN1367:ST92141 ST92141 AC MOTOR CONTROL SOFTWARE LIBRARY VERSION 2.1 UPDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 4.3 PRODUCT EVALUATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 AN1278 AN1278:LIN (LOCAL INTERCONNECT NETWORK) SOLUTIONS . . . . . . . . . . . . . 69 AN1077 AN1077:OVERVIEW OF ENHANCED CAN CONTROLLERS FOR ST7 AND ST9 MCUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 4.4 PRODUCT MIGRATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 AN977 AN977: GUIDELINES FOR UPGRADING FROM THE ST92F120 ST92F120 (0.50 µM) TO THE ST92F124 ST92F124 AND ST92F150 ST92F150 (0.35 µM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.5 PROBLEM RESOLUTION GUIDELINES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 AN1474 AN1474:ST92F150 ST92F150 AND ST92F120 ST92F120 PROBLEM RESOLUTION GUIDELINES. . . . . 71 4.6 PRODUCT OPTIMIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 AN1040 AN1040:MONITORING THE VBUS SIGNAL FOR USB SELF-POWERED DEVICES72 DEVICES72 AN1152 AN1152:OPTIMIZING THE USAGE OF THE ST92F120 ST92F120 EEPROM . . . . . . . . . . . . . 72 AN1498 AN1498:DESIGNING A THREE PHASE AC INVERTER CONTROL & INTERFACE BOARD WITH THE ST92141 ST92141 MCU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 AN1499 AN1499:DESIGNING A LOW COST POWER BOARD FOR THE ST92141 ST92141 MOTOR CONTROL MCU WITHOUT USING IPMS. . . . . . . . . . . . . . . . . . . . . . . . . . 73 AN1528 AN1528:ST92F120/F124/150/F250 ST92F120/F124/150/F250 TESTFLASH . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.7 PROGRAMMING AND TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 AN1578 AN1578:DEVELOPING ST92F250 ST92F250 APPLICATIONS USING THE ST92F150-EMU2 ST92F150-EMU2 EMULATOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 5 ST10 FAMILY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75 5.1 EXAMPLE DRIVERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 AN1099 AN1099:DSP MAC SIGNAL PROCESSING ALGORITHMS . . . . . . . . . . . . . . . . . . . 75 AN1101 AN1101:PROGRAMMING ST10X167/ST10F168 ST10X167/ST10F168 CAN INTERRUPT DRIVERS. . . . 75 AN1102 AN1102:DIRECT MEMORY ACCESS USING MAC . . . . . . . . . . . . . . . . . . . . . . . . . 76 5.2 PRODUCT EVALUATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 AN1086 AN1086:ST7 / ST10 U435 CAN-DO SOLUTIONS FOR CAR MULTIPLEXING . . . . 77 5.3 PRODUCT MIGRATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 89 AN1313 AN1313:PORTING AN APPLICATION FROM THE ST10F168 ST10F168 TO THE ST10F269 ST10F269. 78 8/89 Table of Contents 5.4 PRODUCT OPTIMIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 AN1100 AN1100:ST10X167/F168 ST10X167/F168 REDUCING ANALOG-DIGITAL CONVERSION ERROR. 79 AN1109 AN1109:ST10X167/F168 ST10X167/F168 MINIMIZING POWER CONSUMPTION FOR SPI EEPROMS 79 5.5 PROGRAMMING AND TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 AN1247 AN1247:ST10F168 ST10F168 ST EMBEDDED ALGORITHM KERNEL (STEAK) FOR FLASH PROGRAMMING / ERASING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 6 TUTORIALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 6.1 GENERAL PURPOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 AN886 AN886: SELECTING BETWEEN ROM AND OTP FOR A MICROCONTROLLER . AN887 AN887: MAKING IT EASY WITH MICROCONTROLLERS . . . . . . . . . . . . . . . . . . . AN899 AN899: SOLDERING RECOMMENDATIONS AND PACKAGING INFORMATION . AN900 AN900: INTRODUCTION TO SEMICONDUCTOR TECHNOLOGY. . . . . . . . . . . . . AN1068 AN1068:SELECTING BETWEEN ROM, FASTROM AND FLASH FOR A MICROCONTROLLER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 81 81 82 82 6.2 PRODUCT OPTIMIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 AN898 AN898: EMC GENERAL INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 AN901 AN901: EMC GUIDE-LINES FOR MICROCONTROLLER - BASED APPLICATIONS . 83 6.3 PROGRAMMING AND TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 AN912 AN912: A SIMPLE GUIDE TO DEVELOPMENT TOOLS . . . . . . . . . . . . . . . . . . . . . 84 7 GENERAL MCU FAMILIES . . . . . . . . . . . . . . . . . . . . . . . . . . . .85 AN1015 AN1015:SOFTWARE TECHNIQUES FOR IMPROVING MICROCONTROLLER EMC PERFORMANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 AN1181 AN1181:ELECTROSTATIC DISCHARGE SENSITIVITY MEASUREMENT . . . . . . . 85 AN1476 AN1476:LOW-COST POWER SUPPLY FOR HOME APPLIANCES . . . . . . . . . . . . 85 AN1709 AN1709:EMC DESIGN GUIDE FOR ST MICROCONTROLLERS . . . . . . . . . . . . . . 85 AN1720 AN1720:MANAGING THE READ-OUT PROTECTION IN FLASH MICROCONTROLLERS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 9/89 ST6 FAMILY - APPLICATION EXAMPLES 1 ST6 FAMILY 1.1 APPLICATION EXAMPLES AN1501 AN1501:SIMPLE MICROCONTROLLED BALLAST The purpose of this paper is to give a basic understanding of a microcontroller and its potential usage in an electronic ballast. A brief summary of how the microcontroller operates and the most common types of functions it can perform will be shown as they relate to being used in an electronic ballast. Next, ideas of how to implement the most common functions and their associated advantages/weaknesses will be examined. Finally, a brief summary of things that should be examined closely will be presented to help assure a good start to a basic microcontrolled ballast design. 1.2 PROGRAMMING AND TOOLS AN1369 AN1369:GETTING STARTED WITH RAISONANCE IDE FOR ST6 MCUS Ride is the development toolchain for ST62 developed by Raisonance. This fully Integrated Development Environment supports all the ST62 microcontroller family and features a powerful macro-assembler, a linker, a C compiler and a state-of-the-art simulator and debugger. It can drive the ST6-HDS2, CEIBO EB-ST62 EB-ST62 and SOFTEC DS6225A DS6225A & DS6265A DS6265A emulators. 10/89 1 ST6 FAMILY - SYSTEM DESIGN 1.3 SYSTEM DESIGN 1.3.1 GRAPHICAL DESIGN AN676 AN676:BATTERY CHARGER USING THE ST6-REALIZER ® Because competition becomes greater and greater it is important to reduce time to market. The ST6 Realizer helps to fullfill this duty. The time needed to realize a design is dramatically reduced. Design of an application takes a few days instead of a few weeks. Users who develop ST6 applications are systems electronics engineers; Often they do not know the assembler well and there are reluctant to use it. The ST6 Realizer allows users to design their applications using symbols known by hardware designers such as comparators, counters, multiplexers. Once the design is over, the ST6 Realizer generates assembly code or executable code for the different ST6 target hardware. AN677 AN677:PAINLESS "MCU" CODE BY GRAPHICAL APPLICATION DESCRIPTION Some electromechanics and automatics engineers hesitate to use microcontroller (MCU) solutions despite their recognised advantages: High integration and flexibility for enhanced features. Their main worry is the unpleasant aspect of MCU application development: Learning, code writing, debugging through quite unconvivial tools. Fortunately, it is possible today to use these tools (and to keep the genuine integrity of the code issued) through a graphic interface. This new complete toolbox, the ST6-Realizer ®, allows a graphical description of the system, automatic code generation, simulation and debugging. AN839 AN839:ANALOG MULTIPLE KEY DECODING USING THE ST6-REALIZER Design of a multiple key decoder using the A/D converter present on the ST62 MCU. This note describes how the A/D convertor can be used to reduce the number of I/O lines required for key decoding. Software development is carried out using the ST6-REALIZER, and therefore does not involve writing code in assembly language. AN840 AN840:CODED LOCK USING THE ST6-REALIZER Design of a coded security lock. This application uses the EEPROM on the ST62 MCU to store the secret code. Code entry and recognition is performed under software control. Software development is carried out using the ST6-REALIZER, and therefore does not involve writing code in assembly language. 11/89 1 ST6 FAMILY - SYSTEM DESIGN AN841 AN841:A CLOCK DESIGN USING THE ST6-REALIZER Design of a clock system. This note provides an example of time management using the Timer embedded in the ST62 MCU. Current time setting and alarm time setting are carried out under software control. Software development is carried out using the ST6-REALIZER, and therefore does not involve writing code in assembly language. AN842 AN842:7 SEGMENT DISPLAY DRIVE USING THE ST6-REALIZER Design of 7-segment driver functions. This note provides an example of the use of lookup tables for conversion or coding purposes. Single digit and multiple digit display applications are described. Software development is carried out using the ST6-REALIZER, and therefore does not involve writing code in assembly language. 1.3.2 HOME APPLIANCE AN885 AN885:ST62 MICROCONTROLLERS DRIVE HOME APPLIANCE MOTOR TECHNOLOGY Most domestic appliances are driven by an electric motor; for the most part, these motors are controlled in a simple and rudimentary fashion, and electronics is only now beginning to be applied. This article describes the three main motor families Universal, Induction and Electronically Commutated as well as the relevant electronic control techniques, now possible thanks to the intrinsic characteristics of STMicroelectronics' ST62 Family of microcontrollers. ST62 MCUs, with their wide range of on-chip peripherals, their wide supply voltage range, their built-in ruggedness and their legendary noise immunity allow truly low total system cost, thus favouring the technological advancement of electrical motor design. Basic electrical topologies are described, together with their associated power and signal electronics. The relative strengths and weaknesses are explored, using practical examples, in order to illustrate the advantages of electronic control using ST62 MCUs. 12/89 1 ST6 FAMILY - SYSTEM DESIGN 1.3.3 BATTERY MANAGEMENT Portable equipment is proliferating in the consumer, telecom and home appliance fields. This equipment requires batteries that are powerful, small, environmentally safe and fast to charge. As answers to the diversity of the applications requests, a large variety of technologies of batteries are available on the market. Most of these batteries require a sophisticated control algorithm in order to achieve a fast and safe charge and to maximize the battery life time. A standard ST62 microcontroller loaded with a dedicated program controls the temperature, the peak voltage (V), the dV/dt or the inflexion point of the battery voltage. It ensures that the charging stops when the electrochemical process is finished, once the battery is full and not yet heated-up. Application notes AN417 AN417 and AN433 AN433 describe in detail the software algorithm and the hardware implementation for the fast charge of such batteries. The note AN433 AN433 details the charging in 1/4 hour of NiCd batteries using a (-DeltaV) method. AN417 AN417 presents another control technique based on the measurement of the inflexion point of the battery voltage, it is applied to a NiMH battery. These programs can be used as a basis for customizing such as battery discharge, gas gauge, display or an adaptation to other battery types, for instance Alkaline Lithium or Lithium Ion. AN417 AN417:FROM NICD TO NIMH FAST BATTERY CHARGING Rechargeable batteries are quickly becoming a major benefit to current lifestyles. They allow such utilities as portable telephones, camcorders, cordless power tools, portable appliances and audio equipment. The charging of Rechargeable batteries often requires to take place in one hour and less for user convenience in applications which discharge rapidly, for example cordless power drills. The optimum fast charging techniques for Nickel Cadmium batteries are well known (please refer to AN433 AN433, Fast NiCd Battery Charging using ST6210 ST6210 MCU), however these techniques are not suitable for the charging of batteries using the more environmentally friendly Nickel Hydride (NiMH) technology. This Application Note shows the differences in the charging of the two technologies and how a Fast Battery Charger compatible with both NiCd and NiMH can be made with the ST6210 ST6210 MCU. The MCU control shown is able to provide three level charge termination methods for safe charging. 13/89 1 ST6 FAMILY - SYSTEM DESIGN AN859 AN859:AN INTELLIGENT ONE HOUR MULTICHARGER FOR LI-ION, NIMH AND NICD BATTERIES A new intelligent multicharger concept, fully compatible with Li-Ion, NiCd and NiMH battery technology, illustrating the power and flexibility offered by a low-cost industry standard Microcontroller and the ease with which existing designs may be adapted to cater for emerging technologies. A low-cost, high resolution, voltage measurement technique using capacitor charge time is also described. AN1464 AN1464:LOW-COST DOUBLE LI-ION BATTERY CHARGER USING ST6255C/ST6265C ST6255C/ST6265C MCU In everyday life, more and more portable electronic appliances, such as mobile phones, are powered by rechargeable batteries with a requirement for high capacity, small size and low weight. Li-ion batteries have been widely used to support these kind of devices due to their superior capacity for a given size and weight. This Application Note explains how to use the ST6255C ST6255C 8-bit Microcontroller in a cost-effective battery charger for Li-ion batteries, as implemented in the Li-ion Battery Charger Demonstration Board. The design implemented on this Board is easily scaleable to other types of Liion batteries simply by changing the software parameters and primary input voltage/current. 14/89 1 ST6 FAMILY - SYSTEM DESIGN 1.3.4 MOTOR CONTROL Microcontrollers are now commonly used to drive motors.They enable control the speed, the torque or the power on the load. They include safety features and interface to a large variety of sensors. In addition, the flexibility provided by the software enables the adaptation the same device to different types of motors and equipment for a limited cost. ST62 Microcontrollers operate directly on the mains with a minimum of surrounding components thanks to their integrated noise immunity. In addition their embedded A/D converter and their ability to drive directly the power stage simplify the user and power interfacing. Application notes AN392 AN392 and AN416 AN416 describe Universal motor controls where the power device is a triac. AN392 AN392 presents with a practical example of what an ST62 microcontroller can provide in a motor drive in term of control, protection and user interface. AN416 AN416 describes how the same control can be slightly adapted to achieve low cost speed compensation of the same motor without a speed sensor. Application note AN414 AN414 presents an innovative motor control which enables high volumic power and a large speed variation range. The motor is a DC Permanent Magnet Motor; the Power stage is a Pulse Width Modulation chopper based on an IGBT and the control is achieved by an ST62 Microcontroller which directly interfaces to the analog sensors and the power stage. These circuits can be used in a large variety of applications such as home appliances (washing machine, food processor, drill,.) and industrial systems (pump, light dimmer, alarm,.). 15/89 1 ST6 FAMILY - SYSTEM DESIGN AN392 AN392:MICROCONTROLLER AND TRIACS ON THE 110/240V 110/240V MAINS Microcontrollers are in common use in most areas of electronics. They now penetrate the very cost sensitive arena of home appliance applications. The demonstration board described in this Application Note shows that enhanced appliances can be designed with fast prototyping time using microcontrollers such as the ST6210 ST6210. The circuit presented is an enhanced light dimmer operating from the 110/240V 110/240V mains. It drives incandescent and halogen lamps supplied either directly from the mains or through a low voltage transformer. The same circuit can also drive a universal motor. It includes soft start and protection features. Different user interfaces can be chosen: touch sensor, push button or potentiometer. All this is achieved with only few components: a microcontroller ST6210 ST6210, a Logic Level or a snubberless triac and some passive components. Additional features like presence detection, IR remote control, homebus interface and motor speed control can be implemented from the existing solution. AN414 AN414:CONTROLLING A BRUSH DC MOTOR WITH AN ST6265 ST6265 MCU Microcontrollers are used more and more in motor drives, most commonly to turn on and off the motor, or to control the triggering angle of a triac, associated with a universal motor. In this paper, the universal motor is replaced by a permanent magnet DC motor, which offers the advantage of yielding a high power in a small volume. The variable speed drive is supplied from the rectified mains voltage, and consists of a chopper driven by a PWM signal generated by the ST6265 ST6265 microcontroller (MCU). The ST6265 ST6265 MCU measures the DC supply voltage and adjusts the PWM duty cycle accordingly. So the motor voltage is regulated in case of mains and load variations, the motor speed is adjusted and the motor current ripple is reduced, thus reducing acoustic noise and losses in the motor. This drive also implements a software power limitation, which avoids motor overheating in case of excessive loading. Software flexibility allows to easily modify drive parameters such as maximum power, time constants, etc. The drive principle and practical results are given. 16/89 1 ST6 FAMILY - SYSTEM DESIGN AN416 AN416:SENSORLESS MOTOR DRIVE WITH THE ST62 MCU + TRIAC Home appliance applications require more and more electronic control in order to meet the new requests and constraints of the consumers. Microcontrollers have been typically limited to high end applications because their performance appear to be overrated when related to the functions of the application. In reality, home appliances require microcontrollers which trade closely on the compromise between cost and performance. This Application Note describes how a low cost speed drive is designed with a microcontroller, a triac and an a.c. universal motor. The control of the motor operates with sensorless speed control, based only on a motor current feedback. The example shown is adapted to food processor and to drill applications. AN422 AN422:IMPROVES UNIVERSAL MOTOR DRIVE Universal motors are traditionally used in AC current mode of control with a Triac-based control circuit. This provides a low-cost circuit, but has potential drawbacks in high peak to peak current giving poor motor efficiency and high brush temperature leading to a limited motor lifetime. Operation in DC current mode provides a solution to these problems and also the increased efficiency allows a reduction in the size of the motor. Motor noise is also reduced. This Application Note presents three solutions for control of a Universal Motor, in AC and DC current modes with a comparison of the efficiency of each. The modes covered are: AC drive with Triac, DC drive with Triac and rectifier bridge DC drive with an IGBT and rectifier bridge. In all cases the control of the drive is made by a microcontroller, the ST6, with an illustration of the circuit and additional functionality possible. AN863 AN863:IMPROVED SENSORLESS CONTROL WITH THE ST62 MCU FOR UNIVERSAL MOTOR The universal motor is today the most widely used motor in home appliances (vacuum cleaner, washer, hand tool, food processor.). This note describes a speed regulator without sensor: the speed sensing is per-formed indirectly by the ST6220 ST6220, low-cost 8-bit microcontroller, measuring the motor current. Performance results are given, which are in line with the need of many home appliances. 17/89 1 ST6 FAMILY - SYSTEM DESIGN AN1448 AN1448:HOW TO REDUCE 3RD HARMONICS WITH ST6200C ST6200C MOTOR CONTROL SOFTWARE Universal motors are widely used in home appliances such as vacuum cleaners, washing machines, power tools and food processors. However, universal motors produce a strong 3rd harmonic current. When the TRIAC conduction is not in full wave mode, the motor current contains high amplitude 3rd harmonics which may not comply with the 3rd harmonics limits set by the IEC61000-3-2 IEC61000-3-2 standard. In practice, it is very difficult to comply with the harmonics standard when driving universal motors with a power of more than 1200W. This application note presents an innovative, cost-saving solution for suppressing 3rd harmonic current in the power line. The control principle is based on modulation of the phase angle delay times and is easily implemented in software using a low cost ST6200C ST6200C microcontroller. The output motor current waveform is modulated so as to suppress specified harmonic components. The efficiency of this method has been proven on a 1500W vacuum cleaner under various load conditions. The measurement of harmonic components and motor power was done with a digital power meter (WT1030 WT1030). The results show much better harmonic performance than symmetrical phase control methods. AN1449 AN1449:ST6200C ST6200C UNIVERSAL MOTOR DRIVE SOFTWARE This application note describes the software of a low-cost phase-angle motor control drive system based on a ST6200C ST6200C microcontroller and a BTB16-600CW BTB16-600CW snubberless triac. The application has been developed by STMicroelectronics and is available as a low-cost evaluation board UMC01EVAL UMC01EVAL. 18/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION 1.4 SYSTEM OPTIMIZATION 1.4.1 COST REDUCTION A microcontroller can save cost by itself but also by the external components it can save. The notes presented in this chapter show how to take full advantage of the ST62 flexible I/O pins and A/D converter to decrease the component count and provide enhanced features. AN431 AN431 explains how to save pins on the ST62 microcontroller by using only one or two I/O pins which decode a keyboard with the A/D converter. AN594 AN594 proposes to use a standard ST62 in a small package to drive LCD displays by modifying the I/O configuration during the operation of the microcontroller. AN672 AN672 explains how to optimize the ST62 A/D converter accuracy using a software filter to eliminate the noise coming from the input signal or from the supply. AN673 AN673 suggests a simple circuit to reduce the ST62 power consumption when operating with a 32kHz oscillator. AN431 AN431:USING ST6 ANALOG INPUTS FOR MULTIPLE KEY DECODING The ST6 on-chip Analog to Digital Converter (ADC) is a useful peripheral integrated into the silicon of the ST6 family members. The flexibility of the I/O port structure allows the multiplexing of up to 13/8 Analog Inputs into the converter in a 28/20 pin device for the ST6210/15 ST6210/15 2k ROM and ST6220/25 ST6220/25 4k ROM families, enabling full freedom in circuit layout. Many other members of the ST6 family also offer the Analog to Digital converter. One of the more novel and practical applications of this converter, is to decode a number of keys. The technique is to connect the keys by resistive voltage dividers to the converter inputs. An example of key detection using 10 keys is illustrated in this note. Using the Analog to Digital converter in this fashion does not require a static current and avoids false key detection. 19/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION AN594 AN594:DIRECT SOFTWARE LCD DRIVE WITH ST621X ST621X AND ST626X ST626X This note describes a technique for driving a Liquid Crystal Display (LCD) with a standard ST62 microcontroller, without any dedicated LCD driver. This technique offers a display capability for applications which require a small display at low cost together with the versatile capabilities of the standard ST62xx MCU. Higher display requirements are easily handled by dedicated members of the ST62xx MCU family, for example the ST6240 ST6240. The first part of this note describes the typical waveforms required to drive an LCD correctly with a multiplexing rate of 1 or 2 (duplex). The following parts present two solutions based on standard ST62 MCUs driving directly the LCD. The first is based on an ST6215 ST6215 without using software interrupts and the second on an ST6265 ST6265 where the LCD is controlled by timer interrupts. In both examples the program size, the CPU time occupation due to the LCD drive and the number of surrounding components are minimized. Consequently many additional tasks can be added to the MCU program. AN672 AN672:OPTIMIZING THE ST6 A/D CONVERTER ACCURACY When using the internal Analog to Digital Converter of the ST62 family and maximum A/D converter accuracy is required, it is desirable to filter out any noise present on the analog input. This includes also noise present on the ground and Vcc supply lines of the MCU as Vcc is also the voltage reference of the A/D converter. While good supply decoupling with capacitors is always recommended, and placing the ST6 into its WAIT state reduces potential noise induced by the digital switching within the MCU, digital filtering by averaging several successive A/D conversions can improve the accuracy of the conversion. This is the most effective way to get the most accuracy out of the ST6 family A/D converter. The code fragment included with this note demonstrates this digital filtering which gives the best results with a trade-off against the total time for conversion. AN673 AN673:REDUCING CURRENT CONSUMPTION AT 32KHZ 32KHZ WITH ST62 In many cases a 32kHz crystal is chosen for the oscillator of the ST62 microcontroller in order to achieve the minimum current consumption in the application. This note provides a technique for minimising the current consumption when using a crystal oscillator at this frequency. This short note should be read in conjunction with Application Note AN670 AN670, "Oscillator Selection for the ST62". 20/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION 1.4.2 DESIGN IMPROVEMENTS This section suggests ideas on how to expand the usage of ST62 peripherals and how to increase the design safety. AN420 AN420 describes a way to expand the A/D converter resolution of the ST62 up to 10 or 12 bits with few external components. AN435 AN435 proposes practical examples on how to maximize the ST62 noise immunity. It describes software and hardware solutions applicable in low cost, noisy applications such as power management or automotive. The other notes show with examples how to avoid corruption of I/O pins or misprogramming (AN432 AN432), how to ensure a safe reset when the power supply changes (AN669 AN669), how to match a crystal or a ceramic resonator to an ST62 oscillator (AN670 AN670) and how to prevent EEPROM corruption in case of supply variation (AN671 AN671). AN420 AN420:EXPANDING A/D RESOLUTION OF THE ST6 A/D CONVERTER Many members of the ST6 Microcontroller Family support an integrated Analog to Digital Converter. This converter allows the analog values produced by external sensors to be converted into digital form to take part in further digital control algorithms. The standard resolution of the ST6 A/D Converter is 8-bit. Occasionally the analog signals provided require a higher resolution to extract the full dynamic range of the input. The solution described in this Application Note provides this higher voltage resolution using only an additional Operational Amplifier and a few resistors. The tradeoff in the approach shown is the total conversion time to reach the required resolution. The technique implemented is that of the Algebraic Adder. A full discussion of the principle of operation is given, with full ST6 source code. AN432 AN432:USING ST62XX ST62XX I/O PORTS SAFELY All members of the ST62 Series of Microcontrollers feature I/O ports with configurable bit functions. In addition many I/O bits may be set as inputs to the on-chip Analog to Digital Converter. This port bit function is in addition to the normal I/O functions of input (with or without internal pull-up resistor), output (open drain or push-pull) or edge/level selectable interrupt input (with pull-up). This flexibility makes the ST62 series suitable for many industrial control applications (and for many other uses). This Application Note explains the architecture of the I/O bit associated with these port functions and provides some indications on the correct use of these features for functions such as keyboard scanning and analog inputs. The correct manner to switch between these function is also demonstrated in order to prevent potential malfunctions in operation. 21/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION AN434 AN434:MOVEMENT DETECTOR CONCEPTS FOR NOISY ENVIRONMENTS The sales of movement detectors, which react to human-body temperature, are increasing at a fantastic rate. No Do-it-Yourself shop proposes less than 4 models for sale if it is serious about its image, however the majority of clients are novices who wish to install the system themselves. This installation often causes frustration, partly caused by a lack of knowledge of the operation of the system, but also by the weakness of the products. This weakness can be improved by the use of microcontrollers. Most movement detectors available, whether using discrete components or integrated circuits, have a similar circuit concept. This Application Note shows concepts on how a microcontroller with analog inputs (the ST6210 ST6210) can replace discrete components and add additional functionality. Cost is not an essential factor, but carries a high prejudice against this concept. As shown, the decision to use a Microcontroller with analog inputs carries a series of advantages, together with its logical functionality. AN435 AN435:DESIGNING WITH MICROCONTROLLERS IN NOISY ENVIRONMENTS Microcontrollers (MCU) make possible the design of integrated and flexible controls for a constantly decreasing cost. As a result, they are spreading rapidly among most electronic applications and especially noise sensitive equipments such as for power control or automotive use. An MCU operates with sequential logic, so the control of an application can be lost during a disturbance, as with analog control, but also after a power glitch in the system. In addition, a modern MCU includes several tens of thousands of transistors switching in the MHz range, potentially radiating interference of high magnitude in a large frequency spectrum. Consequently, noise sensitivity and generation have to be considered as early as possible in MCU based designs. This Application note presents numerous methods to effectively reduce noise problems. The first part presents a short overview on noise and proposes hardware solutions to increase the equipment immunity to noise. The second part concerns the writing of software more immune to disturbances. The behaviour versus disturbances of MCUs designed for noisy environments, the ST62 family, is presented. Practical examples and results are shown. 22/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION AN669 AN669:SIMPLE RESET CIRCUITS FOR THE ST62 The circuit schematics shown in this Application Note provide examples of reset circuits for the ST62xx microcontrollers. These circuits range from a very simple solution, which is only efficient at power up, to a circuit providing power up and power down monitoring with a delay at power on. When used with the watchdog and a software implementation, an efficient and reliable reset of the ST62 can be made. AN670 AN670:OSCILLATOR SELECTION FOR ST62 The purpose of this note is to give indications on how to choose a resonator or a quartz crystal in order to achieve reliable oscillation with the ST62 Microcontroller. This document provides first the major resonator parameters useful for a design. It then proposes measurement methods to ensure a safe oscillation. AN671 AN671:PREVENTION OF DATA CORRUPTION IN ST6 ON-CHIP EEPROM The ST6 Microcontroller has been designed to avoid any potential corruption of data programmed into its on-chip EEPROM (when available). Data integrity can be ensured as long as the application designer follows the guidelines provided in this note. In general, EEPROM data corruption occurs whenever the reset signal is not controlled when the power supply goes up or down. This is particularly true with a slow ramp-up and/or slow fall time of the power supply, since the device may be in a supply voltage area when the device functionality is not guaranteed for a long time. If no special care is taken during the power up sequence regarding the reset signal then the microcontroller may start writing into the EEPROM. The same behaviour can be present upon a power down. This note proposes two complementary solutions to prevent these unwanted actions, a software solution and a hardware solution. 23/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION AN911 AN911:ST6 MICRO IS EMC CHAMPION Since January 1996, Electro-Magnetic Compliance is required by international law for any electrical equipment that is manufactured including a printed circuit board. As early as 1991, SGS-THOMSON took this change in the law into account when planning the design and manufacture of the ST62 microcontroller family. An EMC environment was installed in the Design, Quality and Engineering center and ST quality standards were enlarged to include EMC performance criteria, with the result that the ST62 microcontrollers meet the EMC standards five years ahead of most 8-bit microcontrollers. This short article describes the characteristics of the ST6 microcontroller in the EMC context and how this benefits the customer. AN975 AN975:UPGRADING FROM ST625X/6XB ST625X/6XB TO ST625X/6XC ST625X/6XC As part of a process of continuous improvement, STMicroelectronics has replaced all ST62T5XB ST62T5XB and ST62T6XB ST62T6XB devices by ST62T5XC ST62T5XC and ST62T6XC ST62T6XC. This opportunity was taken to include new features such as the Low Voltage Detector (LVD) for safe reset, the Oscillator Safeguard (OSG) and a new RC oscillator. This application note details these new features and draws attention to some precautions that it is mandatory to take when upgrading an application developed with B revision to C revision devices. The first part of the document is related to the silicon itself and the second one to the development tools. 24/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION 1.4.3 PERIPHERAL OPERATIONS This chapter explains with practical examples how to use the ST62 Autoreload timer for PWM generation, input capture and PLL generation. AN590 AN590:PWM GENERATION WITH ST62 AUTO-RELOAD TIMER This note presents how to use the ST62 8-bit Auto-reload Timer (ARTimer) for the generation of a Pulse Width Modulated (PWM) signal tunable in frequency and duty cycle. Two examples of this are shown, the first with a specific frequency and duty cycle, and the second with the generation of a 30kHz PWM signal with the duty cycle proportional to an analog voltage converted through the on-chip Analog to Digital Converter. An introduction to the generation of PWM using the timer, and the software for the examples are provided. AN591 AN591:INPUT CAPTURE WITH ST62 AUTO-RELOAD TIMER This note presents how to use the 8-bit Auto-reload Timer (ARTimer) of the ST62 to measure time duration or frequency of an input signal. The Capture Mode with reset is used to measure the time elapsed between two edges of an input signal: two rising edges, two falling edges, or one rising edge and one falling edge if the configuration of the ARTimer is modified after the first edge is detected. The minimum duration of one signal to measure depends on the microcontroller clock and on the required precision. With an 8MHz quartz crystal, a signal of 8µs duration can be measured with a resolution of 1/64. A software example is provided. AN592 AN592:PLL GENERATION USING THE ST62 AUTO-RELOAD TIMER This note describes how to generate a digital signal locked in phase and frequency (PLL) with a calibrated delay starting from an active edge on the 8-bit Auto-reload timer (AR Timer) input pin. An example is given for a digital input signal of 15kHz presented to the ARTimer input pin. A phase-locked signal at 15kHz with a falling edge delayed 19µs from the input rising edge, and a duty cycle of 75%, is generated. An explanation of the function and software for the function are provided. 25/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION AN593 AN593:ST62 IN-CIRCUIT PROGRAMMING This note provides information on the steps required in order to perform in-circuit programming of ST62Exx EPROM or OTP devices for both on-chip EPROM and EEPROM (where available). In-circuit programming is possible if the relevant pins of the programming socket located on the ST62 EPROM Programming tool (either an ST6 Starter Kit, Remote Programming board, or Gang Programmer) are connected to a 16-pin connector (8x2 header), which must be provided on the application by the user. Note: In-circuit programming embedded in program test is not possible. If the EPROM programmer cable is connected to the application, the RESET signal for example is tied to Ground before and after programming. Connections are shown for the ST62E1x/2x, ST62E4x and ST62E6x/E9x and the corresponding OTP devices. AN678 AN678:LCD DRIVING WITH ST6240 ST6240 This application note describes the basic guidelines to achieve a fast and efficient LCD drive application development. The allphanumeric LCD panel of the ST624x Starter-Kit is used as example and more general concerns are highlighted. Hardware and software issues are described to demonstrate the benefits brought about while using a ST62 LCD driver. AN913 AN913:PWM GENERATION WITH ST62 16-BIT 16-BIT AUTO-RELOAD TIMER The 16-bit Autoreload timer (ARTimer) is a 16-bit downcounter timer with prescaler. It includes auto-reload PWM, capture and compare capability with two input and two output pins. This note presents how to use the ST62 16-bit Auto-Reload Timer (ARTimer) for generating a DTMF signal (Dual-Tone Multiple Frequency) with the PWM. In the example shown, the PWM output pin generates a DTMF to dial a telephone number. AN914 AN914:USING ST626X ST626X SPI AS UART This note shows how to use the ST626x SPI to perform UART serial communication. The operating principles and limitations are described. An example is developed for reception and transmission at 9600 baud, however, baud rates up to 19200 can be obtained. The assembly source code of the example is provided. 26/89 1 ST6 FAMILY - SYSTEM OPTIMIZATION AN1016 AN1016:ST6 USING THE ST623XB/ST628XB ST623XB/ST628XB UART This brief note describes the problem/solution for managing potential spurious UART interrupts during reset. A short descriptive paragraph outlines the problem. This is followed by a table of values for inserting in the application program covering a range of baud rates. A short assembly code example is provided. AN1050 AN1050:ST6 INPUT CAPTURE WITH ST62 16-BIT 16-BIT AUTO-RELOAD TIMER This note presents how to use the ST62 16-bit Auto-Reload Timer (ARTimer) to measure durations or frequencies of an input signal. An example shows how to capture an input signal to make an output signal with the same frequency as input signal but with a duty cycle equal to 50%. The ARTimer has a 16-bit downcounter timer with prescaler. It includes auto-reload PWM, capture and compare capability with two input and two output pins. AN1127 AN1127:USING THE ST62T6XC/5XC ST62T6XC/5XC SPI IN MASTER MODE To avoid problems when switching from Rev B to Rev C devices, special attention must be paid to the programming of the I/O port Data Direction Register when using the SPI in master mode. In Rev B devices, the SPI functions in master mode without depending on whether the DDR bit for the I/O port pin (PC4) used for the SCK is set or reset (programmed as input or output). In Rev C devices, the DDR bit has to be programmed as INPUT (left at the reset value). AN1447 AN1447:SOFTWARE DRIVER FOR 4-MULTIPLEXED LCD WITH A STANDARD ST62 This note describes a technique for driving a 4-multiplexed Liquid Crystal Display (LCD) with a standard ST62 microcontroller (MCU), without any dedicated LCD driver peripheral. This technique offers a display capability for applications which require a small display at a low cost together with the versatile capabilities of the standard ST62xx MCU. 27/89 1 ST7 FAMILY - APPLICATION EXAMPLES 2 ST7 FAMILY 2.1 APPLICATION EXAMPLES AN1658 AN1658:SERIAL NUMBERING IMPLEMENTATION It is common practice to give each appliance a unique serial number or identification number. This serial number can be located in external memory, for example in EEPROM, but it can also be programmed, along with the MCU software inside the MCU program memory array. In some cases, this serial number must remain secret and unreadable by external devices. In other cases, it must be readable from the MCU by a remote PC through DDC lines or by any other way of the manufacturer's choice. This application note provides all the technical details on both the software and tools sides of how to implement such a serial numbering technique. Some hints have been taken from the on-line help of the STVP7 Visual Programming software tool. C language examples are provided, ready to be added to the source code if compiled with a Metrowerks C Compiler (any version: old Hiware, Panta or Codewarrior), but could be ported to other C compilers as well. The examples are fitted for the ST7FLCD1 MCU, but can be applied to any other MCU with minorchanges. AN1755 AN1755:A HIGH RESOLUTION / PRECISION THERMOMETER USING ST7 AND NE555 NE555 The goal of this application note is to present a realistic example of a thermometer using an ST7 and an NE555 NE555. The NE555 NE555 is operating in the a-stable mode. Its frequency is controlled by the resistance changes of a NTC-thermistor. The frequency, as well as the duty cycle, are measured by the ST7 timer. The NE555 NE555 output is connected to the timer input capture pin. AN1756 AN1756:CHOOSING A DALI IMPLEMENTATION STRATEGYWITH ST7DALI This application note describes how to choose a DALI (Digital Adressable Lighting Interface) implementation strategy using the ST7DALI microcontroller. As well as presenting topology options, this document also gives an introduction to the DALI standard with a description of the protocol and a list of advantages. 28/89 ST7 FAMILY - APPLICATION EXAMPLES AN1812 AN1812: A HIGH PRECISION, LOW COST, SINGLE SUPPLY ADC FOR POSITIVE AND NEGATIVE INPUT VOLTAGES In general the ADC embedded in the ST7 microcontroller is enough for most applications. But, in some cases it is necessary to measure both positive and negative voltages. This requires an external ADC with this particular capability. Most external ADCs require a dual supply to be able to do this. However, microcontroller-based applications usually only have a positive supply available. This application note describes a technique for implementing an ADC for measuring both positive and negative input voltages while operating from a single (positive) supply. This converter is based on a Voltage-to-time Conversion technique. Like other slope converters, this ADC also uses an Integrating Capacitor, but the measured time is inversely proportional to the input voltage. An additional comparator with a voltage reference is used to improve conversion accuracy. 29/89 ST7 FAMILY - EXAMPLE DRIVERS 2.2 EXAMPLE DRIVERS AN969 AN969:SCI COMMUNICATION BETWEEN ST7 AND PC This document presents a standard communications interface between a ST7 microcontroller and a PC. This communication is done through the ST7 SCI peripheral and a serial port of the PC using the RS232 RS232 protocol. AN970 AN970:SPI COMMUNICATION BETWEEN ST7 AND EEPROM The goal of this application note is to present a practical example of communication using the SPI peripheral of the ST7. It shows an easy way of communicating between a ST7 microcontroller and a M95xxx SPI EEPROM. The purpose is to perform, through SPI, a write in the memory, followed by a read of the written data. AN971 AN971:I²C COMMUNICATION BETWEEN ST7 AND M24CXX M24CXX EEPROM The goal of this application note is to present an practical example of communication using the I²C peripheral of the ST7. It shows a basic single master communication between a ST7 microcontroller and an M24Cxx I²C bus EEPROM. The purpose is to implement, from the ST7 through the I²C interface, a write and a read to the external EEPROM without error management. AN972 AN972:ST7 SOFTWARE SPI MASTER COMMUNICATION This application note presents a basic software driver for emulating SPI full duplex communication in master mode using the ST7 standard I/O ports. The principles of the SPI (Serial Peripheral Interface) are briefly introduced and an algorithm for 8-bit full duplex communication is described. A source assembly listing is provided at the end of the document. AN973 AN973:SCI SOFTWARE COMMUNICATION WITH A PC USING ST72251 ST72251 16-BIT 16-BIT TIMER The Serial Communication Interface (SCI) offers a flexible means of full-duplex data exchange with external equipment requiring an industry standard NRZ asynchronous serial data format. This document shows how to emulate SCI communication by software, using the ST7 timer. The application presented is for RS232 RS232 communication between an ST7 microcontroller and a PC. Initialization, interrupts and receive and transmit routines are described with the aid of diagrams and flowcharts. A source assembly listing is provided at the end of the document. 30/89 ST7 FAMILY - EXAMPLE DRIVERS AN974 AN974:REAL TIME CLOCK WITH THE ST7 TIMER OUTPUT COMPARE This note explains how to use the ST7 Timer output compare function. The application example presents a real time clock with second, minute and hour counters based on a fixed time base. Flowcharts describe hardware configuration, initialization and register updating procedures. A source assembly code listing is given at the end of the document. AN976 AN976:DRIVING A BUZZER USING THE ST7 PWM FUNCTION This "musical" application describes how to use the ST7 PWM to generate synthesized music using a buzzer. The document covers musical score, note duration and tone generation and volume control. A source assembly listing is provided at the end of the document. AN979 AN979:DRIVING AN ANALOG KEYBOARD WITH THE ST7 ADC This application note presents a standard example of the use of the Analog to Digital Converter (ADC) of the ST7. The ST7 on-chip ADC is used to emulate a 16-key analog keyboard. The hardware interfacing techniques are outlined in the first part of the document and the software is described by means of flowcharts. An assembler source listing is given at the end of the document. AN980 AN980:ST7 KEYPAD DECODING TECHNIQUES, IMPLEMENTING WAKE-UP ON KEYSTROKE The goal of this application note is to present an example of the use of ST7 HALT mode. In this application, the MCU (here a ST72251 ST72251) is woken up by an external interrupt caused by pressing a key on the 4x4 matrixed keypad. AN1017 AN1017:USING THE ST7 USB MICROCONTROLLER The ST7 USB interface is a Universal Serial Bus peripheral that provides a means of connecting a PC peripheral serving as a function to a PC host. It supports low speed data transfers. This application note describes an example firmware for interaction with the USB interface hardware and support interactions between a USB device and a host system. The associated source code of the firmware is available. AN1041 AN1041:USING ST7 PWM SIGNAL TO GENERATE ANALOG OUTPUT (SINUSOID) This note shows how to use the ST7 PWM/BRM to generate a 50Hz sinusoïd that can be tuned both in average and amplitude. This application has been done using an ST72511R4 ST72511R4. 31/89 ST7 FAMILY - EXAMPLE DRIVERS AN1042 AN1042:ST7 ROUTINE FOR I²C SLAVE MODE MANAGEMENT This application note presents a useful example of communication using the I²C peripheral of the ST7. The ST7 microcontroller is used as a slave and can communicate with any master. This slave, through the I²C interface, receives words from the master implementing error management and returns them. This application has been implemented with a ST72E251 ST72E251 and using 7-bit addressing mode. AN1044 AN1044:MULTIPLE INTERRUPT SOURCES MANAGEMENT FOR ST7 MCUS The goal of this application note is to present a technique for managing several external I/O interrupts with a member of the ST7 series of MCUs (here a ST72251 ST72251). AN1045 AN1045:ST7 SOFTWARE IMPLEMENTATION OF I²C BUS MASTER This application note implements an I2C communications software interface that can be used in any general-purpose ST7 device without specific I2C on-chip peripheral hardware. The program is written in C language. It implements the I2C master transmitter and master receiver functions. The ST7 acts as the bus master and communicates via the I2C bus to a slave EEPROM device. AN1046 AN1046:ST7 UART EMULATION SOFTWARE All members of the STMicroelectronics ST7 Series of Microcontrollers feature a 16 bit timer with several possibilities such as output compares and input captures. This note describes a technique for emulating an RS232 RS232 UART with the ST7 timer without any additional hardware. Only two pins are required for the serial communication. The first part of this note will explain the protocol used for serial communication and how to adapt it for the ST7 timer. The other sections of this note describe more precisely how the program deals with transmitter mode and receiver mode. Timings are used to illustrate the important points. The user can easily adapt the example to his own application as only a small amount of code is required by the UART program. The software was tested by connecting a ST72251 ST72251 to the serial port of a PC and communicating in all possible modes. AN1047 AN1047:MANAGING RECEPTION ERRORS WITH THE ST7 SCI PERIPHERAL This application note provides guidelines for managing communication errors with the ST7 Serial Communications Peripheral (SCI) in reception mode. It describes how the ST7 SCI peripheral works when errors occur. A explanation is given of how to interpret the various error flags and to determine if the received byte is corrupted or not. An example interrupt service routine written in assembly language is provided at the end of the document. 32/89 ST7 FAMILY - EXAMPLE DRIVERS AN1048 AN1048:ST7 SOFTWARE LCD DRIVER This note describes a technique for driving Liquid Crystal Displays (LCD) with any standard ST7 Microcontroller (MCU) i.e without any specific on-chip LCD driver hardware. This technique offers a solution for applications which require a display at low cost together with the versatile capabilities of the standard ST72 MCU. This note also provides a technique to control the LCD contrast through software. AN1078 AN1078:ST7 TIMER PWM DUTY CYCLE SWITCH FOR TRUE 0% OR 100% DUTY CYCLE This application note presents a program that uses the 16-bit timer of the ST7 in PWM output mode. The program can be used to perform a hot switch from one duty cycle to another and obtain a true fixed period and true duty cycle percentage values between 0% and 100%. The example program has been developed for the ST7GP family (ST72251G1 ST72251G1 and G2). AN1082 AN1082:DESCRIPTION OF THE ST72141 ST72141 MOTOR CONTROL PERIPHERAL REGISTERS The ST72141 ST72141 is designed for controlling Brushless Permanent Magnet DC motors with or without sensors. The motor control is performed by the hardware of the on-chip Motor Control peripheral (MTC). The MTC is functionally divided into four parts. Zero-crossing and End of Demagnetisation detector Delay manager PWM manager Channel manager AN1083 AN1083:ST72141 ST72141 BLDC MOTOR CONTROL SOFTWARE AND FLOWCHART EXAMPLE The software examples described in this application note are those generated by the ST7MTC1 Kanda kit. 80% of the code is generic, the remaining 20% is specific to the implementation of the ST72141 ST72141 in the ST7MTC1 kit (user interface and communication). The purpose of this application note is to give the flowcharts of the software examples showing how to drive the motor in both current and voltage modes and give examples of open loop or closed loop speed regulation. The software examples given in the file attached with this Application note illustrate Current mode and closed loop driving mode for a 4-pole BLDC motor. 33/89 ST7 FAMILY - EXAMPLE DRIVERS AN1105 AN1105: ST7 PCAN PERIPHERAL DRIVER The Controller Area Network (CAN) norm defines a fast and robust serial bus protocol, suited for local networking of intelligent devices such as microcontrollers, sensors and actuators. It is now widely used, mostly in the automotive domain, but also for home automation and industrial equipment control. Several members of the ST7 MCU family have a built-in CAN peripheral named pCAN, which allows them to be used as nodes in a CAN network. A software driver provided is by ST to help you start designing and writing applications using the ST7 pCAN cell. The purpose of the following application note is to explain to you how to use the driver, and how it works. Thus, you can either build your software from the provided files, or modify them to meet specific needs. AN1129 AN1129:PWM MANAGEMENT FOR BLDC MOTOR DRIVES USING THE ST72141 ST72141 Brushless DC motors are efficient, quiet and can provide a very high starting torque, this is partly due to the built-in permanent magnet. For these reasons they are used more and more in a large range of applications like hard disk drives, fans, pumps, compressors, etc. However brushless DC motors run properly only as synchronous motors: they need electronic circuitry to run, including rotor position sensors, switching devices and a control unit. In most cases the switching devices are MOSFET transistors or IGBTs and are organized in a three-phase bridge with free-wheeling diodes. Traditionally Hall sensors are used by the control unit to detect rotor position before changing motor coil to which the power applied. STMicroelectronics has introduced the ST72141 ST72141 microcontroller which is based on an industry standard architecture and is especially designed for driving BLDC motors. One of the major advantages of the ST72141 ST72141 is that, without using sensors, it is capable of controlling motors precisely by reading the Back Electromotive Force (BEMF). Instead of using expensive Hall sensors, three resistors connecting the three windings directly to the ST72141 ST72141 input ports, provide the microcontroller with the rotor position information. The microcontroller replaces the standard control unit and the rotor position sensors. However, the ST72141 ST72141 can be used with sensors as well. Although using sensorless mode has big advantages in terms of cost and size, it makes the motor drive a little bit more complicated. The purpose of this application note is to explain in which cases the ST72141 ST72141 motor control unit can directly read the BEMF voltage and how to quickly set up its control registers in order to use all the advanced features of this product. 34/89 ST7 FAMILY - EXAMPLE DRIVERS AN1130 AN1130:AN INTRODUCTION TO SENSORLESS BRUSHLESS DC MOTOR DRIVE APPLICATIONS WITH THE ST72141 ST72141 Electric motors are an essential component of our industrialised society with no less than 5 billion motors built world wide every year. Brushless DC motors are already used in hard disk drives and many industrial applications, and their market share is growing significantly in automotive, appliance and industrial applications. The ST72141 ST72141 has been developed by STMicroelectronics to control synchronous motors or, more specifically, 3-phase brushless DC motors. The most common applications of this type of motor are industrial control, automotive equipment, refrigerators, air conditioners, compressors and fans, where brushless DC motors are already used due to their high efficiency, silent operation, compact form, reliability and longevity. The ST72141 ST72141 devices are members of the ST7 microcontroller family designed specifically for motor control applications and including A/D converter and SPI interface capabilities. They include an on-chip peripheral for control of electric brushless DC motor either in sensor or sensorless mode. AN1148 AN1148:USING THE ST7263 ST7263 FOR DESIGNING A USB MOUSE This application note describes the implementation of a cost-effective USB Mouse using the ST7263 ST7263 microcontroller. A detailed description of low-consumption power management mode (resume mode) is given in section 5. ST provides a complete architecture as well as firmware drivers to help you develop your application. A list of reference documents is provided at the end of the application note. It is assumed that the reader is familiar with the ST7263 ST7263 microcontroller and USB. AN1149 AN1149:HANDLING SUSPEND MODE ON A USB MOUSE All USB devices must support Suspend mode. Suspend mode enables the devices to enter low-power mode if no bus activity is detected for more than 3.0 ms. Like USB keyboards and pointing devices, USB mice must be able to exit Suspend mode if a button has been pressed or if a movement has been detected. This feature is called Remote wake-up mode. A Remote wake-up involves a Resume sequence on the USB lines and recovery of communication between the mouse and the host. The following application note describes the implementation of Suspend and Remote wake-up modes on a USB mouse using the ST7263 ST7263 microcontroller. The first chapter focuses on the recommendations before entering Suspend mode. Then a description of the RC external circuit for handling Remote wake-up mode is detailed. It contains power management recommendations and RC value proposals. The third chapter describes Resume mode. Then chapter 4 and chapter 5 describe software implementation and program flow. It is assumed that the reader is familiar with the ST7263 ST7263 microcontroller and USB. 35/89 ST7 FAMILY - EXAMPLE DRIVERS AN1180 AN1180:USING THE ST7263 ST7263 KIT TO IMPLEMENT A USB GAME PAD The game pad described in this application note is a low speed, self powered device. It has digital and analog capabilities for the X and Y axes, and includes 10 buttons and two motors for vibration. In order to demonstrate the use of the ST7263 ST7263 microcontroller, we adapted this game pad to the ST7263 ST7263 demo kit to make a USB game pad, with USB mouse and hotkey functions. This application uses the key features of the ST7263 ST7263 USB microcontroller, the analog converter, the 3 USB Endpoints (control Endpoint, interrupt IN, interrupt OUT) and PWM capabilities with the two output compare waveforms on Port A. The source code of the software described on this application note is available from ST. As with other USB devices, Endpoint 0 is the control Endpoint used for device enumeration. Endpoint 1 is an interrupt IN Endpoint, this allows the device to send data to the PC. This Endpoint is shared using the reportID capabilities specific to the HID class. In this case, the first byte sent to the PC is the reportID number. In this demo application we use three reportIDs: reportID number 1 is used for the game pad data reportID number 2 is used for the mouse data reportID number 3 for the hotkey function Endpoint 2 is an interrupt OUT Endpoint to send data from the PC to the device. This Endpoint is used to control the motors for the vibration feature. AN1276 AN1276:BLDC MOTOR START ROUTINE FOR THE ST72141 ST72141 MICROCONTROLLER The ST72141 ST72141 microcontroller has been designed by STMicroelectronics to control BLDC motors in sensor and sensorless modes with a patented method for detecting the back-electromotive force zero-crossing event (see Application Note AN1130 AN1130). The purpose of this document is to describe the motor start-up routine for the ST72141 ST72141 microcontroller. 36/89 ST7 FAMILY - EXAMPLE DRIVERS AN1321 AN1321:USING THE ST72141 ST72141 MOTOR CONTROL MCU IN SENSOR MODE The ST72141K ST72141K microcontroller is especially designed for Brushless DC Motor Control applications due to its following features: Motor Control Unit (MTC), that can be seen as a Pulse Width Modulator multiplex on six output channels, Back Electromotive Force (B-EMF) Zero-Crossing-Detector for sensorless control of permanent magnet direct current brushless motors. The MTC is designed for sensorless control but can also easily support the use of sensors (generally, Hall-effect sensors) which may be useful for very low-speed or positioning applications. The purpose of this Application Note is to describe how to initialize the motor control unit in order to run a given motor equipped with Hall-effect sensors. This application note is divided into different segments with code examples given in Assembly language. AN1325 AN1325:USING THE ST7 USB LOW-SPEED FIRMWARE V4.X This application note describes how to use the ST7 USB Low-Speed firmware V4.x. This firmware, written in C, using the Cosmic compiler, provides a complete USB protocol layer for low-speed USB microcontrollers (such as the ST7261 ST7261, ST7262 ST7262 and ST7263 ST7263). The source code is available free to STMicroelectronics customers. AN1445 AN1445:USING THE ST7 SPI TO EMULATE A 16-BIT 16-BIT SLAVE This application note describes how to emulate a 16-bit slave SPI using an ST7 microcontroller with an on-chip 8-bit SPI. 37/89 ST7 FAMILY - EXAMPLE DRIVERS AN1475 AN1475:DEVELOPING AN ST7265X ST7265X MASS STORAGE APPLICATION This application note describes how to develop a USB Mass Storage application using an ST7265x microcontroller. The proposed solution includes a generic USB Mass Storage Layer (MSL) compliant with the USB Mass Storage Class that can be used for all types of storage media (FLASH memory cards, hard disk drive, etc.) and a dedicated Media Access Layer (MAL) add-in for each type of storage media. The MSL and the MAL modules are available to ST customers on request. Contact your ST sales office to obtain the ST7265 ST7265 Mass Storage software. The MSL and the MAL must be considered as function libraries and therefore cannot be modified by the user. The software interfaces of these function libraries provide the user with the required flexibility for designing his application: type and number of media, insertion/withdrawal management, protection management, user interface. Note that the MAL requires the use of certain fixed MCU pins to interface with the various mediums. As a result, a specific application hardware configuration is required when using the MAL. AN1504 AN1504:STARTING A PWM SIGNAL DIRECTLY AT HIGH LEVEL USING THE ST7 16-BIT 16-BIT TIMER The 16-bit timer is a standard peripheral of the ST7 microcontroller family. This peripheral can be used for a variety of purposes, including pulse length measurement of up to two input signals (input capture feature) or generation of up to two output waveforms (output compare and PWM mode). This application note is about using the PWM mode of the standard 16 bit timer. It explains how to synchronize the PWM signal output. In other words, how to make sure it outputs a high state when the counter restarts after it has been stopped (for any reason) or simply when it starts at the beginning of the application. In some applications, like motor control, it may be essential to output the high level part of the signal duty cycle when the counter is started. AN1602 AN1602:16-BIT 16-BIT TIMING OPERATIONS USING ST7262 ST7262 OR ST7263B ST7263B MCUS This Application Note describes how to use the ST7262 ST7262 or ST7263B ST7263B for 16-bit timing operations. The intention of this document is to show how to perform pulse measurement and PWM generation using the different timers available on each microcontroller type. 38/89 ST7 FAMILY - EXAMPLE DRIVERS AN1633 AN1633:DEVICE FIRMWARE UPGRADE (DFU) IMPLEMENTATION IN NON-USB APPLICATIONS This application note describes how to implement the Device Firmware Upgrade (DFU) capability using a ST7 USB microcontroller like the ST72F62 ST72F62 or ST72F63B ST72F63B in a general purpose or `non-USB' application. The term 'non-USB' is used here to contrast with `USB application' which has a different DFU implementation (refer to AN1577 AN1577). In the implementation described here, the USB interface is not used in the application. The application board is self powered and the on-chip USB interface is only used occasionally, as a maintenance utility port to upgrade the MCU firmware. AN1712 AN1712:GENERATING A HIGH RESOLUTION SINEWAVE USING ST7 PWMART The purpose of this application note is to present a software technique for generating a high resolution sinewave using ST7 PWMART, tunable in frequency and average amplitude. This application has been implemented using the ST72321J9 ST72321J9 microcontroller. The PWMART (Autoreload timer peripheral embedded in the microcontroller) is used to generate a PWM signal and this PWM signal is then filtered by low pass filter (simple RC circuit) to generate a sinewave. AN1713 AN1713:SMBUS SLAVE DRIVER FOR ST7 I2C PERIPHERAL The goal of this application note is to implement the SMBus slave protocol using ST7 I2C. The software of this application performs all SMBus bus protocols mentioned in SMBus v1.1. The device chosen here is ST72F264 ST72F264 which has multi-master I2C capability. The program described in this application note is in C language. The driver is compatible with Metrowerks and Cosmic compilers. AN1753 AN1753:SOFTWARE UART USING ST7 12-BIT 12-BIT AUTORELOAD TIMER This application note describes a software implementation of a Universal Asynchronous Receiver/Transmitter (UART). This can be used on devices, like the ST7LITE0, with no on-chip SCI peripheral. AN1947 AN1947:ST7MC PMAC SINE WAVE MOTOR CONTROL SOFTWARE LIBRARY This application note describes a 3-phase synchronous permanent magnet motor control software library developed for the ST7MC drive with sinusoidal waveform. The ST7MC microcontroller contains a peripheral dedicated to 3-phase brushless motor control, making it suitable for AC induction motors and permanent magnet DC/AC motors (PMDC/PMAC, also called BLDC). 39/89 ST7 FAMILY - PRODUCT EVALUATION 2.3 PRODUCT EVALUATION AN910 AN910:ST7 AND ST9 PERFORMANCE BENCHMARKING STMicroelectronics has developed a set of test routines related to 8-bit and low-end 16-bit microcontroller applications to evaluate computing performance and interrupt processing performance of microcontroller cores. These routines have been implemented on ST7 and ST9 Microcontroller Units (MCUs) as well as several MCUs available on the market. The routines have been written in assembler language to optimize their implementation and focus on core performance, without being dependent upon compiler code transformation. For each test, the two parameters of interest are execution time and code size. Timings have been either measured whenever possible, or theoretically calculated when there was no other alternative. In most cases, programs have really run and execution times have actually been measured, so that assembly sources should not contain implementation errors and results can be considered as correct and reliable. The results of this study point out the capability of the ST9+ to compete with 16-bit MCUs on 8-bit and low-end 16-bit applications and confirms its position of high-end 8/16-bit MCU. It also confirms the ST7 as an outstanding 8-bit MCU. AN990 AN990:ST7 BENEFITS VERSUS INDUSTRY STANDARD This note presents, from the application developer's point of view, the main advantages of the ST7 core over the corresponding industry standard architecture in terms of application cost, speed and flexibility. The ST7 enhancements discussed include the Y Index register, Indirect memory access mode, Stack pointer access, PUSH/POP instructions, SWAP instruction and interrupt vectors. AN1077 AN1077:OVERVIEW OF ENHANCED CAN CONTROLLERS FOR ST7 AND ST9 MCUS Automotive body network requirements have changed significantly in the last few years due to the introduction of OSEK and the increasing number of ECUs. 8-bit microcontrollers are and will stay widely used in a majority of automotive body applications. While a wide variety of powerful CAN controllers are available on the market for 16- and 32-bit microcontrollers, 8-bit microcontrollers still need too much CPU time for CAN communication management. This application note presents a new generation of CAN controllers optimized for 8-bit microcontrollers and designed to meet the needs of body applications. 40/89 ST7 FAMILY - PRODUCT EVALUATION AN1086 AN1086:ST7 / ST10 U435 CAN-DO SOLUTIONS FOR CAR MULTIPLEXING Replacing a classical harness with a multiplexing (mux) network makes cars more competitive as it increases their flexibility and simplifies the wiring. CAN is the leading protocol for car mux systems thanks to its large speed spectrum and noise immunity. But each application has specific constraints in terms of protocol, cost and performance. So a single node architecture does not fit all the needs. This article compares first of all, the major car mux protocols: CAN, J1850 J1850 and SCI/UART. The second part describes optimized nodes including microcontrollers (ST725x, ST92F120 ST92F120, ST10F167 ST10F167) with embedded FLASH/ROM and physical line interfaces (U435). Then it presents roadmaps for MCU cores, embedded FLASH memories and super-integrations. AN1150 AN1150:BENCHMARK ST72 VS PC16 This document presents the results of a competitive analysis between the STMicroelectonics ST72254 ST72254 and the Microchip PIC16F876 PIC16F876. These two microcontrollers (MCUs) have been chosen for comparison because they are in a similar performance category and were introduced on the market at the same time. The comparison of the two MCUs is divided into two major parts. First the cores, with a comparison of their architecture including performance benchmarks. These benchmarks are based on assembler and C routines that are representative of typical microcontroller applications. The second part examines the peripherals in terms of their functionality and to what extent they off-load the core and the driver software. Finally, you will find a table summarizing the weak and the strong points of each MCU. Two files are appended to this document, you can find them in our Web server (mcu.st.com) in the application note section. The first one entitled "Performance comparison between ST72254 ST72254 and PIC16F876 PIC16F876" includes the results given in this document plus the description of the source and the compilation options used. This file was created in order to allow you to easily reproduce the benchmark. The second file regroups all the source files used. The information on the PIC16F876 PIC16F876 is based on the Microchip datasheet: DS30292A DS30292A.PDF 41/89 ST7 FAMILY - PRODUCT EVALUATION AN1151 AN1151:PERFORMANCE COMPARISON BETWEEN ST72254 ST72254 & PC16F8 PC16F8 STMicroelectronics has developed two sets of test routines related to 8-bit and low-end 16-bit microcontroller applications to evaluate the computing performance of microcontroller cores. These routines have been implemented on ST72254 ST72254 and PIC16F876 PIC16F876 Microcontroller Units. The first set of routines has been written in assembler language to optimize their implementation and focus on core performance, without being dependent upon compiler code transformation. The second set tries to evaluate the performance of the two MCUs and their respective C compilers. This benchmark uses a C language program, representative of an automotive application. The C compilers used were from Hiware on the ST72 and from Hi-Tech on the PIC16 PIC16. The speed of the two MCUs has been compared in two ways: Firstly, at the maximum frequency commercially available on each MCU. this means at an external frequency of 16MHz on the ST72 and of 20MHz on the PIC16 PIC16. Secondly, at the same current consumption level (10mA). * this value is determined by interpolation As we can see, to reach the same consumption level on the two MCUs, the PIC's running frequency must be lowered to 10Mhz (ext.) and the ST72 can keep its maximum frequency of 16MHz (ext.). AN1278 AN1278: LIN (LOCAL INTERCONNECT NETWORK) SOLUTIONS Many mechanical components in the automotive sector have been replaced or are now being replaced by intelligent mechatronical systems. A lot of wires are needed to connect these components. To reduce the amount of wires and to handle communications between these systems, many car manufacturers have created different bus systems that are incompatible with each other. In order to have a standard sub-bus, car manufacturers in Europe have formed a consortium to define a new communications standard for the automotive sector. The new bus, called LIN bus, was invented to be used in simple switching applications like car seats, door locks, sun roofs, rain sensors, mirrors and so on. 42/89 ST7 FAMILY - PRODUCT MIGRATION 2.4 PRODUCT MIGRATION AN1131 AN1131:MIGRATING APPLICATIONS FROM ST72511/311/214/124 ST72511/311/214/124 TO ST72521/321/324 ST72521/321/324 This application note provides information on migrating ST72511/311R ST72511/311R, 314N, 314/124J 314/124J applications to the ST72521/321R ST72521/321R, 321/324J 321/324J family. The ST72521/321R ST72521/321R, 321/324J 321/324J family is designed and manufactured in a more recent technology. AN1322 AN1322:MIGRATING AN APPLICATION FROM ST7263 ST7263 REV.B TO ST7263B ST7263B This application note provides information on migrating existing ST7263 ST7263 Rev. B based applications to the new ST7263B ST7263B. This document: describes the different steps required to upgrade your design environment so as to support the ST7263B ST7263B, lists the device differences that must be taken into account when porting device firmware. AN1365 AN1365:GUIDELINES FOR MIGRATING ST72C254 ST72C254 APPLICATIONS TO ST72F264 ST72F264 This application note provides information on using ST72264 ST72264 new series in an application originally designed for the ST72254 ST72254, 215, 216, 104 series. AN1604 AN1604:HOW TO USE ST7MDT1-TRAIN WITH ST72F264 ST72F264 This application note describes how to upgrade the ST7MDT1-TRAIN originally designed for the ST72C254 ST72C254 and its subsets (in SDIP32 SDIP32), to be compatible with the ST72F264 ST72F264 and its subsets (also in SDIP32 SDIP32 package).The modifications described in this application note still allow to use the board with the ST72C254 ST72C254. For more information concerning the general differences between these two products, please refer to the application note AN1365 AN1365. AN1752 AN1752:ST72324 ST72324 QUICK REFERENCE NOTE The purpose of this document is to give you a basic understanding of the ST72324 ST72324 and to help you quickly get started with developing your application. It also highlights important aspects of the ST72324 ST72324 that you should not overlook when reading the datasheet. Section 1 gives an overview of the key benefits of the device. Sections 2 and 3 contain helpful pointers to help you choose the right tool for the development environment and start working with ST72324 ST72324. In each section of this application note, you will find many useful technical tips to help you make the most of the ST72324 ST72324 features in your design. 43/89 ST7 FAMILY - PRODUCT MIGRATION AN2197 AN2197:GUIDELINES FOR MIGRATING ST72F324 ST72F324 & ST72F321APPLICATIONS ST72F321APPLICATIONS TO ST72F324B ST72F324B, ST72F321B ST72F321B OR ST72F325 ST72F325 This application note provides information on using ST72F321B ST72F321B, ST72F324B ST72F324B and ST72F325 ST72F325 microcontroller devices in applications originally designed for the ST72F324 ST72F324 and ST72F321 ST72F321 series. AN2200 AN2200:GUIDELINES FOR MIGRATING ST7LITE1X APPLICATIONS TO ST7FLITE1XB This application note provides information on migrating ST7FLITE1x-based applications to ST7FLITE1xB. 44/89 ST7 FAMILY - PRODUCT OPTIMIZATION 2.5 PRODUCT OPTIMIZATION AN982 AN982:USING CERAMIC RESONATORS WITH THE ST7 The goal of this application note is to show, using results obtained by Murata, that ceramic resonators can be used instead of quartz crystals. Ceramic resonators are cheaper than quartz crystals and as some resonators have built-in capacitors, so they allow you to use less components. The results described here have been obtained for the ST72251 ST72251 but are also available for ST72101 ST72101, ST72121 ST72121, ST72212 ST72212, ST72213 ST72213, ST72221 ST72221, ST72331 ST72331 and ST72311 ST72311. AN1014 AN1014:HOW TO MINIMIZE THE ST7 POWER CONSUMPTION This document presents a way of minimising the ST7 power consumption for low power applications. This note is based on the ST72311 ST72311, but is applicable to all ST7 general purpose devices. Use of ST7 Slow mode, Wait Mode and Halt mode is discussed and tables with examples of power consumption measurements are given. AN1040 AN1040:MONITORING THE VBUS SIGNAL FOR USB SELF-POWERED DEVICES One of the USB Compliance Checklist for Peripherals items asks the following question: "Is the device's pull-up active only when VBUS is high?". This item refers to chapter 7.1.5 "Device Speed Identification" of the USB Specification. It is mentioned that "the voltage source on the pull-up resistor must be derived from or controlled by the power supplied on the USB cable such that when VBUS is removed, the pull-up resistor does not supply current on the data line to which it is attached" This applies only to self-powered devices where power does not come from VBUS. AN1070 AN1070:ST7 CHECKSUM SELFCHECKING CAPABILITY The goal of this application note is to present a software technique for determining if data and program in EPROM have been corrupted and if so not to run the user's program. The program described in this application note has been written for the ST7GP family (ST72101G1 ST72101G1 and G2, ST72121J2 ST72121J2, ST72212G2 ST72212G2, ST72213G1 ST72213G1, ST72251G1 ST72251G1 and G2, ST72311N2 ST72311N2 and ST72331N2 ST72331N2). In this application, we chose to use a ST72251G2 ST72251G2. AN1324 AN1324:CALIBRATING THE RC OSCILLATOR OF THE ST7FLITE0 MCU USING THE MAINS The purpose of this application note is to present a software solution using the frequency of the European standard mains (220V/50Hz) as a timebase to adjust the internal RC oscillator of the ST7FLITE0 to 1 MHz (1%). The same approach can also be used for the US mains standard (110V/60Hz). 45/89 ST7 FAMILY - PRODUCT OPTIMIZATION AN1477 AN1477:EMULATED DATA EEPROM WITH XFLASH MEMORY When the data EEPROM is not available in a ST7 device, it can be emulated by the XFlash memory with some restrictions. This Application Note describes how to emulate this feature with a ST72F264 ST72F264 device