ST10F272M 16-bit MCU with 256 Kbyte Flash memory and 20 Kbyte RAM Datasheet - production data Features 16-bit CPU with DSP functions - 50ns instruction cycle time at 40 MHz max CPU clock - Multiply/accumulate unit (MAC) 16 x 16-bit multiplication, 40-bit accumulator - Enhanced boolean bit manipulations - Single-cycle context switching support On-chip memories - 256 Kbyte Flash memory (32-bit fetch) - Single voltage Flash memories with erase/program controller and 100 K erasing/programming cycles. - Up to 16 Mbyte linear address space for code and data (5 Mbytes with CAN or I2C) - 2 Kbyte internal RAM (IRAM) - 18 Kbyte extension RAM (XRAM) - Programmable external bus configuration & characteristics for different address ranges - 5 programmable chip-select signals - Hold-acknowledge bus arbitration support Interrupt - 8-channel peripheral event controller for single cycle interrupt driven data transfer - 16-priority-level interrupt system with 56 sources, sampling rate down to 25 ns /4)3 [[PP *$3*5, 24-channel A/D converter - 16-channel 10-bit, accuracy 2 LSB - 8-channel 10-bit, accuracy 5 LSB - 4.85 s minimum conversion time 4-channel PWM unit + 4-channel XPWM 2 CAN 2.0B interfaces operating on 1 or 2 CAN busses (64 or 2x32 message, C-CAN version) Fail-safe protection - Programmable watchdog timer - Oscillator watchdog On-chip bootstrap loader Clock generation - On-chip PLL with 4 to 8 MHz oscillator - Direct or prescaled clock input Real-time clock and 32 kHz on-chip oscillator Up to 111 general purpose I/O lines - Individually programmable as input, output or special function - Programmable threshold (hysteresis) Timers - 2 multi-functional general purpose timer units with 5 timers Two 16-channel capture/compare units Idle, power-down and stand-by modes Serial channels - 2 synch./asynch. serial channels - 2 high-speed synchronous channels - One I2C standard interface Single voltage supply: 5 V 10 % (embedded regulator for 1.8 V core supply) Temperature range: -40 to +125 C September 2013 This is information on a product in full production. Doc ID 12968 Rev 4 1/176 www.st.com 1 Contents ST10F272M Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.2 Special characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.2.1 1.2.1 X-peripheral clock gating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.2.2 1.2.2 Improved supply ring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 Pin data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4 Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5 Internal Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.2 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.2.2 Modules structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.2.3 Low power mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.3 Write operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.4 Registers description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.5 2/176 5.2.1 5.4.1 Flash control register 0 low (FCR0L) . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.4.2 Flash control register 0 high (FCR0H) . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.4.3 Flash control register 1 low (FCR1L) . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.4.4 Flash control register 1 high (FCR1H) . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.4.5 Flash data register 0 low (FDR0L) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.4.6 Flash data register 0 high (FDR0H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5.4.7 Flash data register 1 low (FDR1L) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.4.8 Flash data register 1 high (FDR1H) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.4.9 Flash address register low (FARL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.4.10 Flash address register high (FARH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.4.11 Flash error register (FER) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Protection strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.5.1 Protection registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.5.2 Flash non-volatile write protection I register (FNVWPIR) . . . . . . . . . . . 36 Doc ID 12968 Rev 4 ST10F272M 6 7 Contents 5.5.3 Flash non-volatile access protection register 0 (FNVAPR0) . . . . . . . . . 36 5.5.4 Flash non-volatile access protection register 1 low (FNVAPR1L) . . . . . 36 5.5.5 Flash non-volatile access protection register 1 high (FNVAPR1H) . . . . 37 5.5.6 X-bus Flash volatile temporary access unprotection register (XFVTAUR0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.5.7 Access protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.5.8 Write protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.5.9 Temporary unprotection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.6 Write operation examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.7 Write operation summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Bootstrap loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6.1 Selection among user-code, standard or selective bootstrap . . . . . . . . . . 43 6.2 Standard bootstrap loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6.3 Alternate and selective boot mode (ABM and SBM) . . . . . . . . . . . . . . . . 44 6.3.1 Activation of the ABM and SBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 6.3.2 User mode signature integrity check . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 6.3.3 Selective boot mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Central processing unit (CPU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 7.1 Multiplier-accumulator unit (MAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 7.2 Instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 7.3 MAC co-processor specific instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 49 8 External bus controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 9 Interrupt system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 9.1 X-peripheral interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 9.2 Exception and error traps list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 10 Capture/compare (CAPCOM) units . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 11 General purpose timer unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 12 11.1 GPT1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 11.2 GPT2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 PWM modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Doc ID 12968 Rev 4 3/176 Contents 13 ST10F272M Parallel ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 13.2 I/O's special features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 13.3 13.2.1 Open drain mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 13.2.2 Input threshold control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Alternate port functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 14 A/D converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 15 Serial channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 15.1 Asynchronous/synchronous serial interfaces . . . . . . . . . . . . . . . . . . . . . . 68 15.2 ASCx in asynchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 15.3 ASCx in synchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 15.4 High speed synchronous serial interfaces . . . . . . . . . . . . . . . . . . . . . . . . 69 16 I2C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 17 CAN modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 17.1 Configuration support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 17.2 CAN bus configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 17.2.1 Single CAN bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 17.2.2 Multiple CAN bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 17.2.3 Parallel mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 18 Real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 19 Watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 20 System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 4/176 20.1 Input filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 20.2 Asynchronous reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 20.3 Synchronous reset (warm reset) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 20.4 Software reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 20.5 Watchdog timer reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 20.6 Bidirectional reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 20.7 Reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Doc ID 12968 Rev 4 ST10F272M 21 Contents 20.8 Reset application examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 20.9 Reset summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Power reduction modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 21.1 Idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 21.2 Power-down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 21.3 21.2.1 Protected power-down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 21.2.2 Interruptible power-down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Stand-by mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 21.3.1 Entering stand-by mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 21.3.2 Exiting stand-by mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 21.3.3 Real-time clock and stand-by mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 21.3.4 Power reduction modes summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 22 Programmable output clock divider . . . . . . . . . . . . . . . . . . . . . . . . . . 107 23 Register set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 24 23.1 Special function registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 23.2 X-registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 23.3 Flash registers ordered by name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 23.4 Identification registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 24.1 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 24.2 Recommended operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 24.3 Power considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 24.4 Parameter interpretation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 24.5 DC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 24.6 Flash characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 24.7 A/D converter characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 24.8 24.7.1 Conversion timing control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 24.7.2 A/D conversion accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 24.7.3 Total unadjusted error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 24.7.4 Analog reference pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 AC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 24.8.1 Test waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Doc ID 12968 Rev 4 5/176 Contents ST10F272M 24.8.2 Definition of internal timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 24.8.3 Clock generation modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 24.8.4 Prescaler operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 24.8.5 Direct drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 24.8.6 Oscillator watchdog (OWD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 24.8.7 Phase locked loop (PLL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 24.8.8 Voltage controlled oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 24.8.9 PLL jitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 24.8.10 PLL lock/unlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 24.8.11 Main oscillator specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 24.8.12 32 kHz oscillator specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 24.8.13 External clock drive XTAL1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 24.8.14 Memory cycle variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 24.8.15 External memory bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 24.8.16 Multiplexed bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 24.8.17 Demultiplexed bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 24.8.18 CLKOUT and READY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 24.8.19 External bus arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 24.8.20 High-speed synchronous serial interface (SSC) timing . . . . . . . . . . . . 168 25 Package information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 25.1 ECOPACK(R) packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 25.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .LQFP144 mechanical data 172 26 Ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 27 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 6/176 Doc ID 12968 Rev 4 ST10F272M List of tables List of tables Table 1. Table 2. Table 3. Table 4. Table 5. Table 6. Table 7. Table 8. Table 9. Table 10. Table 11. Table 12. Table 13. Table 14. Table 15. Table 16. Table 17. Table 18. Table 19. Table 20. Table 21. Table 22. Table 23. Table 24. Table 25. Table 26. Table 27. Table 28. Table 29. Table 30. Table 31. Table 32. Table 33. Table 34. Table 35. Table 36. Table 37. Table 38. Table 39. Table 40. Table 41. Table 42. Table 43. Table 44. Table 45. Table 46. Table 47. Table 48. Pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Summary of IFlash address range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Address space reserved for the Flash module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Flash modules sectorization (read operations) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Flash modules sectorization (write operations or with ROMS1 = `1' or bootstrap mode) . . 26 Control register interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Flash control register 0 low . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Flash control register 0 high . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Flash control register 1 low . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Flash control register 1 high . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Banks (BxS) and sectors (BxFy) status bits meaning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Flash data register 0 low. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Flash data register 0 high . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Flash data register 1 low. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Flash data register 1 high . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Flash address register low . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Flash address register high . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Flash error register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Flash non-volatile write protection I register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Flash non-volatile access protection register 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Flash non-volatile access protection register 1 low . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Flash non-volatile access protection register 1 high . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 X-bus Flash volatile temporary access unprotection register . . . . . . . . . . . . . . . . . . . . . . . 37 Summary of access protection level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Flash write operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 ST10F272M boot mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Standard instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 MAC instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 X-interrupt detailed mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Trap priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Compare modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 CAPCOM timer input frequencies, resolutions and periods at 40 MHz . . . . . . . . . . . . . . . 57 GPT1 timer input frequencies, resolutions and periods at 40 MHz. . . . . . . . . . . . . . . . . . . 59 GPT2 timer input frequencies, resolutions and periods at 40 MHz. . . . . . . . . . . . . . . . . . . 60 PWM unit frequencies and resolutions at 40 MHz CPU clock . . . . . . . . . . . . . . . . . . . . . . 62 ASC asynchronous baudrates by reload value and deviation errors (fCPU = 40 MHz) . . . . 68 ASC synchronous baudrates by reload value and deviation errors (fCPU = 40 MHz) . . . . . 69 Synchronous baudrate and reload values (fCPU = 40 MHz) . . . . . . . . . . . . . . . . . . . . . . . . 70 WDTREL reload value (fCPU = 40 MHz) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Reset event definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Reset event. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 PORT0 latched configuration for the different reset events . . . . . . . . . . . . . . . . . . . . . . . 100 Power reduction modes summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 List of special function registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 List of X-bus registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 List of Flash registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 IDMANUF register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Doc ID 12968 Rev 4 7/176 List of tables Table 49. Table 50. Table 51. Table 52. Table 53. Table 54. Table 55. Table 56. Table 57. Table 58. Table 59. Table 60. Table 61. Table 62. Table 63. Table 64. Table 65. Table 66. Table 67. Table 68. Table 69. Table 70. Table 71. Table 72. Table 73. Table 74. Table 75. Table 76. Table 77. Table 78. 8/176 ST10F272M IDCHIP register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 IDMEM register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 IDPROG register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Recommended operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Package characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 DC characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Flash characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Flash data retention characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 A/D converter characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 A/D converter programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 On-chip clock generator selections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 Internal PLL divider mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 PLL characteristics (VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C) . . . . . . . . . . . . 148 Main oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Main oscillator negative resistance (module) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 32 kHz oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 Minimum values of negative resistance (module) for 32 kHz oscillator . . . . . . . . . . . . . . 150 External clock drive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Memory cycle variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 Multiplexed bus timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 Demultiplexed bus timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 CLKOUT and READY timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 External bus arbitration timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 SSC master mode timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 SSC slave mode timings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 LQFP144 mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Device summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Doc ID 12968 Rev 4 ST10F272M List of figures List of figures Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. Figure 12. Figure 13. Figure 14. Figure 15. Figure 16. Figure 17. Figure 18. Figure 19. Figure 20. Figure 21. Figure 22. Figure 23. Figure 24. Figure 25. Figure 26. Figure 27. Figure 28. Figure 29. Figure 30. Figure 31. Figure 32. Figure 33. Figure 34. Figure 35. Figure 36. Figure 37. Figure 38. Figure 39. Figure 40. Figure 41. Figure 42. Figure 43. Figure 44. Figure 45. Figure 46. Figure 47. Figure 48. Logic symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Pin configuration (top view) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 ST10F272M on-chip memory mapping (ROMEN = 1/XADRS = 800Bh - reset value) . . . . 24 Flash structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Write operation control flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 CPU block diagram (MAC unit not included) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 MAC unit architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 X-interrupt basic structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Block diagram of GPT1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Block diagram of GPT2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Block diagram of PWM module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Connection to single CAN bus via separate CAN transceivers . . . . . . . . . . . . . . . . . . . . . 73 Connection to single CAN bus via common CAN transceivers. . . . . . . . . . . . . . . . . . . . . . 73 Connection to two different CAN buses (example, gateway application) . . . . . . . . . . . . . . 74 Connection to one CAN bus with internal parallel mode enabled. . . . . . . . . . . . . . . . . . . . 74 Asynchronous power-on reset (EA = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Asynchronous power-on reset (EA = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Asynchronous hardware reset (EA = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Asynchronous hardware reset (EA = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Synchronous short/long hardware reset (EA = 1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Synchronous short/long hardware reset (EA = 0). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Synchronous long hardware reset (EA = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Synchronous long hardware reset (EA = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 SW/WDT unidirectional reset (EA = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 SW/WDT unidirectional reset (EA = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 SW/WDT bidirectional reset (EA = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 SW/WDT bidirectional reset (EA = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 SW/WDT bidirectional reset (EA = 0) followed by a HW reset . . . . . . . . . . . . . . . . . . . . . . 93 Minimum external reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 System reset circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Internal (simplified) reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Example of software or watchdog bidirectional reset (EA = 1) . . . . . . . . . . . . . . . . . . . . . . 97 Example of software or watchdog bidirectional reset (EA = 0) . . . . . . . . . . . . . . . . . . . . . . 98 Port0 bits latched into the different registers after reset . . . . . . . . . . . . . . . . . . . . . . . . . . 101 External RC circuitry on RPD pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Port2 test mode structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Supply current versus the operating frequency (run and idle modes) . . . . . . . . . . . . . . . 129 A/D conversion characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 A/D converter input pins scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Charge sharing timing diagram during sampling phase . . . . . . . . . . . . . . . . . . . . . . . . . . 137 Anti-aliasing filter and conversion rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 Input/output waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Float waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Generation mechanisms for the CPU clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 ST10F272M PLL jitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 Crystal oscillator and resonator connection diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 32 kHz crystal oscillator connection diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 Doc ID 12968 Rev 4 9/176 List of figures Figure 49. Figure 50. Figure 51. Figure 52. Figure 53. Figure 54. Figure 55. Figure 56. Figure 57. Figure 58. Figure 59. Figure 60. Figure 61. Figure 62. Figure 63. 10/176 ST10F272M External clock drive XTAL1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 External memory cycle: Multiplexed bus, with/without read/write delay, normal ALE. . . . 155 External memory cycle: Multiplexed bus, with/without read/write delay, extended ALE. . 156 External memory cycle: Multiplexed bus, with/without r/w delay, normal ALE, r/w CS. . . 157 External memory cycle: Multiplexed bus, with/without r/w delay, extended ALE, r/w CS . 158 External memory cycle: Demultiplexed bus, with/without r/w delay, normal ALE . . . . . . . 161 External memory cycle: Demultiplexed bus, with/without r/w delay, extended ALE . . . . . 162 External memory cycle: Demultipl. bus, with/without r/w delay, normal ALE, r/w CS . . . . 163 External memory cycle: Demultiplexed bus, without r/w delay, extended ALE, r/w CS . . 164 CLKOUT and READY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 External bus arbitration (releasing the bus) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 External bus arbitration (regaining the bus) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 SSC master timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 SSC slave timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171 LQFP144 package dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172 Doc ID 12968 Rev 4 ST10F272M Introduction 1 Introduction 1.1 Description The ST10F272M device is a new derivative of the STMicroelectronics ST10 family of 16-bit single-chip CMOS microcontrollers. The ST10F272M combines high CPU performance (up to 20 million instructions per second) with high peripheral functionality and enhanced I/O capabilities. It also provides on-chip high-speed single voltage Flash memory, on-chip high-speed RAM, and clock generation via PLL. The ST10F272M is processed in 0.18mm CMOS technology. The MCU core and the logic is supplied with a 5 V to 1.8 V on-chip voltage regulator. The part is supplied with a single 5 V supply and I/Os work at 5 V. The ST10F272M is an optimized version of the ST10F272E, upward compatible with the following set of differences: Maximum CPU frequency is 40 MHz Reduced range for the Standby Voltage: VStby must be in the range of 4.5 to 5.5 V. Identification registers: the IDMEM register reflects the Flash type difference and can be used to differentiate the two devices by software Improved EMC behavior thanks to the introduction of an internal RC filter on the 5 V for the ballast transistors 1.2 Special characteristics 1.2.1 1.2.1 X-peripheral clock gating This new feature have been implemented on the ST10F272M: Once the EINIT instruction has been executed, only the X-peripherals enabled in the XPERCON register will be clocked. The new feature allows to reduce the power consumption and also should improve the emissions as it avoids to propagate useless clock signals across the device. 1.2.2 1.2.2 Improved supply ring An RC filter has been introduced in the 5 V power supply ring of the ballast transistor. In addition, the supply rings for the internal voltage regulators and the I/Os have been split. These two modifications should improve the behavior of the device regarding conducted emissions. Doc ID 12968 Rev 4 11/176 Introduction Figure 1. ST10F272M Logic symbol 9 9'' 966 ;7$/ ;7$/ ;7$/ ;7$/ 3RUW ELW 567,1 567287 3RUW ELW 9$5() 3RUW ELW 9$*1' 3RUW ELW 67)0 10, ($967%< 5($'< $/( 5' :5:5/ 3RUW ELW 3RUW ELW 3RUW ELW 3RUW ELW 3RUW ELW 53' *$3*5, 12/176 Doc ID 12968 Rev 4 ST10F272M Pin data Pin configuration (top view) 67)0 3+$' 3/$' 3/$' 3/$' 3/$' 3/$' 3/$' 3/$' 3/$' ($967%< $/( 5($'< :5:5/ 5' 966 9'' 3$&$1B7['6'$ 3$&$1B7['&$1B7[' 3$&$1B5['&$1B5[' 3$&$1B5['6&/ 3$ 3$ 3$ 3$ 53' 966 9'' 3&/.287 36&/. 3%+(:5+ 35[' 37[' 30765 30567 37,1 37,1 3&6 3&6 3&6 3&6 3&6 3+2/'6&/. 3+/'$0765 3%5(40567 3;3287&&,2 3;3287&&,2 3;3287&&,2 3;3287&&,2 3&&,2 3&&,2 35['&&,2 37['&&,2 9'' 966 33287 33287 33287 33287 3&&,2 3&&,2 3&&,2 3&&,2 3$1 3$1 3$1 3$1 3$1 3$1 3$1 3$1 3$1 3$1 ;7$/ ;7$/ 10, 567287 567,1 966 ;7$/ ;7$/ 9'' 3+$&&, 3+$&&, 3+$&&, 3+$&&, 3+$ 3+$ 3+$ 3+$ 966 9'' 3/$$1 3/$$1 3/$$1 3/$$1 3/$$1 3/$$1 3/$$1 3/$$1 3+$' 3+$' 3+$' 3+$' 3+$' 3+$' 3+$' 966 9'' Figure 2. 9$5() 9$*1' 3$17(8' 3$17 (8' 3$17,1 3$17,1 3$17(8' 3$17(8' 966 9'' 3&&,2 3&&,2 3&&,2 3&&,2 3&&,2 3&&,2 3&&,2 3&&,2 966 9 3&&,2(;,1 3&&,2(;,1 3&&,2(;,1 3&&,2(;,1 3&&,2(;,1 3&&,2(;,1 3&&,2(;,1 3&&,2(;,17,1 37,1 37287 3&$3,1 37287 37(8' 37,1 966 9'' 2 Pin data *$3*5, Doc ID 12968 Rev 4 13/176 Pin data Table 1. Symbol ST10F272M Pin description Pin 1-8 P6.0 - P6.7 Type I/O Function 8-bit bidirectional I/O port, bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. Port 6 outputs can be configured as push-pull or open drain drivers. The input threshold of port 6 is selectable (TTL or CMOS). The following port 6 pins have alternate functions: 1 O P6.0 CS0 Chip select 0 output ... ... ... ... ... 5 O P6.4 CS4 Chip select 4 output I P6.5 HOLD External master hold request input SCLK1 SSC1: master clock output/slave clock input HLDA Hold acknowledge output MTSR1 SSC1: master-transmitter/slave-receiver I/O BREQ Bus request output MRST1 SSC1: master-receiver/slave-transmitter I/O 6 I/O O P6.6 7 I/O O P6.7 8 I/O 9-16 I/O 8-bit bidirectional I/O port, bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. Port 8 outputs can be configured as push-pull or open drain drivers. The input threshold of port 8 is selectable (TTL or CMOS). The following port 8 pins have alternate functions: I/O P8.0 CC16IO CAPCOM2: CC16 capture input/compare output XPWM0 PWM1: channel 0 output 9 O ... P8.0 - P8.7 ... ... ... ... I/O P8.3 CC19IO CAPCOM2: CC19 capture input/compare output XPWM0 PWM1: channel 3 output 12 O 13 I/O P8.4 CC20IO CAPCOM2: CC20 capture input/compare output 14 I/O P8.5 CC21IO CAPCOM2: CC21 capture input/compare output I/O P8.6 CC22IO CAPCOM2: CC22 capture input compare output RxD1 ASC1: Data input (asynchronous) or I/O (synchronous) CC23IO CAPCOM2: CC23 capture input/compare output TxD1 ASC1: Clock/data output (asynchronous/synchronous) 15 I/O I/O P8.7 16 O 14/176 Doc ID 12968 Rev 4 ST10F272M Table 1. Pin data Pin description (continued) Symbol P7.0 - P7.7 P5.0 - P5.9 P5.10 - P5.15 P2.0 - P2.7 P2.8 - P2.15 Pin Type Function 19-26 I/O 8-bit bidirectional I/O port, bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. Port 7 outputs can be configured as push-pull or open drain drivers. The input threshold of port 7 is selectable (TTL or CMOS). The following port 7 pins have alternate functions: 19 O P7.0 POUT0 PWM0: channel 0 output ... ... ... ... ... 22 O P7.3 POUT3 PWM0: channel 3 output 23 I/O P7.4 CC28IO CAPCOM2: CC28 capture input/compare output ... ... ... ... ... 26 I/O P7.7 CC31IO CAPCOM2: CC31 capture input/compare output 27-36 39-44 I I 16-bit input-only port with Schmitt-trigger characteristics. The pins of port 5 can be the analog input channels (up to 16) for the A/D converter, where P5.x equals ANx (Analog input channel x), or they are timer inputs. The input threshold of Port 5 is selectable (TTL or CMOS). The following port 5 pins have alternate functions: 39 I P5.10 T6EUD GPT2: timer T6 external up/down control input 40 I P5.11 T5EUD GPT2: timer T5 external up/down control input 41 I P5.12 T6IN GPT2: timer T6 count input 42 I P5.13 T5IN GPT2: timer T5 count input 43 I P5.14 T4EUD GPT1: timer T4 external up/down control input 44 I P5.15 T2EUD GPT1: timer T2 external up/down control input 47-54 57-64 I/O 16-bit bidirectional I/O port, bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. Port 2 outputs can be configured as push-pull or open drain drivers. The input threshold of Port 2 is selectable (TTL or CMOS). The following port 2 pins have alternate functions: 47 I/O P2.0 CC0IO CAPCOM: CC0 capture input/compare output ... ... ... ... ... 54 I/O P2.7 CC7IO CAPCOM: CC7 capture input/compare output 57 I/O P2.8 CC8IO CAPCOM: CC8 capture input/compare output EX0IN Fast external interrupt 0 input I ... ... ... ... ... 64 I/O P2.15 CC15IO CAPCOM: CC15 capture input/compare output I EX7IN Fast external interrupt 7 input I T7IN CAPCOM2: timer T7 count input Doc ID 12968 Rev 4 15/176 Pin data Table 1. ST10F272M Pin description (continued) Symbol P3.0 - P3.5 P3.6 - P3.13, P3.15 16/176 Pin Type Function 65-70, 73-80, 81 I/O I/O I/O 15-bit (P3.14 is missing) bidirectional I/O port, bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. Port 3 outputs can be configured as push-pull or open drain drivers. The input threshold of port 3 is selectable (TTL or CMOS). The following port 3 pins have alternate functions: 65 I P3.0 T0IN CAPCOM1: timer T0 count input 66 O P3.1 T6OUT GPT2: timer T6 toggle latch output 67 I P3.2 CAPIN GPT2: register CAPREL capture input 68 O P3.3 T3OUT GPT1: timer T3 toggle latch output 69 I P3.4 T3EUD GPT1: timer T3 external up/down control input 70 I P3.5 T4IN GPT1; timer T4 input for count/gate/reload/capture 73 I P3.6 T3IN GPT1: timer T3 count/gate input 74 I P3.7 T2IN GPT1: timer T2 input for count/gate/reload/capture 75 I/O P3.8 MRST0 SSC0: master-receiver/slave-transmitter I/O 76 I/O P3.9 MTSR0 SSC0: master-transmitter/slave-receiver I/O 77 O P3.10 TxD0 ASC0: clock/data output (asynchronous/synchronous) 78 I/O P3.11 RxD0 ASC0: data input (asynchronous) or I/O (synchronous) 79 O P3.12 BHE External memory high byte enable signal WRH External memory high byte write strobe 80 I/O P3.13 SCLK0 SSC0: master clock output/slave clock input 81 O P3.15 CLKOUT System clock output (programmable divider on CPU clock) Doc ID 12968 Rev 4 ST10F272M Table 1. Symbol Pin data Pin description (continued) Pin Type Function 85-92 I/O Port 4 is an 8-bit bidirectional I/O port. It is bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. The input threshold is selectable (TTL or CMOS). Port 4.4, 4.5, 4.6 and 4.7 outputs can be configured as push-pull or open drain drivers. In case of an external bus configuration, port 4 can be used to output the segment address lines: 85 O P4.0 A16 Segment address line 86 O P4.1 A17 Segment address line 87 O P4.2 A18 Segment address line 88 O P4.3 A19 Segment address line A20 Segment address line CAN2_RxD CAN2: receive data input I/O SCL I2C Interface: serial clock O A21 Segment address line CAN1_RxD CAN1: receive data input I CAN2_RxD CAN2: receive data input O A22 Segment address line CAN1_TxD CAN1: transmit data output O CAN2_TxD CAN2: transmit data output O A23 Most significant segment address line CAN2_TxD CAN2: transmit data output SDA I2C Interface: serial data O P4.0 - P4.7 89 90 91 92 I I O O I/O RD WR/WRL 95 96 P4.4 P4.5 P4.6 P4.7 O External memory read strobe. RD is activated for every external instruction or data read access. O External memory write strobe. In WR-mode this pin is activated for every external data write access. In WRL mode this pin is activated for low byte data write accesses on a 16-bit bus, and for every data write access on an 8-bit bus. See WRCFG in the SYSCON register for mode selection. READY/ READY 97 I Ready input. The active level is programmable. When the ready function is enabled, the selected inactive level at this pin, during an external memory access, will force the insertion of waitstate cycles until the pin returns to the selected active level. ALE 98 O Address latch enable output. In case of use of external addressing or of multiplexed mode, this signal is the latch command of the address lines. Doc ID 12968 Rev 4 17/176 Pin data Table 1. ST10F272M Pin description (continued) Symbol EA / VSTBY Pin 99 Type Function I External access enable pin. A low level applied to this pin during and after reset forces the ST10F272M to start the program from the external memory space. A high level forces ST10F272M to start in the internal memory space. This pin is also used (when Stand-by mode is entered, that is ST10F272M under reset and main VDD turned off) to bias the 32 kHz oscillator amplifier circuit and to provide a reference voltage for the low-power embedded voltage regulator which generates the internal 1.8V supply for the RTC module (when not disabled) and to retain data inside the Stand-by portion of the XRAM (16 Kbyte). It can range from 4.5 to 5.5 V. In running mode, this pin can be tied low during reset without affecting 32 kHz oscillator, RTC and XRAM activities, since the presence of a stable VDD guarantees the proper biasing of all those modules. Two 8-bit bidirectional I/O ports P0L and P0H, bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. The input threshold of Port 0 is selectable (TTL or CMOS). In case of an external bus configuration, PORT0 serves as the address (A) and as the address/data (AD) bus in multiplexed bus modes and as the data (D) bus in demultiplexed bus modes. Demultiplexed bus modes P0L.0 - P0L.7, 100-107, P0H.0, 108, P0H.1 - P0H.7 111-117 I/O Data path width 8-bit 16-bit P0L.0 - P0L.7: D0 - D7 D0 - D7 P0H.0 - P0H.7: I/O D8 - D15 Multiplexed bus modes Data path width 8-bit 16-bit P0L.0 - P0L.7: AD0 - AD7 AD0 - AD7 P0H.0 - P0H.7: A8 - A15 AD8 - AD15 Two 8-bit bidirectional I/O ports P1L and P1H, bitwise programmable for input or output via direction bit. Programming an I/O pin as input forces the corresponding output driver to high impedance state. port1 is used as the 16-bit address bus (A) in demultiplexed bus modes: If at least BUSCONx is configured such that the demultiplexed mode is selected, the pins of port1 are not available for general purpose I/O function. The input threshold of port 1 is selectable (TTL or CMOS). The pins of P1L also serve as the additional (up to eight) analog input channels for the A/D converter, where P1L.x equals ANy (Analog input channel y, where y = x + 16). This additional function has a higher priority on demultiplexed bus function. The following port1 pins have alternate functions: 118-125 128-135 I/O 132 I P1H.4 CC24IO CAPCOM2: CC24 capture input 133 I P1H.5 CC25IO CAPCOM2: CC25 capture input 134 I P1H.6 CC26IO CAPCOM2: CC26 capture input 135 I P1H.7 CC27IO CAPCOM2: CC27 capture input XTAL1 138 I XTAL1 Main oscillator amplifier circuit and/or external clock input XTAL2 137 O XTAL2 Main oscillator amplifier circuit output P1L.0 - P1L.7, P1H.0 - P1H.7 18/176 Doc ID 12968 Rev 4 ST10F272M Table 1. Symbol Pin data Pin description (continued) Pin Type Function To clock the device from an external source, drive XTAL1 while leaving XTAL2 unconnected. Minimum and maximum high/low and rise/fall times specified in the AC characteristics must be observed. XTAL3 143 I XTAL3 32 kHz oscillator amplifier circuit input XTAL4 144 O XTAL4 32 kHz oscillator amplifier circuit output When 32 kHz oscillator amplifier is not used, to avoid spurious consumption, XTAL3 must be tied to ground while XTAL4 has to be left open. Additionally, bit OFF32 in RTCCON register must be set. 32 kHz oscillator can only be driven by an external crystal, and not by a different clock source. RSTIN 140 I Reset input with CMOS Schmitt-trigger characteristics. A low level at this pin for a specified duration while the oscillator is running resets the ST10F272M. An internal pull-up resistor permits power-on reset using only a capacitor connected to VSS. In bidirectional reset mode (enabled by setting bit BDRSTEN in SYSCON register), the RSTIN line is pulled low for the duration of the internal reset sequence. RSTOUT 141 O Internal reset indication output. This pin is driven to a low level during hardware, software or watchdog timer reset. RSTOUT remains low until the EINIT (end of initialization) instruction is executed. NMI 142 I Non-maskable interrupt input. A high to low transition at this pin causes the CPU to vector to the NMI trap routine. If bit PWDCFG = `0' in SYSCON register, when the PWRDN (power-down) instruction is executed, the NMI pin must be low in order to force the ST10F272M to go into power-down mode. If NMI is high and PWDCFG ='0', when PWRDN is executed, the part will continue to run in normal mode. If not used, pin NMI should be pulled high externally. VAREF 37 - A/D converter reference voltage and analog supply VAGND 38 - A/D converter reference and analog ground RPD 84 - Timing pin for the return from interruptible power-down mode and synchronous/ asynchronous reset selection. VDD 17, 46, 72,82,93 , 109, 126, 136 - Digital supply voltage = +5 V during normal operation, idle and power-down modes. It can be turned off when stand-by RAM mode is selected. VSS 18,45, 55,71, 83,94, 110, 127, 139 - Digital ground V18 56 - 1.8 V decoupling pin: a decoupling capacitor (typical value of 10 nF, max 100 nF) must be connected between this pin and nearest VSS pin. Doc ID 12968 Rev 4 19/176 Functional description 3 ST10F272M Functional description The architecture of the ST10F272M combines advantages of both RISC and CISC processors and an advanced peripheral subsystem. The block diagram gives an overview of the different on-chip components and the high bandwidth internal bus structure of the ST10F272M. Figure 3. Block diagram ,)ODVK . &38FRUHDQG0$&XQLW ;5$0 . 3(& :DWFKGRJ ,QWHUUXSWFRQWUROOHU ;$6& 3// ;66& 99 YROWDJH UHJXODWRU 3RUW 3RUW &$3&20 %5* &$3&20 66& %5* 3:0 $6& ELW$'& 3RUW *37*37 ;&$1 ([WHUQDOEXV FRQWUROOHU 3RUW 3RUW 3RUW N+] RVFLOODWRU ;3:0 ;,& 2VFLOODWRU 3RUW 3RUW 3RUW ;57& ,5$0 . 3(& ;5$0 . 67%< ;&$1 *$3*5, 20/176 Doc ID 12968 Rev 4 ST10F272M 4 Memory organization Memory organization The memory space of the ST10F272M is configured in a unified memory architecture. Code memory, data memory, registers and I/O ports are organized within the same linear address space of 16 Mbytes. The entire memory space can be accessed bytewise or wordwise. Particular portions of the on-chip memory have additionally been made directly bit addressable. IFlash: 256 Kbytes of on-chip Flash memory. It is divided in eight blocks (B0F0...B0F7) that constitute the bank 0. When bootstrap mode is selected, the test-Flash block B0TF (4 Kbytes) appears at address 00'0000h: refer to Section 5: Internal Flash memory for more details on memory mapping in boot mode. The summary of address range for IFlash is the following: Table 2. Summary of IFlash address range Blocks User mode Size (bytes) B0TF Not visible 4K B0F0 00'0000h - 00'1FFFh 8K B0F1 00'2000h - 00'3FFFh 8K B0F2 00'4000h - 00'5FFFh 8K B0F3 00'6000h - 00'7FFFh 8K B0F4 01'8000h - 01'FFFFh 32K B0F5 02'0000h - 02'FFFFh 64K B0F6 03'0000h - 03'FFFFh 64K B0F7 04'0000h - 04'FFFFh 64K IRAM: 2 Kbytes of on-chip internal RAM (dual-port) is provided as a storage for data, system stack, general purpose register banks and code. A register bank is 16 wordwide (R0 to R15) and/or bytewide (RL0, RH0, ..., RL7, RH7) general purpose registers group. XRAM: 16K + 2K bytes of on-chip extension RAM (single port XRAM) is provided as a storage for data, user stack and code. The XRAM is divided into two areas, the first 2 Kbytes named XRAM1 and the second 16 Kbytes named XRAM2, connected to the internal XBUS and are accessed like an external memory in 16-bit demultiplexed bus-mode without wait state or read/write delay (50 ns access at 40 MHz CPU clock). Byte and word accesses are possible. The XRAM1 address range is 00'E000h - 00'E7FFh if XPEN (bit 2 of SYSCON register), and XRAM1EN (bit 2 of XPERCON register) are set. If XRAM1EN or XPEN is cleared, then any access in the address range 00'E000h - 00'E7FFh will be directed to external memory interface, using the BUSCONx register corresponding to address matching ADDRSELx register. The XRAM2 address range is the one selected programming XADRS3 register, if XPEN (bit 2 of SYSCON register), and XRAM2EN (bit 3 of XPERCON register) are set. If bit XPEN is cleared, then any access in the address range programmed for XRAM2 will be directed to external memory interface, using the BUSCONx register corresponding to address matching ADDRSELx register. Doc ID 12968 Rev 4 21/176 Memory organization ST10F272M After reset, the XRAM2 address range is 09'0000h - 09'3FFFh and is mirrored every 16 Kbyte boundary until 0F'FFFFh. XRAM2 also represents the stand-by RAM, which can be maintained biased through EA / VSTBY pin when main supply VDD is turned off. As the XRAM appears like external memory, it cannot be used as system stack or as register banks. The XRAM is not provided for single bit storage and therefore is not bit addressable. SFR/ESFR: 1024 bytes (2 x 512 bytes) of address space is reserved for the special function register areas. SFRs are wordwide registers which are used to control and to monitor the function of the different on-chip units. CAN1: Address range 00'EF00h - 00'EFFFh is reserved for the CAN1 module access. The CAN1 is enabled by setting XPEN bit 2 of the SYSCON register and by setting CAN1EN bit 0 of the XPERCON register. Accesses to the CAN module use demultiplexed addresses and a 16-bit data bus (only word accesses are possible). Two wait states give an access time of 100ns at 40 MHz CPU clock. No tri-state wait states are used. CAN2: Address range 00'EE00h - 00'EEFFh is reserved for the CAN2 Module access. The CAN2 is enabled by setting XPEN bit 2 of the SYSCON register and by setting CAN2EN bit 1 of the new XPERCON register. Accesses to the CAN module use demultiplexed addresses and a 16-bit data bus (only word accesses are possible). Two wait states give an access time of 100ns at 40 MHz CPU clock. No tri-state wait states are used. Note: If one or the two CAN modules are used, port 4 cannot be programmed to output all eight segment address lines. Thus, only four segment address lines can be used, reducing the external memory space to 5 Mbytes (1 Mbyte per CS line). RTC: Address range 00'ED00h - 00'EDFFh is reserved for the RTC Module access. The RTC is enabled by setting XPEN bit 2 of the SYSCON register and bit 4 of the XPERCON register. Accesses to the RTC Module use demultiplexed addresses and a 16-bit data bus (only word accesses are possible). Two waitstates give an access time of 100ns at 40 MHz CPU clock. No tristate waitstate is used. PWM1: Address range 00'EC00h - 00'ECFFh is reserved for the PWM1 module access. The PWM1 is enabled by setting XPEN bit 2 of the SYSCON register and bit 6 of the XPERCON register. Accesses to the PWM1 Module use demultiplexed addresses and a 16bit data bus (only word accesses are possible). Two waitstates give an access time of 100ns at 40 MHz CPU clock. No tristate waitstate is used. Only word access is possible. ASC1: Address range 00'E900h - 00'E9FFh is reserved for the ASC1 module access. The ASC1 is enabled by setting XPEN bit 2 of the SYSCON register and bit 7 of the XPERCON register. Accesses to the ASC1 module use demultiplexed addresses and a 16-bit data bus (only word accesses are possible). Two waitstates give an access time of 100ns at 40 MHz CPU clock. No tristate waitstate is used. SSC1: Address range 00'E800h - 00'E8FFh is reserved for the SSC1 Module access. The SSC1 is enabled by setting XPEN bit 2 of the SYSCON register and bit 8 of the XPERCON register. Accesses to the SSC1 module use demultiplexed addresses and a 16-bit data bus (only word accesses are possible). Two waitstates give an access time of 100ns at 40 MHz CPU clock. No tristate waitstate is used. I2C: Address range 00'EA00h - 00'EAFFh is reserved for the I2C module access. The I2C is enabled by setting XPEN bit 2 of the SYSCON register and bit 9 of the XPERCON register. Accesses to the I2C module use demultiplexed addresses and a 16-bit data bus (only word accesses are possible). Two waitstates give an access time of 100 ns at 40 MHz CPU clock. No tristate waitstate is used. 22/176 Doc ID 12968 Rev 4 ST10F272M Memory organization X-miscellaneous: Address range 00'EB00h - 00'EBFFh is reserved for the access to a set of XBUS additional features. They are enabled by setting XPEN bit 2 of the SYSCON register and bit 10 of the XPERCON register. Accesses to this additional features use demultiplexed addresses and a 16-bit data bus (only word accesses are possible). Two waitstates give an access time of 100ns at 40 MHz CPU clock. No tristate waitstate is used. The following set of features are provided: CLKOUT programmable divider XBUS interrupt management registers ADC multiplexing on P1L register Port1L digital disable register for extra ADC channels CAN2 multiplexing on P4.5/P4.6 CAN1-2 main clock prescaler Main voltage regulator disable for power-down mode TTL/CMOS threshold selection for port0, port1, and port5 Flash temporary unprotection In order to meet the needs of designs where more memory is required than is provided on chip, up to 16 Mbytes of external memory can be connected to the microcontroller. Visibility of XBUS peripherals In order to keep the ST10F272M compatible with the ST10F168/ST10F269, the XBUS peripherals can be selected to be visible on the external address / data bus. Different bits for X-peripheral enabling in XPERCON register must be set. If these bits are cleared before the global enabling with XPEN bit in SYSCON register, the corresponding address space, port pins and interrupts are not occupied by the peripherals, thus the peripheral is not visible and not available. Refer to Chapter 23: Register set on page 108. XPERCON and X-peripheral clock gating As already mentioned, the XPERCON register must be programmed to enable the single Xbus modules separately. The XPERCON is a read/write ESFR register. The new feature of clock gating has been implemented by means of this register: Once the EINIT instruction has been executed, all the peripherals (except RAMs and XMISC) not enabled in the XPERCON register are not be clocked. The clock gating can reduce power consumption and improve EMI when the user doesn't use all X-peripherals. Note: When the clock has been gated in the disabled peripherals, no reset will be raised once the EINIT instruction has been executed. Doc ID 12968 Rev 4 23/176 Memory organization ST10F272M on-chip memory mapping (ROMEN = 1/XADRS = 800Bh - reset value) &RGH VHJPHQW &RGH VHJPHQW 'DWD SDJH )))))) )))) )))) ))))) ) ()))) ( ')))) ' &)))) & %)))) % $)))) $ )))) )))) )))) )))) )))) )))) )))) 0% ([W PHPRU\ ([W PHPRU\ ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 ;5$0 5HVHUYHG 5HVHUYHG 5HVHUYHG 5HVHUYHG )ODVK )ODVK )))) )ODVK )))) )ODVK ([W PHPRU\ )))) ([WPHP )ODVK 'DWD SDJH 5$06)5 .E\WH )))) )( )')) 6)5 )))) )ODVK;5$00E\WH ,5$0 . 5HVHUYHG . (6)5 . ) ))) ) ))) ) ())) 6)5 )( )')) ,5$0 ;$'56 %K . Figure 4. ST10F272M 5HVHUYHG . (6)5 ;&$1 ;&$1 ;57& ;3:0 ;PLVFHOODQHRXV ;,& ;$6& ;66& ( ) ))) ) ))) ()) ) ())) ;5$0 . ( '))) ([W PHPRU\ . $GGUHVVDUHDZKHUH;5$0 LVPLUURUHGHYHU\ .E\WHV ERXQGDU\DIWHUUHVHW & %LWDGGUHVVDEOHPHPRU\ 'DWDSDJH VHJPHQW .E\WH 7KHILUVW.RI)ODVKPD\EHUHPDSSHGIURPVHJPHQWWRVHJPHQWE\VHWWLQJ6<6&215206 EHIRUH(,1,7 $EVROXWHPHPRU\DGGUHVVHVDUHKH[DGHFLPDOYDOXHVZKLOHGDWDSDJHQXPEHUVDUHGHFLPDOYDOXHV *$3*5, 24/176 Doc ID 12968 Rev 4 ST10F272M Internal Flash memory 5 Internal Flash memory 5.1 Overview The on-chip Flash is composed of one matrix module, 256 Kbytes wide. This module is called IFlash because it is on the ST10 internal bus. Figure 5. Flash structure ,)ODVK &RQWUROVHFWLRQ )ODVKFRQWURO UHJLVWHUV +9DQGUHI JHQHUDWRU %DQN.E\WH SURJUDPPHPRU\ .E\WHWHVW)ODVK 3URJUDPHUDVH FRQWUROOHU ,EXVLQWHUIDFH *$3*5, The programming operations of the Flash are managed by an embedded Flash program/erase controller (FPEC). The high voltages needed for program/erase operations are generated internally. The data bus is 32-bit wide for fetch accesses to IFlash, whereas it is 16-bit wide for read accesses to IFlash control registers. Write accesses are possible only in the IFlash control registers area. 5.2 Functional description 5.2.1 Structure Table 3 below shows the address space reserved for the Flash module. Table 3. Address space reserved for the Flash module Description Addresses Size IFlash sectors 0x00 0000 to 0x04 FFFF 256 Kbytes Reserved IBus area 0x05 0000 to 0x07 FFFF 192 Kbytes Registers and Flash internal reserved area 0x08 0000 to 0x08 FFFF 64 Kbytes Doc ID 12968 Rev 4 25/176 Internal Flash memory 5.2.2 ST10F272M Modules structure The IFlash module is composed of a bank (bank 0) of 256 Kbytes of program memory divided in eight sectors (B0F0...B0F7). Bank 0 also contains a reserved sector named testFlash. The addresses from 0x08 0000 to 0x08 FFFF are reserved for the control register interface and other internal service memory space used by the Flash program/erase controller. The following tables show the memory mapping of the Flash when it is accessed in read mode (Table 4: Flash modules sectorization (read operations)), and when accessed in write or erase mode (Table 5: Flash modules sectorization (write operations or with ROMS1 = `1' or bootstrap mode)). Note: With this second mapping, the first four banks are remapped into code segment 1 (same as obtained setting bit ROMS1 in SYSCON register). Table 4. Bank Flash modules sectorization (read operations) Size ST10 bus size (bytes) Description Addresses Bank 0 Flash 0 (B0F0) 0x0000 0000 - 0x0000 1FFF 8K Bank 0 Flash 1 (B0F1) 0x0000 2000 - 0x0000 3FFF 8K Bank 0 Flash 2 (B0F2) 0x0000 4000 - 0x0000 5FFF 8K Bank 0 Flash 3 (B0F3) 0x0000 6000 - 0x0000 7FFF 8K Bank 0 Flash 4 (B0F4) 0x0001 8000 - 0x0001 FFFF 32K Bank 0 Flash 5 (B0F5) 0x0002 0000 - 0x0002 FFFF 64K Bank 0 Flash 6 (B0F6) 0x0003 0000 - 0x0003 FFFF 64K Bank 0 Flash 7 (B0F7) 0x0004 0000 - 0x0004 FFFF 64K B0 Table 5. Bank B0 26/176 32-bit (IBus) Flash modules sectorization (write operations or with ROMS1 = `1' or bootstrap mode) Size ST10 bus size (bytes) Description Addresses Bank 0 Test-Flash (B0TF) 0x0000 0000 - 0x0000 0FFF 4K Bank 0 Flash 0 (B0F0) 0x0001 0000 - 0x0001 1FFF 8K Bank 0 Flash 1 (B0F1) 0x0001 2000 - 0x0001 3FFF 8K Bank 0 Flash 2 (B0F2) 0x0001 4000 - 0x0001 5FFF 8K Bank 0 Flash 3 (B0F3) 0x0001 6000 - 0x0001 7FFF 8K Bank 0 Flash 4 (B0F4) 0x0001 8000 - 0x0001 FFFF 32K Bank 0 Flash 5 (B0F5) 0x0002 0000 - 0x0002 FFFF 64K Bank 0 Flash 6 (B0F6) 0x0003 0000 - 0x0003 FFFF 64K Bank 0 Flash 7 (B0F7) 0x0004 0000 - 0x0004 FFFF 64K Doc ID 12968 Rev 4 32-bit (IBus) ST10F272M Internal Flash memory Table 5 above refers to the configuration when bit ROMS1 of SYSCON register is set. Refer to the device user manual for more details on the memory mapping during bootstrap mode. In particular, when bootstrap mode is entered: Test-Flash is seen and available for code fetches (address 00'0000h) User IFlash is only available for read and write accesses Write accesses must be made with addresses starting in segment 1 from 01'0000h, whatever ROMS1 bit in SYSCON value Read accesses are made in segment 0 or in segment 1 depending of ROMS1 value. In bootstrap mode, by default ROMS1 = 0, so the first 32 Kbytes of IFlash are mapped in segment 0. Example: In default configuration, to program address 0, the user must put the value 01'0000h in the FARL and FARH registers but to verify the content of the address 0, a read to 00'0000h must be performed. The next Table 6 shows the control register interface composition: This set of registers can be addressed by the CPU. Table 6. Control register interface Name 5.2.3 Description Addresses Size FCR1-0 Flash control registers 1-0 0x0008 0000 - 0x0008 0007 8 bytes FDR1-0 Flash data registers 1-0 0x0008 0008 - 0x0008 000F 8 bytes FAR Flash address registers 0x0008 0010 - 0x0008 0013 4 bytes FER Flash error register 0x0008 0014 - 0x0008 0015 2 bytes FNVWPIR Flash non-volatile protection i register 0x0008 DFB0 - 0x0008 DFB1 2 bytes FNVPIRMirror Mirror of Flash non-volatile protection i register 0x0008 DFB4 - 0x0008 DFB5 2 bytes FNVAPR0 Flash non-volatile access protection register 0 0x0008 DFB8 - 0x0008 DFB9 2 bytes FNVAPR1 Flash non-volatile access protection register 1 0x0008 DFBC - 0x0008 DFBF 4 bytes XFVTAUR0 X-bus Flash volatile temporary access unprotection register 0 0x0000 EB50 - 0x0000 EB51 2 bytes Low power mode The Flash module is automatically switched off executing PWRDN instruction. The consumption is drastically reduced, but exiting this state can require a long time (tPD). Recovery time from power-down mode for the Flash modules is anyway shorter than the main oscillator start-up time. To avoid any problem in restarting to fetch code from the Flash, it is important to size properly the external circuit on RPD pin. Note: PWRDN instruction must not be executed while a Flash program/erase operation is in progress. Doc ID 12968 Rev 4 27/176 Internal Flash memory 5.3 ST10F272M Write operation The Flash module has one single register interface mapped in the memory space of the IBus (08'0000h - 08'0015h). All the operations are enabled through four 16-bit control registers: Flash control register 1-0 High/Low (FCR1H/L-FCR0H/L). Eight other 16-bit registers are used to store Flash address and data for program operations (FARH/L and FDR1H/L-FDR0H/L) and write operation error flags (FERH/L). All registers are accessible with 8- and 16-bit instructions (since the IBUS operates in 16-bit mode for read/write accesses to data). Note: The register that controls the temporary unprotection of the Flash is located on the X-bus at address 00'EB50h in the XMiscellaneous register area. Before accessing the IFlash module (and consequently the Flash register to be used for program/erasing operations), the ROMEN bit in SYSCON register must be set. Caution: During a Flash write operation any attempt to read the Flash itself, that is under modification, will output invalid data (software trap 009Bh). This means that the Flash is not fetchable when a programming operation is active: The write operation commands must be executed from another memory (internal RAM or external memory), as in ST10F269 device. In fact, due to IBus characteristics, it is not possible to perform a write operation on IFlash, when fetching code from IFlash. Direct addressing is not allowed for write accesses to IFlash control registers. Warning: During a write operation, when bit LOCK of FCR0 is set, it is forbidden to write into the Flash control registers. Power supply drop If during a write operation the internal low voltage supply drops below a certain internal voltage threshold, any write operation running is suddenly interrupted and the module is reset to read mode. At following power-on, the interrupted Flash write operation must be repeated. 5.4 Registers description 5.4.1 Flash control register 0 low (FCR0L) The Flash control register 0 low (FCR0L) together with the Flash control register 0 high (FCR0H) are used to enable and to monitor all the write operations on the IFlash. The user has no access in write mode to the test-Flash (B0TF). Moreover, the test-Flash block is seen by the user in bootstrap mode only. FCR0L (0x08 0000) 15 14 13 FCR 12 11 10 9 8 7 Reserved - 28/176 Doc ID 12968 Rev 4 Reset value: 0000h 6 5 4 3 2 1 0 LOCK Reserved BSY0 Res. RO - RO - ST10F272M Internal Flash memory Table 7. Flash control register 0 low Bit Name 5.4.2 Function 4 Flash registers access locked When this bit is set, it means that the access to the Flash control registers FCR0H/FCR1H/L, FDR0H/L-FDR1H/L, FARH/L and FER is locked by the FPEC: any read access to the registers will output invalid data (software trap 009Bh) and any write LOCK access will be ineffective. LOCK bit is automatically set when the Flash bit WMS is set. This is the only bit the user can always access to detect the status of the Flash: once it is found low, the rest of FCR0L and all the other Flash registers are accessible by the user as well. Note that FER content can be read when LOCK is low, but its content is updated only when the BSY0 bit is reset. 1 Bank 0 busy (IFlash) This bit indicates that a write operation is running on bank 0 (IFlash). It is automatically set when bit WMS is set. Setting protection operation sets bit BSY0 (since protection BSY0 registers are in this block). When this bit is set, every read access to bank 0 will output invalid data (software trap 009bh), while every write access to the bank will be ignored. At the end of the write operation or during a program or erase suspend this bit is automatically reset and the bank returns to read mode. After a program or erase Resume this bit is automatically set again. Flash control register 0 high (FCR0H) The Flash control register 0 high (FCR0H) together with the Flash control register 0 low (FCR0L) is used to enable and to monitor all the write operations on the IFlash. The user has no access in write mode to the test-Flash (B0TF). Moreover, the test-Flash block is seen by the user in bootstrap mode only. FCR0H (0x08 0002) 15 14 13 FCR 12 11 10 9 WMS SUSP WPG DWPGSER Reserved RW RW Table 8. Bit Name 15 WMS RW RW RW - 8 Reset value: 0000h 7 6 5 4 3 SPR Reserved RW - 2 1 0 Flash control register 0 high Function Write mode start This bit must be set to start every write operation in the Flash module. At the end of the write operation or during a suspend, this bit is automatically reset. To resume a suspended operation, this bit must be set again. It is forbidden to set this bit if bit ERR of FER is high (the operation is not accepted). It is also forbidden to start a new write (program or erase) operation (by setting WMS high) when bit SUSP of FCR0 is high. Resetting this bit by software has no effect. Doc ID 12968 Rev 4 29/176 Internal Flash memory Table 8. Bit Name ST10F272M Flash control register 0 high (continued) Function Suspend This bit must be set to suspend the current program (word or double word) or sector erase operation in order to read data in one of the sectors of the bank under modification or to program data in another bank. The suspend operation resets the Flash bank to normal read mode (automatically resetting bit BSY0). When in program suspend, the Flash module accepts only the following operations: Read and program 14 SUSP resume. when in erase suspend the module accepts only the following operations: read, erase resume and program (word or double word; program operations cannot be suspended during erase suspend). To resume a suspended operation, the WMS bit must be set again, together with the selection bit corresponding to the operation to resume (WPG, DWPG, SER). Note: It is forbidden to start a new write operation with bit SUSP already set. 13 WPG Word program This bit must be set to select the word (32 bits) program operation in the Flash module. The word program operation can be used to program 0s in place of 1s. The Flash address to be programmed must be written in the FARH/L registers, while the Flash data to be programmed must be written in the FDR0H/L registers before starting the execution by setting bit WMS. WPG bit is automatically reset at the end of the word program operation. Double word program This bit must be set to select the double word (64 bits) program operation in the Flash module. The double word program operation can be used to program 0s in place of 1s. The Flash address in which to program (aligned with even words) must be written in the 12 DWPG FARH/L registers, while the two Flash data words to be programmed must be written in the FDR0H/L registers (even word) and FDR1H/L registers (odd word) before starting the execution by setting bit WMS. DWPG bit is automatically reset at the end of the double word program operation. 11 8 30/176 SER Sector erase This bit must be set to select the sector erase operation in the Flash modules. The sector erase operation can be used to erase all the Flash locations to value 0xFF. From 1 to all the sectors of the same bank (excluded test-Flash for bank B0) can be selected to be erased through bits BxFy of FCR1H/L registers before starting the execution by setting bit WMS. It is not necessary to preprogram the sectors to 0x00, because this is done automatically. SER bit is automatically reset at the end of the sector erase operation. SPR Set protection This bit must be set to select the set protection operation. The set protection operation can be used to program 0s in place of 1s in the Flash non-volatile protection registers. The Flash address in which to program must be written in the FARH/L registers, while the Flash data to be programmed must be written in the FDR0H/L before starting the execution by setting bit WMS. A sequence error is flagged by bit SEQER of FER if the address written in FARH/L is not in the range of 0x0E8FB0 to 0x08DFBF. SPR bit is automatically reset at the end of the set protection operation. Doc ID 12968 Rev 4 ST10F272M 5.4.3 Internal Flash memory Flash control register 1 low (FCR1L) The Flash control register 1 Low (FCR1L), together with Flash control register 1 high (FCR1H), is used to select the sectors to erase, or during any write operation to monitor the status of each sector and bank. FCR1L (0x08 0004) 15 14 13 FCR 12 11 10 9 8 Reserved Bit 7:0 5.4.4 7 6 5 4 3 2 1 0 B0F7 B0F6 B0F5 B0F4 B0F3 B0F2 B0F1 B0F0 - Table 9. Reset value: 0000h RS RS RS RS RS RS RS RS Flash control register 1 low Name Function B0F[7:0] Bank 0 IFlash sectors 7-0 status These bits must be set during a sector erase operation to select the sectors to erase in bank 0. Moreover, during any erase operation, these bits are automatically set and give the status of the eight sectors of Bank 0 (B0F7-B0F0). The meaning of B0Fy bit for sector y of bank 0 is given in Table 11: Banks (BxS) and sectors (BxFy) status bits meaning. These bits are automatically reset at the end of a write operation if no errors are detected. Flash control register 1 high (FCR1H) The Flash control register 1 high (FCR1H), together with Flash control register 1 low (FCR1L), is used to select the sectors to erase, or during any write operation to monitor the status of each sector and bank. FCR1H (0x08 0006) 15 14 Table 10. Bit 8 13 FCR 12 11 10 9 8 Reset value: 0000h 7 6 5 4 3 Reserved B0S Reserved - RS - 2 1 0 Flash control register 1 high Name Function B0S Bank 0 status (IFlash) During any erase operation, this bit is automatically modified and gives the status of the bank 0. The meaning of B0Fy bit for sector y of bank 0 is given in Table 11: Banks (BxS) and sectors (BxFy) status bits meaning. This bit is automatically reset at the end of an erase operation if no errors are detected. During any erase operation, this bit is automatically set and gives the status of the bank 0. The meaning of B0Fy bit for sector y of bank 0 is given in Table 11: Banks (BxS) and sectors (BxFy) status bits meaning. These bits are automatically reset at the end of an erase operation if no errors are detected. Doc ID 12968 Rev 4 31/176 Internal Flash memory Table 11. 5.4.5 ST10F272M Banks (BxS) and sectors (BxFy) status bits meaning ERR SUSP B0S = 1 meaning B0Fy = 1 meaning 1 - Erase error in bank0 Erase error in sector y of bank0 0 1 Erase suspended in bank0 Erase suspended in sector y of bank0 0 0 Don't care Don't care Flash data register 0 low (FDR0L) During program operations, the Flash address registers (FARH/L) are used to store the Flash address in which to program and the Flash data registers (FDR1H/L-FDR0H/L) are used to store the Flash data to program. FDR0L (0x08 0008) 15 14 FCR 13 12 11 10 9 8 Reset value: FFFFh 7 6 5 4 3 2 1 0 DIN15 DIN14 DIN13 DIN12 DIN11 DIN10 DIN9 DIN8 DIN7 DIN6 DIN5 DIN4 DIN3 DIN2 DIN1 DIN0 RW RW Table 12. Bit RW RW RW RW RW RW RW RW RW RW RW RW RW RW Flash data register 0 low Name Function Data Input 15:0 15:0 DIN[15:0] These bits must be written with the data to program the Flash with the following operations: Word program (32-bit), double word program (64-bit) and set protection. 5.4.6 Flash data register 0 high (FDR0H) FDR0H (0x08 000A) 15 14 13 FCR 12 11 10 9 8 Reset value: FFFFh 7 6 5 4 3 2 1 0 DIN31 DIN30 DIN29 DIN28 DIN27 DIN26 DIN25 DIN24 DIN23 DIN22 DIN21 DIN20 DIN19 DIN18 DIN17 DIN16 RW RW Table 13. Bit RW RW RW RW RW RW RW RW RW RW RW RW RW RW Flash data register 0 high Name Function Data input 31:16 15:0 DIN[31:16] These bits must be written with the data to program the Flash with the following operations: Word program (32-bit), double word program (64-bit) and set protection. 32/176 Doc ID 12968 Rev 4 ST10F272M 5.4.7 Internal Flash memory Flash data register 1 low (FDR1L) FDR1L (0x08 000C) 15 14 FCR 13 12 11 10 9 8 Reset value: FFFFh 7 6 5 4 3 2 1 0 DIN15 DIN14 DIN13 DIN12 DIN11 DIN10 DIN9 DIN8 DIN7 DIN6 DIN5 DIN4 DIN3 DIN2 DIN1 DIN0 RW RW Table 14. Bit RW RW RW RW RW RW RW RW RW RW RW RW RW RW Flash data register 1 low Name Function Data Input 15:0 15:0 DIN[15:0] These bits must be written with the data to program the Flash with the following operations: Word program (32-bit), double word program (64-bit) and set protection. 5.4.8 Flash data register 1 high (FDR1H) FDR1H (0x08 000E) 15 14 13 FCR 12 11 10 9 8 Reset value: FFFFh 7 6 5 4 3 2 1 0 DIN31 DIN30 DIN29 DIN28 DIN27 DIN26 DIN25 DIN24 DIN23 DIN22 DIN21 DIN20 DIN19 DIN18 DIN17 DIN16 RW RW Table 15. Bit RW RW RW RW RW RW RW RW RW RW RW RW RW RW Flash data register 1 high Name Function Data input 31:16 15:0 DIN[31:16] These bits must be written with the data to program the Flash with the following operations: Word program (32-bit), double word program (64-bit) and set protection. 5.4.9 Flash address register low (FARL) FARL (0x08 0010) 15 14 13 FCR 12 11 10 9 8 Reset value: 0000h 7 6 5 4 3 2 1 0 ADD15ADD14ADD13ADD12ADD11ADD10 ADD9 ADD8 ADD7 ADD6 ADD5 ADD4 ADD3 ADD2 Reserved RW RW Table 16. Bit RW RW RW RW RW RW RW RW RW RW RW RW - Flash address register low Name Function Address 15:2 15:2 ADD[15:2] These bits must be written with the address of the Flash location to program in the following operations: Word program (32-bit) and double word program (64-bit). in double word program bit add2 must be written to `0'. Doc ID 12968 Rev 4 33/176 Internal Flash memory 5.4.10 ST10F272M Flash address register high (FARH) FARH (0x08 0012) 15 14 FCR 13 12 11 10 9 8 Reset value: 0000h 7 6 5 4 Reserved Bit 2 1 0 ADD20 ADD19 ADD18 ADD17 ADD16 - Table 17. 3 RW RW RW RW RW Flash address register high Name Function Address 20:16 4:0 ADD[20:16] These bits must be written with the address of the Flash location to program in the following operations: Word program and double word program. 5.4.11 Flash error register (FER) The Flash error register, as well as all the other Flash registers, can be read only once the LOCK bit of register FCR0L is low. Nevertheless, the FER content is updated after completion of the Flash operation, that is, when BSY0 is reset. Therefore, the FER content can only be read once the LOCK and BSY0 bits are cleared. FER (0x8 0014h) 15 14 13 FCR 12 11 10 9 Reserved Bit 0 1 2 3 34/176 7 6 5 4 3 2 1 0 WPF RESER SEQER Reserved 10ER PGER ERER ERR - Table 18. 8 Reset value: 0000h RC RC RC - RC RC RC RC Flash error register Name Function ERR Write error This bit is automatically set when an error occurs during a Flash write operation or when a bad write operation setup is done. Once the error has been discovered and understood, ERR bit must be software reset. ERER Erase error This bit is automatically set when an erase error occurs during a Flash write operation. This error is due to a real failure of a Flash cell, that can no more be erased. This kind of error is fatal and the sector where it occurred must be discarded. This bit has to be software reset. PGER Program error This bit is automatically set when a program error occurs during a Flash write operation. This error is due to a real failure of a Flash cell, that can no more be programmed. The word where this error occurred must be discarded. This bit has to be software reset. 10ER 1 over 0 error This bit is automatically set when trying to program at 1 bits previously set at 0 (this does not happen when programming the protection bits). This error is not due to a failure of the Flash cell, but only flags that the desired data has not been written. This bit has to be software reset. Doc ID 12968 Rev 4 ST10F272M Internal Flash memory Table 18. Bit 6 7 8 5.5 Flash error register (continued) Name Function SEQER Sequence error This bit is automatically set when the control registers (FCR1H/L-FCR0H/L, FARH/L, FDR1H/L-FDR0H/L) are not correctly filled to execute a valid Write Operation. In this case no write operation is executed. This bit has to be software reset. RESER Resume error This bit is automatically set when a suspended program or erase operation is not resumed correctly due to a protocol error. In this case the suspended operation is aborted. This bit has to be software reset. WPF Write protection flag This bit is automatically set when trying to program or erase in a sector write protected. In case of multiple sector erase, the not protected sectors are erased, while the protected sectors are not erased and bit WPF is set. This bit has to be software reset. Protection strategy The protection bits are stored in non-volatile Flash cells inside IFlash module, that are read once at reset and stored in four volatile registers. Before they are read from the non-volatile cells, all the available protections are forced active during reset. The protections can be programmed using the set protection operation (see Flash control registers paragraph), that can be executed from all the internal or external memories except from the Flash itself. Two kind of protections are available: write protections to avoid unwanted writings and access protections to avoid piracy. In next paragraphs all different level of protections are shown, and architecture limitations are highlighted as well. 5.5.1 Protection registers The four non-volatile protection registers are one time programmable for the user. One register (FNVWPIR) is used to store the write protection fuses respectively for each sector IFlash module. The other three registers (FNVAPR0 and FNVAPR1L/H) are used to store the access protection fuses. Doc ID 12968 Rev 4 35/176 Internal Flash memory 5.5.2 ST10F272M Flash non-volatile write protection I register (FNVWPIR) FNVWPIR (0x08 DFB0) 15 14 13 NVR 12 11 10 9 8 Reserved 5.5.3 6 5 4 3 2 RW 0 RW RW RW RW RW RW RW Flash non-volatile write protection I register Bit Name Function 7:0 W0P[7:0] Write protection bank 0/sectors 7-0 (IFlash) These bits, if programmed at 0, disable any write access to the sectors of bank 0 (IFlash) Flash non-volatile access protection register 0 (FNVAPR0) FNVAPR0 (0x08 DFB8) 15 14 13 12 NVR 11 10 9 8 Delivery value: ACFFh 7 6 5 4 3 2 Reserved Table 20. Bit 0 1 1 0 DBGP ACCP - 5.5.4 1 W0P7W0P6W0P5W0P4W0P3W0P2W0P1W0P0 - Table 19. Reset value: FFFFh 7 RW RW Flash non-volatile access protection register 0 Name Function ACCP Access protection This bit, if programmed at 0, disables any access (read/write) to data mapped inside IFlash module address space, unless the current instruction is fetched from IFlash. DBGP Debug protection This bit, if erased at 1, can be used to by-pass all the protections using the debug features through the test interface. If programmed at 0, on the contrary, all the debug features, the test interface and all the Flash test modes are disabled. Even STMicroelectronics will not be able to access the device to run any eventual failure analysis. Flash non-volatile access protection register 1 low (FNVAPR1L) FNVAPR1L (0x08 DFBC) 15 14 13 12 NVR 11 10 9 8 Delivery value: FFFFh 7 6 5 4 3 2 1 0 PDS15 PDS14 PDS13 PDS12 PDS11 PDS10 PDS9 PDS8 PDS7 PDS6 PDS5 PDS4 PDS3 PDS2 PDS1 PDS0 RW 36/176 RW RW RW RW RW RW RW RW Doc ID 12968 Rev 4 RW RW RW RW RW RW RW ST10F272M Internal Flash memory Table 21. Bit Flash non-volatile access protection register 1 low Name Function Protections disable 15-0 If bit PDSx is programmed at 0 and bit PENx is erased at 1, the action of bit ACCP 15:0 PDS[15:0] is disabled. Bit PDS0 can be programmed at 0 only if both bits DBGP and ACCP have already been programmed at 0. Bit PDSx can be programmed at 0 only if bit PENx-1 has already been programmed at 0. 5.5.5 Flash non-volatile access protection register 1 high (FNVAPR1H) FNVAPR1H (0x08 DFBE) 15 14 13 12 NVR 11 10 9 Delivery value: FFFFh 8 7 6 5 4 3 2 1 0 PEN15PEN14PEN13PEN12PEN11PEN10 PEN9 PEN8 PEN7 PEN6 PEN5 PEN4 PEN3 PEN2 PEN1 PEN0 RW RW Table 22. Bit RW RW RW RW RW RW RW RW RW RW RW RW RW RW Flash non-volatile access protection register 1 high Name Function Protections enable 15-0 15:0 PEN[15:0] If bit PENx is programmed at 0 and bit PDSx+1 is erased at 1, the action of bit ACCP is enabled again. Bit PENx can be programmed at 0 only if bit PDSx has already been programmed at 0. 5.5.6 X-bus Flash volatile temporary access unprotection register (XFVTAUR0) XFVTAUR0 (0x00 EB50) 15 14 Table 23. Bit 0 13 12 NVR 11 10 9 8 Reset value: 0000h 7 6 5 4 3 2 1 0 Reserved TAUB - RW X-bus Flash volatile temporary access unprotection register Name Function TAUB Temporary access unprotection bit If this bit is set to 1, the access protection is temporary disabled. The fact that this bit can be written only while executing from IFlash guarantees that only a code executed in IFlash can unprotect the IFlash when it is access protected. Doc ID 12968 Rev 4 37/176 Internal Flash memory 5.5.7 ST10F272M Access protection The IFlash module has one level of access protection (access to data both in reading and writing). When bit ACCP of FNVAPR0 is programmed at 0 and bit TAUB in XFVTAUR0 is set at 0, the IFlash module becomes access protected (data in the IFlash module can be read only if the current execution is from the IFlash module itself). Trying to read into the access protected Flash from internal RAM or external memories will output a dummy data (software trap 009Bh). When the Flash module is protected in access, data access through PEC transfers is also forbidden. To read/write data through PEC in a protected bank, first it is necessary to temporarily unprotect the Flash module. To enable access protection, the following sequence of operations is recommended: Execution from external memory or internal RAM Program TAUB bit at 1 in XFVTAUR0 register Program ACCP bit in FNVAPR0 to 0 using set protection operation Program TAUB bit at 0 in XFVTAUR0 register Access protection is active when both ACCP bit and TAUB bit are set to 0 Protection can be permanently disabled by programming bit PDS0 of FNVAPR1H, in order to analyze rejects. Protection can be permanently enabled again by programming bit PEN0 of FNVAPR1L. The action to disable and enable again access protections in a permanent way can be executed a maximum of 16 times. To execute the above described operations, the Flash has to be temporarily unprotected (see Section 5.5.9: Temporary unprotection). Trying to write into the access protected Flash from internal RAM or external memories will be unsuccessful. Trying to read into the access protected Flash from internal RAM or external memories will output dummy data (software trap 0x009Bh). When the Flash module is protected in access, data access through PEC of a peripheral is also forbidden. To read/write data in PEC mode from/to a protected bank, it is necessary to first temporarily unprotect the Flash module. The following table summarizes all possible access protection levels: In particular, it shows what is possible and not possible to do when fetching from a memory (see fetch location column) supposing all possible access protections are enabled. Table 24. Summary of access protection level Read IFlash / jump to IFlash Read XRAM or external memory/ jump to XRAM or external memory Read Flash registers Write Flash registers Fetching from IFlash Yes/yes Yes/yes Yes No Fetching from IRAM No/yes Yes/yes No No Fetching from XRAM No/yes Yes/yes No No Fetching from external memory No/yes Yes/yes No No Fetch location 38/176 Doc ID 12968 Rev 4 ST10F272M Internal Flash memory When the access protection is enabled, Flash registers can not be written, so no program/erase operation can be run on IFlash. To enable the access to registers again, the temporary access unprotection procedure has to be followed (see Section 5.5.9). 5.5.8 Write protection The Flash modules have one level of write protections: each sector of each bank of each Flash module can be software write protected by programming at 0 the related bit W0Px in FNVWPIRL register. 5.5.9 Temporary unprotection Bits W0Px of FNVWPIRL can be temporarily unprotected by executing the set protection operation and by writing 1 into these bits. To restore the write protection bits it is necessary to reset the microcontroller or to execute a set protection operation and write 0 into the desired bits. In reality, when a temporary write unprotection operation is executed, the corresponding volatile register is written to 1, while the non-volatile registers bits previously written to 0 (for a protection set operation), will continue to maintain the 0. For this reason, the user software must be in charge to track the current write protection status (for instance using a specific RAM area), it is not possible to deduce it by reading the non-volatile register content (a temporary unprotection cannot be detected). To temporarily unprotect the Flash when the access protection is active, it is necessary to set to `1' the bit TAUB in XFVTAUR0. This bit can be set to `1' only while executing from Flash: In this way only an instruction executed from Flash can unprotect the Flash itself. To restore the access protection, it is necessary to reset the microcontroller or to write at 0 the bit TAUB in XFVTAUR0. 5.6 Write operation examples In the following, examples for each kind of Flash write operation are presented. Note: The write operation commands must be executed from another memory (internal RAM or external memory), as in ST10F269 device. In fact, due to IBus characteristics, it is not possible to perform write operation in Flash while fetching code from Flash. Moreover, direct addressing is not allowed for write accesses to IFlash control registers. This means that both address and data for a writing operation must be loaded in one of ST10 GPR register (R0...R15). Write operation on IBus registers is 16 bits wide. Doc ID 12968 Rev 4 39/176 Internal Flash memory ST10F272M Example of indirect addressing mode MOV MOV MOV RWm, #ADDRESS; RWn, #DATA; [RWm], RWn; /*Load Add in RWm*/ /*Load Data in RWn*/ /*Indirect addressing*/ Word program Example: 32-bit word program of data 0xAAAAAAAA at address 0x025554 FCR0H|= FARL = FARH = FDR0L = FDR0H = FCR0H|= 0x2000; 0x5554; 0x0002; 0xAAAA; 0xAAAA; 0x8000; /*Set WPG in FCR0H*/ /*Load Add in FARL*/ /*Load Add in FARH*/ /*Load Data in FDR0L*/ /*Load Data in FDR0H*/ /*Operation start*/ Double word program Example: Double word program (64-bit) of data 0x55AA55AA at address 0x035558 and data 0xAA55AA55 at address 0x03555C in IFlash module. FCR0H FARL FARH FDR0L FDR0H FDR1L FDR1H FCR0H |= 0x1000; = 0x5558; = 0x0003; = 0x55AA; = 0x55AA; = 0xAA55; = 0xAA55; |= 0x8000; /*Set DWPG/ /*Load Add in FARL*/ /*Load Add in FARH*/ /*Load Data in FDR0L*/ /*Load Data in FDR0H*/ /*Load Data in FDR1L*/ /*Load Data in FDR1H*/ /*Operation start*/ Double word program is always performed on the double word aligned on an even word: bit ADD2 of FARL is ignored. Sector erase Example: Sector erase of sectors B0F1 and B0F0 of Bank 0 in IFlash module. FCR0H FCR1L FCR0H |= 0x0800; |= 0x0003; |= 0x8000; /*Set SER in FCR0H*/ /*Set B0F1, B0F0*/ /*Operation start*/ Suspend and resume Word program, double word program, and sector erase operations can be suspended in the following way: FCR0H |= 0x4000; /*Set SUSP in FCR0H*/ Then the operation can be resumed in the following way: FCR0H FCR0H |= 0x0800; |= 0x8000; /*Set SER in FCR0H*/ /*Operation resume*/ Before resuming a suspended erase, FCR1H/FCR1L must be read to check if the erase is already completed (FCR1H = FCR1L = 0x0000 if erase is complete). Original setup of select operation bits in FCR0H/L must be restored before the operation resume, otherwise the operation is aborted and bit RESER of FER is set. 40/176 Doc ID 12968 Rev 4 ST10F272M Internal Flash memory Set protection Example 1: Enable write protection of sectors B0F3-0 of Bank 0 in IFlash module. FCR0H FARL FARH FDR0L FDR0H FCR0H |= = = = = |= 0x0100; 0xDFB4; 0x0008; 0xFFF0; 0xFFFF; 0x8000; /*Set SPR in FCR0H*/ /*Load Add of register FNVWPIR in FARL*/ /*Load Add of register FNVWPIR in FARH*/ /*Load Data in FDR0L*/ /*Load Data in FDR0H*/ /*Operation start*/ Example 2: Enable access and debug protection. FCR0H FARL FARH FDR0L FCR0H |= = = = |= 0x0100; 0xDFB8; 0x0008; 0xFFFC; 0x8000; /*Set SPR in FCR0H*/ /*Load Add of register FNVAPR0 in FARL*/ /*Load Add of register FNVAPR0 in FARH*/ /*Load Data in FDR0L*/ /*Operation start*/ Example 3: Disable in a permanent way access and debug protection. XFVTAUR0 = 0x0001; FCR0H |= 0x0100; FARL = 0xDFBC; FARH = 0x0008; FDR0L = 0xFFFE; FCR0H |= 0x8000; /*Set TAUB in XFVTAUR0*/ /*Set SPR in FCR0H*/ /*Load Add of register FNVAPR1L in FARL*/ /*Load Add of register FNVAPR1L in FARH*/ /*Load Data in FDR0L for clearing PDS0*/ /*Operation start*/ Example 4: Enable again in a permanent way access and debug protection, after having disabled them. XFVTAUR0 = 0x0001; FCR0H |= 0x0100; FARL = 0xDFBC; FARH = 0x0008; FDR0H = 0xFFFE; FCR0H |= 0x8000; XFVTAUR0 = 0x0000; /*Set TAUB in XFVTAUR0*/ /*Set SPR in FCR0H*/ /*Load Add register FNVAPR1H in FARL*/ /*Load Add register FNVAPR1H in FARH*/ /*Load Data in FDR0H for clearing PEN0*/ /*Operation start*/ /*Reset TAUB in XFVTAUR0*/ Disable and re-enable of access and debug protection in a permanent way (as shown by examples 3 and 4) can be done for a maximum of 16 times. Doc ID 12968 Rev 4 41/176 Internal Flash memory 5.7 ST10F272M Write operation summary In general, each write operation is started through a sequence of three steps: 1. The first instruction is used to select the desired operation by setting its corresponding selection bit in the Flash control register 0. 2. The second step is the definition of the address and data for programming or the sectors or banks to erase. 3. The last instruction is used to start the write operation, by setting the start bit WMS in the FCR0. Once selected, but not yet started, one operation can be canceled by resetting the operation selection bit. Available Flash module write operations are summarized in the following Table 25. Table 25. Flash write operations Operation Select bit Address and data Start bit WPG FARL/FARH FDR0L/FDR0H WMS DWPG FARL/FARH FDR0L/FDR0H FDR1L/FDR1H WMS Sector erase SER FCR1L/FCR1H WMS Set protection SPR FDR0L/FDR0H WMS SUSP None None Word program (32-bit) Double word program (64-bit) Program/erase suspend Figure 6 shows the complete flow needed for a write operation. Figure 6. Write operation control flow 6WDUWZULWHRSHUDWLRQ )&5//2&. " 1R @ ;,5[6(/>@ [ ,7VRXUFH ,7VRXUFH ,7VRXUFH ,7VRXUFH ;3[,&;3[,5 [ ,7VRXUFH ,7VRXUFH ,7VRXUFH ,7VRXUFH (QDEOH>@ ;,5[6(/>@ [ *$3*5, Table 30 summarizes the mapping of the different interrupt sources which shares the four X-interrupt vectors. Table 30. X-interrupt detailed mapping Interrupt source CAN1 interrupt XP0INT receive 2 I C transmit I 2C XP2INT x CAN2 interrupt I2C XP1INT x x x x x x x x x error x SSC1 receive x x x SSC1 transmit x x x SSC1 error 54/176 XP3INT x ASC1 receive x x x ASC1 transmit x x x Doc ID 12968 Rev 4 ST10F272M Interrupt system Table 30. X-interrupt detailed mapping (continued) Interrupt source ASC1 transmit buffer XP0INT XP1INT XP2INT x x x ASC1 error x PLL unlock/OWD x PWM1 channel 3...0 9.2 XP3INT x x Exception and error traps list Table 31 shows all of the possible exceptions or error conditions that can arise during runtime. Table 31. Trap priorities Trap vector Vector location Trap number Trap priority(1) Reset Reset Reset 00'0000h 00'0000h 00'0000h 00h 00h 00h III III III NMI STKOF STKUF NMITRAP STOTRAP STUTRAP 00'0008h 00'0010h 00'0018h 02h 04h 06h II II II UNDOPC MACTRP PRTFLT ILLOPA ILLINA ILLBUS BTRAP BTRAP BTRAP BTRAP BTRAP BTRAP 00'0028h 00'0028h 00'0028h 00'0028h 00'0028h 00'0028h 0Ah 0Ah 0Ah 0Ah 0Ah 0Ah I I I I I I Reserved [002Ch - 003Ch] [0Bh - 0Fh] Software traps TRAP instruction Any 0000h - 01FCh in steps of 4h Any [00h - 7Fh] Exception condition Trap flag Reset functions: Hardware reset Software reset Watchdog timer overflow Class A hardware traps: Non-maskable interrupt Stack overflow Stack underflow Class B hardware traps: Undefined opcode MAC interruption Protected instruction fault Illegal word operand access Illegal instruction access Illegal external bus access Current CPU priority 1. - All the class B traps have the same trap number (and vector) and the same lower priority compared to the class A traps and to the resets. - Each class A trap has a dedicated trap number (and vector). They are prioritized in the second priority level. - The resets have the highest priority level and the same trap number. - The PSW.ILVL CPU priority is forced to the highest level (15) when these exceptions are serviced. Doc ID 12968 Rev 4 55/176 Capture/compare (CAPCOM) units 10 ST10F272M Capture/compare (CAPCOM) units The ST10F272M has two 16-channel CAPCOM units which support generation and control of timing sequences on up to 32 channels with a maximum resolution of 125 ns at 40 MHz CPU clock. The CAPCOM units are typically used to handle high speed I/O tasks such as pulse and waveform generation, pulse width modulation (PMW), digital to analog (D/A) conversion, software timing, or time recording relative to external events. Four 16-bit timers (T0/T1, T7/T8) with reload registers provide two independent time bases for the capture/compare register array. The input clock for the timers is programmable to several prescaled values of the internal system clock, or may be derived from an overflow/underflow of timer T6 in module GPT2. This provides a wide range of variation for the timer period and resolution, and allows precise adjustments to application specific requirements. In addition, external count inputs for CAPCOM timers T0 and T7 allow event scheduling for the capture/compare registers relative to external events. Each of the two capture/compare register arrays contain 16 dual purpose capture/compare registers, each of which may be individually allocated to either CAPCOM timer T0 or T1 (T7 or T8, respectively), and programmed for capture or compare functions. Each of the 32 registers has one associated port pin which serves as an input pin for triggering the capture function, or as an output pin to indicate the occurrence of a compare event. When a capture/compare register has been selected for capture mode, the current contents of the allocated timer will be latched (captured) into the capture/compare register in response to an external event at the port pin which is associated with this register. In addition, a specific interrupt request for this capture/compare register is generated. Either a positive, a negative, or both a positive and a negative external signal transition at the pin can be selected as the triggering event. The contents of all registers which have been selected for one of the five compare modes are continuously compared with the contents of the allocated timers. When a match occurs between the timer value and the value in a capture/compare register, specific actions will be taken based on the selected compare mode. The input frequencies fTx, for the timer input selector Tx, are determined as a function of the CPU clocks. The timer input frequencies, resolution and periods which result from the selected prescaler option in TxI when using a 40 MHz CPU clock are listed in Table 33. The numbers for the timer periods are based on a reload value of 0000h. Note that some numbers may be rounded off to three significant figures. 56/176 Doc ID 12968 Rev 4 ST10F272M Table 32. Capture/compare (CAPCOM) units Compare modes Compare modes Function Mode 0 Interrupt-only compare mode; several compare interrupts per timer period are possible Mode 1 Pin toggles on each compare match; several compare events per timer period are possible Mode 2 Interrupt-only compare mode; only one compare interrupt per timer period is generated Mode 3 Pin set `1' on match; pin reset `0' on compare time overflow; only one compare event per timer period is generated Double register mode Two registers operate on one pin; pin toggles on each compare match; several compare events per timer period are possible. Table 33. CAPCOM timer input frequencies, resolutions and periods at 40 MHz Timer input selection TxI fCPU = 40 MHz 000b 001b 010b 011b 100b 101b 110b 111b 8 16 32 64 128 256 512 1024 Input frequency 5 MHz 2.5 MHz 1.25 MHz 625 kHz Resolution 200 ns 400 ns 0.8 s 1.6 s 3.2 s 6.4 s 12.8 s 25.6 s Period 13.1 ms 26.2 ms 52.4 ms 104.8 ms 209.7 ms 419.4 ms 838.9 ms 1.678 s Prescaler for fCPU 312.5 kHz 156.25 kHz 78.125 kHz Doc ID 12968 Rev 4 39.1 kHz 57/176 General purpose timer unit 11 ST10F272M General purpose timer unit The GPT unit is a flexible multifunctional timer/counter structure which is used for time related tasks such as event timing and counting, pulse width and duty cycle measurements, pulse generation, or pulse multiplication. The GPT unit contains five 16-bit timers organized into two separate modules GPT1 and GPT2. Each timer in each module may operate independently in several different modes, or may be concatenated with another timer of the same module. 11.1 GPT1 Each of the three timers T2, T3, T4 of the GPT1 module can be configured individually for one of four basic modes of operation: timer, gated timer, counter mode and incremental interface mode. In timer mode, the input clock for a timer is derived from the CPU clock, divided by a programmable prescaler. In counter mode, the timer is clocked in reference to external events. Pulse width or duty cycle measurement is supported in gated timer mode where the operation of a timer is controlled by the `gate' level on an external input pin. For these purposes, each timer has one associated port pin (TxIN) which serves as gate or clock input. Table 34 lists the timer input frequencies, resolution and periods for each prescaler option at 40 MHz CPU clock. In incremental interface mode, the GPT1 timers (T2, T3, T4) can be directly connected to the incremental position sensor signals A and B by their respective inputs TxIN and TxEUD. Direction and count signals are internally derived from these two input signals so that the contents of the respective timer Tx corresponds to the sensor position. The third position sensor signal TOP0 can be connected to an interrupt input. Timer T3 has output toggle latches (TxOTL) which changes state on each timer over flow / underflow. The state of this latch may be output on port pins (TxOUT) for time out monitoring of external hardware components, or may be used internally to clock timers T2 and T4 for high resolution of long duration measurements. In addition to their basic operating modes, timers T2 and T4 may be configured as reload or capture registers for timer T3. 58/176 Doc ID 12968 Rev 4 ST10F272M Table 34. General purpose timer unit GPT1 timer input frequencies, resolutions and periods at 40 MHz Timer input selection T2I / T3I / T4I fCPU = 40 MHz 000b 001b 010b 011b 100b 101b 110b 111b Prescaler factor 8 16 32 64 128 256 512 1024 Input frequency 5 MHz 2.5 MHz 1.25 MHz 625 kHz Resolution 200 ns 400 ns 0.8 s 1.6 s 3.2 s 6.4 s 12.8 s 25.6 s Period maximum 13.1 ms 26.2 ms 52.4 ms 104.8 ms 209.7 ms 419.4 ms 838.9 ms 1.678 s 312.5 kHz 156.25 kHz 78.125 kHz 39.1 kHz Figure 10. Block diagram of GPT1 8' 7(8' ,QWHUUXSW UHTXHVW *37WLPHU7 QQ &38FORFN 7,1 7PRGH FRQWURO 5HORDG &DSWXUH QQ &38FORFN 7287 7PRGH FRQWURO 7,1 *37WLPHU7 727/ 8' 7(8' &DSWXUH 5HORDG QQ &38FORFN ,QWHUUXSW UHTXHVW 7PRGH FRQWURO 7,1 7(8' *37WLPHU7 ,QWHUUXSW UHTXHVW 8' *$3*5, Doc ID 12968 Rev 4 59/176 General purpose timer unit 11.2 ST10F272M GPT2 The GPT2 module provides precise event control and time measurement. It includes two timers (T5, T6) and a capture/reload register (CAPREL). Both timers can be clocked with an input clock which is derived from the CPU clock via a programmable prescaler or with external signals. The count direction (up/down) for each timer is programmable by software or may additionally be altered dynamically by an external signal on a port pin (TxEUD). Concatenation of the timers is supported via the output toggle latch (T6OTL) of timer T6 which changes its state on each timer overflow/underflow. The state of this latch may be used to clock timer T5, or it may be output on a port pin (T6OUT). The overflow / underflow of timer T6 can additionally be used to clock the CAPCOM timers T0 or T1, and to cause a reload from the CAPREL register. The CAPREL register may capture the contents of timer T5 based on an external signal transition on the corresponding port pin (CAPIN), and timer T5 may optionally be cleared after the capture procedure. This allows absolute time differences to be measured or pulse multiplication to be performed without software overhead. The capture trigger (timer T5 to CAPREL) may also be generated upon transitions of GPT1 timer T3 inputs T3IN and/or T3EUD. This is advantageous when T3 operates in Incremental Interface mode. Table 35 lists the timer input frequencies, resolution and periods for each prescaler option at 40 MHz CPU clock. Table 35. GPT2 timer input frequencies, resolutions and periods at 40 MHz Timer input selection T5I/T6I fCPU = 40 MHz 000b 001b 010b 011b 100b 101b 110b 111b Prescaler factor 4 8 16 32 64 128 256 512 Input frequency 10 MHz 5 MHz 2.5 MHz 1.25 MHz 625 kHz 312.5 kHz 156.25 kHz 78.125 kHz Resolution 100 ns 200 ns 400 ns 0.8 s 1.6 s 3.2 s 6.4 s 12.8 s Period maximum 6.55 ms 13.1 ms 26.2 ms 52.4 ms 104.8 ms 209.7 ms 419.4 ms 838.9 ms 60/176 Doc ID 12968 Rev 4 ST10F272M General purpose timer unit Figure 11. Block diagram of GPT2 7(8' 8' QQ &38FORFN 7PRGH FRQWURO 7,1 ,QWHUUXSW UHTXHVW *37WLPHU7 &OHDU &DSWXUH ,QWHUUXSW UHTXHVW &$3,1 *37&$35(/ 5HORDG 7RJJOH)) 7,1 QQ &38FORFN ,QWHUUXSW UHTXHVW 7PRGH FRQWURO *37WLPHU7 77/ 7287 8' 7(8' 7R&$3&20WLPHUV *$3*5, Doc ID 12968 Rev 4 61/176 PWM modules 12 ST10F272M PWM modules Two pulse width modulation modules are available on ST10F272M: standard PWM0 and XBUS PWM1. They can generate up to four PWM output signals each, using edge-aligned or center-aligned PWM. In addition, the PWM modules can generate PWM burst signals and single shot outputs. Table 36 shows the PWM frequencies for different resolutions. The level of the output signals is selectable and the PWM modules can generate interrupt requests. Figure 12. Block diagram of PWM module 33[SHULRGUHJLVWHU 0DWFK &RPSDUDWRU &ORFN ,QSXW FRQWURO &ORFN 5XQ 37[ ELWXSGRZQFRXQWHU 8SGRZQ FOHDUFRQWURO 0DWFK &RPSDUDWRU 3287[ 2XWSXWFRQWURO (QDEOH 6KDGRZUHJLVWHU :ULWHFRQWURO 3:[SXOVHZLGWKUHJLVWHU 8VHUUHDGDEOHZULWHDEOHUHJLVWHU *$3*5, Table 36. 62/176 PWM unit frequencies and resolutions at 40 MHz CPU clock Mode 0 Resolution 8-bit 10-bit 12-bit 14-bit 16-bit CPU clock/1 25 ns 156.25 kHz 39.1 kHz 9.77 kHz 2.44 Hz 610 Hz CPU clock/64 1.6 s 2.44 kHz 610Hz 152.6 Hz 38.15 Hz 9.54 Hz Mode 1 Resolution 8-bit 10-bit 12-bit 14-bit 16-bit CPU clock/1 25 ns 78.12 kHz 19.53 kHz 4.88 kHz 1.22 kHz 305.2 Hz CPU clock/64 1.6 s 1.22 kHz 305.17 Hz 76.29 Hz 19.07 Hz 4.77 Hz Doc ID 12968 Rev 4 ST10F272M Parallel ports 13 Parallel ports 13.1 Introduction The ST10F272M MCU provides up to 111 I/O lines with programmable features. These capabilities permit this MCU to be adapted to a wide range of applications. ST10F272M has nine groups of I/O lines gathered as follows: Port 0 is a two time 8-bit port named P0L (low as less significant byte) and P0H (high as most significant byte) Port 1 is a two time 8-bit port named P1L and P1H Port 2 is a 16-bit port Port 3 is a 15-bit port (P3.14 line is not implemented) Port 4 is an 8-bit port Port 5 is a 16-bit port input only Port 6, Port 7 and Port 8 are 8-bit ports These ports may be used as general purpose bidirectional input or output, software controlled with dedicated registers. For example, the output drivers of six of the ports (2, 3, 4, 6, 7, 8) can be configured (bitwise) for push-pull or open drain operation using ODPx registers. The input threshold levels are programmable (TTL/CMOS) for all the ports. The logic level of a pin is clocked into the input latch once per state time, regardless whether the port is configured for input or output. The threshold is selected with PICON and XPICON registers control bits. A write operation to a port pin configured as an input causes the value to be written into the port output latch, while a read operation returns the latched state of the pin itself. A readmodify-write operation reads the value of the pin, modifies it, and writes it back to the output latch. Writing to a pin configured as an output (DPx.y = `1') causes the output latch and the pin to have the written value, since the output buffer is enabled. Reading this pin returns the value of the output latch. A read-modify-write operation reads the value of the output latch, modifies it, and writes it back to the output latch, thus also modifying the level at the pin. I/O lines support an alternate function which is detailed in the following description of each port. 13.2 I/O's special features 13.2.1 Open drain mode Some of the I/O ports of ST10F272M support the open drain capability. This programmable feature may be used with an external pull-up resistor, in order to provide an AND wired logical function. This feature is implemented for ports P2, P3, P4, P6, P7 and P8 (see respective sections), and is controlled through the respective open drain control registers ODPx. Doc ID 12968 Rev 4 63/176 Parallel ports 13.2.2 ST10F272M Input threshold control The standard inputs of the ST10F272M determine the status of input signals according to TTL levels. In order to accept and recognize noisy signals, CMOS input thresholds can be selected instead of the standard TTL thresholds for all the pins. These CMOS thresholds are defined above the TTL thresholds and feature a higher hysteresis to prevent the inputs from toggling while the respective input signal level is near the thresholds. The port input control registers PICON and XPICON are used to select these thresholds for each byte of the indicated ports, this means the 8-bit ports P0L, P0H, P1L, P1H, P4, P7 and P8 are controlled by one bit each while ports P2, P3 and P5 are controlled by two bits each. All options for individual direction and output mode control are available for each pin, independent of the selected input threshold. 13.3 Alternate port functions Each port line has one associated programmable alternate input or output function. Port0 and port1 may be used as address and data lines when accessing external memory. Additionally, port1 provides: - Input capture lines - 8 additional analog input channels to the A/D converter Port 2, port 7 and port 8 are associated with the capture inputs or compare outputs of the CAPCOM units and/or with the outputs of the PWM0 module, of the PWM1 module and of the ASC1. Port 2 is also used for fast external interrupt inputs and for timer 7 input. Port 3 includes the alternate functions of timers, serial interfaces, the optional bus control signal BHE and the system clock output (CLKOUT). Port 4 outputs the additional segment address bit A23...A16 in systems where more than 64 Kbytes of memory are to be access directly. In addition, CAN1, CAN2 and I2C lines are provided. Port 5 is used as analog input channels of the A/D converter or as timer control signals. Port 6 provides optional bus arbitration signals (BREQ, HLDA, HOLD) and chip select signals and the SSC1 lines. If the alternate output function of a pin is to be used, the direction of this pin must be programmed for output (DPx.y = `1'), except for some signals that are used directly after reset and are configured automatically. Otherwise the pin remains in the high-impedance state and is not effected by the alternate output function. The respective port latch should hold a `1', because its output is ANDed with the alternate output data (except for PWM output signals). If the alternate input function of a pin is used, the direction of the pin must be programmed for input (DPx.y = `0') if an external device is driving the pin. The input direction is the default after reset. If no external device is connected to the pin, however, the direction for this pin can also be set to output. In this case, the pin reflects the state of the port output latch. Thus, the alternate input function reads the value stored in the port output latch. This can be used for testing purposes to allow a software trigger of an alternate input function by writing to the port output latch. On most of the port lines, the user software is responsible for setting the proper direction when using an alternate input or output function of a pin. 64/176 Doc ID 12968 Rev 4 ST10F272M Parallel ports This is done by setting or clearing the direction control bit DPx.y of the pin before enabling the alternate function. There are port lines, however, where the direction of the port line is switched automatically. For instance, in the multiplexed external bus modes of port0, the direction must be switched several times for an instruction fetch in order to output the addresses and to input the data. Obviously, this cannot be done through instructions. In these cases, the direction of the port line is switched automatically by hardware if the alternate function of such a pin is enabled. To determine the appropriate level of the port output latches, check how the alternate data output is combined with the respective port latch output. There is one basic structure for all port lines with only an alternate input function. Port lines with only an alternate output function, however, have different structures due to the way the direction of the pin is switched and depending on whether the pin is accessible by the user software or not in the alternate function mode. All port lines that are not used for these alternate functions may be used as general purpose I/O lines. Doc ID 12968 Rev 4 65/176 A/D converter 14 ST10F272M A/D converter A 10-bit A/D converter with 16+8 multiplexed input channels and a sample and hold circuit is integrated on-chip. An automatic self-calibration adjusts the A/D converter module to process parameter variations at each reset event. The sample time (for loading the capacitors) and the conversion time is programmable and can be adjusted to the external circuitry. The Root part number 1 has 16+8 multiplexed input channels on port 5 and port 1. The selection between port 5 and port 1 is made via a bit in an X-bus register. Refer to the user manual for a detailed description. A different accuracy is guaranteed (total unadjusted error) on port 5 and port 1 analog channels (with higher restrictions when overload conditions occur); in particular, port 5 channels are more accurate than the port 1 channels. Refer to Section 24: Electrical characteristics for details. The A/D converter input bandwidth is limited by the achievable accuracy: supposing a maximum error of 0.5 LSB (2 mV) impacting the global TUE (TUE also depends on other causes), in worst case of temperature and process, the maximum frequency for a sine wave analog signal is approximately 7.5 kHz. Of course, to reduce the effect of the input signal variation on the accuracy down to 0.05 LSB, the maximum input frequency of the sine wave must be reduced to 800 Hz. If static signal is applied during sampling phase, series resistance must not be greater than 20 k (this taking into account eventual input leakage). It is suggested to not connect any capacitance on analog input pins, in order to reduce the effect of charge partitioning (and consequent voltage drop error) between the external and the internal capacitance: in case an RC filter is necessary the external capacitance must be greater than 10 nF to minimize the accuracy impact. Overrun error detection/protection is controlled by the ADDAT register. Either an interrupt request is generated when the result of a previous conversion has not been read from the result register at the time the next conversion is complete, or the next conversion is suspended until the previous result has been read. For applications which require less than 16+8 analog input channels, the remaining channel inputs can be used as digital input port pins. The A/D converter of the Root part number 1 supports different conversion modes: 66/176 Single channel single conversion: The analog level of the selected channel is sampled once and converted. The result of the conversion is stored in the ADDAT register. Single channel continuous conversion: The analog level of the selected channel is repeatedly sampled and converted. The result of the conversion is stored in the ADDAT register. Auto scan single conversion: The analog level of the selected channels are sampled once and converted. After each conversion the result is stored in the ADDAT register. The data can be transferred to the RAM by interrupt software management or using the powerful peripheral event controller (PEC) data transfer. Doc ID 12968 Rev 4 ST10F272M A/D converter Auto scan continuous conversion: The analog level of the selected channels are repeatedly sampled and converted. The result of the conversion is stored in the ADDAT register. The data can be transferred to the RAM by interrupt software management or using the PEC data transfer. Wait for ADDAT read mode: When using continuous modes, in order to avoid to overwrite the result of the current conversion by the next one, the ADWR bit of ADCON control register must be activated. Then, until the ADDAT register is read, the new result is stored in a temporary buffer and the conversion is on hold. Channel injection mode: When using continuous modes, a selected channel can be converted in between without changing the current operating mode. The 10-bit data of the conversion are stored in ADRES field of ADDAT2. The current continuous mode remains active after the single conversion is completed. A full calibration sequence is performed after a reset. This full calibration lasts up to 40630 CPU clock cycles. During this time, the busy flag ADBSY is set to indicate the operation. It compensates the capacitance mismatch, so the calibration procedure does not need any update during normal operation. No conversion can be performed during this time: The bit ADBSY has to be polled to verify that the calibration is over, and the module is able to start a conversion. Doc ID 12968 Rev 4 67/176 Serial channels 15 ST10F272M Serial channels Serial communication with other microcontrollers, microprocessors, terminals or external peripheral components is provided by up to four serial interfaces: Two asynchronous/ synchronous serial channels (ASC0 and ASC1) and two high-speed synchronous serial channel (SSC0 and SSC1). Dedicated baudrate generators set up all standard baudrates without the requirement of oscillator tuning. For transmission, reception and erroneous reception, separate interrupt vectors are provided for ASC0 and SSC0 serial channel. A more complex mechanism of interrupt sources multiplexing is implemented for ASC1 and SSC1 (XBUS mapped). 15.1 Asynchronous/synchronous serial interfaces The asynchronous / synchronous serial interfaces (ASC0 and ASC1) provides serial communication between the ST10F272M and other microcontrollers, microprocessors or external peripherals. 15.2 ASCx in asynchronous mode In asynchronous mode, 8- or 9-bit data transfer, parity generation and the number of stop bits can be selected. Parity framing and overrun error detection is provided to increase the reliability of data transfers. Transmission and reception of data is double-buffered. Full-duplex communication up to 1.25 Mbaud (at 40 MHz of fCPU) is supported in this mode. Table 37. ASC asynchronous baudrates by reload value and deviation errors (fCPU = 40 MHz) S0BRS = `0', fCPU = 40 MHz S0BRS = `1', fCPU = 40 MHz Baudrate (baud) Deviation error 1 250 000 0.0%/0.0% 0000/0000 833 333 0.0%/0.0% 0000/0000 112 000 +1.5%/-7.0% 000A/000B 112 000 +6.3%/-7.0% 0006/0007 56 000 +1.5%/-3.0% 0015/0016 56 000 +6.3%/-0.8% 000D/000E 38 400 +1.7%/-1.4% 001F/0020 38 400 +3.3%/-1.4% 0014/0015 19 200 +0.2%/-1.4% 0040/0041 19 200 +0.9%/-1.4% 002A/002B 9 600 +0.2%/-0.6% 0081/0082 9 600 +0.9%/-0.2% 0055/0056 4 800 +0.2%/-0.2% 0103/0104 4 800 +0.4%/-0.2% 00AC/00AD 2 400 +0.2%/0.0% 0207/0208 2 400 +0.1%/-0.2% 015A/015B 1 200 0.1%/0.0% 0410/0411 1 200 +0.1%/-0.1% 02B5/02B6 600 0.0%/0.0% 0822/0823 600 +0.1%/0.0% 056B/056C 300 0.0%/0.0% 1045/1046 300 0.0%/0.0% 0AD8/0AD9 153 0.0%/0.0% 1FE8/1FE9 102 0.0%/0.0% 1FE8/1FE9 Note: 68/176 Reload value (hex) Baudrate (baud) Deviation error Reload value (hex) The deviation errors given in Table 37 are rounded off. To avoid deviation errors use a baudrate crystal (providing a multiple of the ASC0 sampling frequency). Doc ID 12968 Rev 4 ST10F272M 15.3 Serial channels ASCx in synchronous mode In synchronous mode, data is transmitted or received synchronously to a shift clock which is generated by the ST10F272M. Half-duplex communication up to 5 Mbaud (at 40 MHz of fCPU) is possible in this mode. Table 38. ASC synchronous baudrates by reload value and deviation errors (fCPU = 40 MHz) S0BRS = `0', fCPU = 40 MHz Baudrate (baud) Deviation error S0BRS = `1', fCPU = 40 MHz Reload value (hex) Baudrate (baud) Deviation error Reload value (hex) 5 000 000 0.0%/0.0% 0000/0000 3 333 333 0.0%/0.0% 0000/0000 112 000 +1.5%/-0.8% 002B/002C 112 000 +2.6%/-0.8% 001C/001D 56 000 +0.3%/-0.8% 0058/0059 56 000 +0.9%/-0.8% 003A/003B 38 400 +0.2%/-0.6% 0081/0082 38 400 +0.9%/-0.2% 0055/0056 19 200 +0.2%/-0.2% 0103/0104 19 200 +0.4%/-0.2% 00AC/00AD 9 600 +0.2%/0.0% 0207/0208 9 600 +0.1%/-0.2% 015A/015B 4 800 +0.1%/0.0% 0410/0411 4 800 +0.1%/-0.1% 02B5/02B6 2 400 0.0%/0.0% 0822/0823 2 400 +0.1%/0.0% 056B/056C 1 200 0.0%/0.0% 1045/1046 1 200 0.0%/0.0% 0AD8/0AD9 900 0.0%/0.0% 15B2/15B3 600 0.0%/0.0% 15B2/15B3 612 0.0%/0.0% 1FE8/1FE9 407 0.0%/0.0% 1FFD/1FFE Note: The deviation errors given in the Table 38 are rounded off. To avoid deviation errors use a baudrate crystal (providing a multiple of the ASC0 sampling frequency). 15.4 High speed synchronous serial interfaces The high-speed synchronous serial interfaces (SSC0 and SSC1) provides flexible high-speed serial communication between the ST10F272M and other microcontrollers, microprocessors or external peripherals. The SSCx supports full-duplex and half-duplex synchronous communication. The serial clock signal can be generated by the SSCx itself (master mode) or be received from an external master (slave mode). Data width, shift direction, clock polarity and phase are programmable. This allows communication with SPI-compatible devices. Transmission and reception of data is doublebuffered. A 16-bit baudrate generator provides the SSCx with a separate serial clock signal. The serial channel SSCx has its own dedicated 16-bit baudrate generator with 16-bit reload capability, allowing baudrate generation independent from the timers. Table 39 lists some possible baudrates against the required reload values and the resulting bit times for the 40 MHz CPU clock. The maximum is limited to 8 Mbaud. Doc ID 12968 Rev 4 69/176 Serial channels Table 39. ST10F272M Synchronous baudrate and reload values (fCPU = 40 MHz) Baudrate 70/176 Bit time Reload value Reserved - 0000h Can be used only with fCPU = 32 MHz (or lower) - 0001h 6.6 Mbaud 150 ns 0002h 5 Mbaud 200 ns 0003h 2.5 Mbaud 400 ns 0007h 1 Mbaud 1 s 0013h 100 Kbaud 10 s 00C7h 10 Kbaud 100 s 07CFh 1 Kbaud 1 ms 4E1Fh 306 baud 3.26 ms FF4Eh Doc ID 12968 Rev 4 I2C interface ST10F272M 16 I2C interface The integrated I2C bus module handles the transmission and reception of frames over the two-line SDA/SCL in accordance with the I2C Bus specification. The I2C module can operate in slave mode, in master mode or in multi-master mode. It can receive and transmit data using 7-bit or 10-bit addressing. Data can be transferred at speeds up to 400 Kbit/s (both standard and fast I2C bus modes are supported). The module can generate three different types of interrupt: requests related to bus events, such as start or stop events, or arbitration lost requests related to data transmission requests related to data reception These requests are issued to the interrupt controller by three different lines, and identified as error, transmit, and receive interrupt lines. When the I2C module is enabled by setting bit XI2CEN in XPERCON register, pins P4.4 and P4.7 (where SCL and SDA are respectively mapped as alternate functions) are automatically configured as bidirectional open-drain: the value of the external pull-up resistor depends on the application. P4, DP4 and ODP4 cannot influence the pin configuration. When the I2C cell is disabled (clearing bit XI2CEN), P4.4 and P4.7 pins are standard I/ O controlled by P4, DP4 and ODP4. The speed of the I2C interface can be selected between standard mode (0 to 100 kHz) and fast I2C mode (100 to 400 kHz). Doc ID 12968 Rev 4 71/176 CAN modules 17 ST10F272M CAN modules The two integrated CAN modules (CAN1 and CAN2) are identical and handle the completely autonomous transmission and reception of CAN frames according to the CAN specification V2.0 part B (active). It is based on the C-CAN specification. Each on-chip CAN module can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers. Because of duplication of the CAN controllers, the following adjustments are to be considered: Same internal register addresses of both CAN controllers, but with base addresses differing in address bit A8; separate chip select for each CAN module. Refer to Chapter 4: Memory organization on page 21. The CAN1 transmit line (CAN1_TxD) is the alternate function of the Port P4.6 pin and the receive line (CAN1_RxD) is the alternate function of the Port P4.5 pin. The CAN2 transmit line (CAN2_TxD) is the alternate function of the Port P4.7 pin and the receive line (CAN2_RxD) is the alternate function of the Port P4.4 pin. Interrupt request lines of the CAN1 and CAN2 modules are connected to the XBUS interrupt lines together with other X-peripherals sharing the four vectors. The CAN modules must be selected with corresponding CANxEN bit of XPERCON register before the bit XPEN of SYSCON register is set. The reset default configuration is: CAN1 enabled, CAN2 disabled. Note: If one or both CAN modules is used, port 4 cannot be programmed to output all eight segment address lines. Thus, only four segment address lines can be used, reducing the external memory space to 5 Mbytes (1 Mbyte per CS line). 17.1 Configuration support It is possible that both CAN controllers are working on the same CAN bus, supporting together up to 64 message objects. In this configuration, both receive signals and both transmit signals are linked together when using the same CAN transceiver. This configuration is especially supported by providing open drain outputs for the CAN1_Txd and CAN2_TxD signals. The open drain function is controlled with the ODP4 register for port P4: in this way it is possible to connect together P4.4 with P4.5 (receive lines) and P4.6 with P4.7 (transmit lines configured to be configured as open-drain). The user may also internally map both CAN modules on the same pins P4.5 and P4.6. In this way, P4.4 and P4.7 can be used either as general purpose I/O lines, or used for I2C interface. This is possible by setting bit CANPAR of the XMISC register. To access this register it is necessary to set bit XMISCEN of the XPERCON register and bit XPEN of the SYSCON register. 17.2 CAN bus configurations Depending on the application, CAN bus configuration may be one single bus with a single or multiple interfaces or a multiple bus with a single or multiple interfaces. The ST10F272M can support both configurations. 72/176 Doc ID 12968 Rev 4 ST10F272M 17.2.1 CAN modules Single CAN bus The single CAN bus multiple interfaces configuration may be implemented using two CAN transceivers as shown in Figure 13. Figure 13. Connection to single CAN bus via separate CAN transceivers ;0,6&&$13$5 &$1 5; &$1 7; 3 5; 3 7; 3 &$1 WUDQVFHLYHU 3 &$1 WUDQVFHLYHU &$1B+ &$1EXV &$1B/ *$3*5, The ST10F272M also supports single CAN bus multiple (dual) interfaces using the open drain option of the CANx_TxD output as shown in Figure 14. Thanks to the OR-wired connection, only one transceiver is required. In this case the design of the application must take in account the wire length and the noise environment. Figure 14. Connection to single CAN bus via common CAN transceivers ;0,6&&$13$5 &$1 5; &$1 7; 5; 7; 9 3 3 2' N: 3 3 2' &$1 WUDQVFHLYHU &$1B+ &$1EXV &$1B/ 2' 2SHQGUDLQRXWSXW *$3*5, Doc ID 12968 Rev 4 73/176 CAN modules 17.2.2 ST10F272M Multiple CAN bus The ST10F272M provides two CAN interfaces to support the kind of bus configuration in Figure 15. Figure 15. Connection to two different CAN buses (example, gateway application) ;0,6&&$13$5 &$1 5; &$1 7; 3 5; 3 7; 3 &$1 WUDQVFHLYHU 3 &$1 WUDQVFHLYHU &$1B+ &$1B+ &$1B/ &$1B/ &$1EXV &$1EXV *$3*5, 17.2.3 Parallel mode In addition to previous configurations, a parallel mode is supported. This is shown in Figure 16. Figure 16. Connection to one CAN bus with internal parallel mode enabled &$1 5; ;0,6&&$13$5 %RWK&$1HQDEOHG &$1 7; 3 5; 3 7; 3 3 &$1 WUDQVFHLYHU &$1B+ &$1EXV &$1B/ *$3*5, 1. P4.4 and P4.7 when not used as CAN functions can be used as general purpose I/O while they cannot be used as external bus address lines. 74/176 Doc ID 12968 Rev 4 ST10F272M 18 Real-time clock Real-time clock The real-time clock is an independent timer, in which the clock is derived directly from the clock oscillator on XTAL1 (main oscillator) input or XTAL3 input (32 kHz low-power oscillator) so that it can continue running even in Idle or power-down modes (if so enabled). Registers access is implemented onto the XBUS. This module is designed with the following characteristics: Generation of the current time and date for the system Cyclic time based interrupt, on port2 external interrupts every `RTC basic clock tick' and after n 'RTC basic clock ticks' (n is programmable) if enabled 58-bit timer for long term measurement Capability to exit the ST10 chip from power-down mode (if PWDCFG of SYSCON set) after a programmed delay The real-time clock is based on two main blocks of counters. The first block is a prescaler which generates a basic reference clock (for example, a 1 second period). This basic reference clock is provided by the 20-bit divider. This 20-bit counter is driven by an input clock derived from the on-chip CPU clock, predivided by a 1/64 fixed counter. This 20-bit counter is loaded at each basic reference clock period with the value of the 20-bit prescaler register. The value of the 20-bit RTCP register determines the period of the basic reference clock. A timed interrupt request (RTCSI) may be sent on each basic reference clock period. The second block of the RTC is a 32-bit counter that may be initialized with the current system time. This counter is driven with the basic reference clock signal. In order to provide an alarm function the contents of the counter is compared with a 32-bit alarm register. The alarm register may be loaded with a reference date. An alarm interrupt request (RTCAI), may be generated when the value of the counter matches the alarm register. The timed RTCSI and the alarm RTCAI interrupt requests can trigger a fast external interrupt via the EXISEL register of port 2 and wake up the ST10 chip when running powerdown mode. Using the RTCOFF bit of the RTCCON register, the user may switch off the clock oscillator when entering the power-down mode. The last function implemented in the RTC is to switch off the main on-chip oscillator and the 32 kHz on chip oscillator if the ST10 enters the power-down mode, so that the chip can be fully switched off (if RTC is disabled). At power-on, and after reset phase, if the presence of a 32 kHz oscillation on XTAL3/XTAL4 pins is detected, then the RTC counter is driven by this low frequency reference clock: when Power-down mode is entered, the RTC can either be stopped or left running, and in both the cases the main oscillator is turned off, reducing the power consumption of the device to the minimum required to keep on running the RTC counter and relative reference oscillator. This is also valid if stand-by mode is entered (switching off the main supply VDD), since both the RTC and the low power oscillator (32 kHz) are biased by the VSTBY. Vice versa, when at power on and after Reset, the 32 kHz is not present, the main oscillator drives the RTC counter, and since it is powered by the main power supply, it cannot be maintained running in stand-by mode, while in power-down mode the main oscillator is maintained running to provide the reference to the RTC module (if not disabled). Doc ID 12968 Rev 4 75/176 Watchdog timer 19 ST10F272M Watchdog timer The watchdog timer is a fail-safe mechanism which prevents the microcontroller from malfunctioning for long periods of time. The watchdog timer is always enabled after a reset of the chip and can only be disabled in the time interval until the EINIT (end of initialization) instruction has been executed. Therefore, the chip start-up procedure is always monitored. The software must be designed to service the watchdog timer before it overflows. If, due to hardware or software related failures, the software fails to do so, the watchdog timer overflows and generates an internal hardware reset. It pulls the RSTOUT pin low in order to allow external hardware components to be reset. Each of the different reset sources is indicated in the WDTCON register: Watchdog timer reset in case of an overflow Software reset in case of execution of the SRST instruction Short, long and power-on reset in case of hardware reset (and depending of reset pulse duration and RPD pin configuration) The indicated bits are cleared with the EINIT instruction. The source of the reset can be identified during the initialization phase. The watchdog timer is 16-bit, clocked with the system clock divided by 2 or 128. The high byte of the watchdog timer register can be set to a prespecified reload value (stored in WDTREL). Each time it is serviced by the application software, the high byte of the watchdog timer is reloaded. For security, rewrite WDTCON each time before the watchdog timer is serviced Table 40 shows the watchdog time range for 40 MHz CPU clock. Table 40. WDTREL reload value (fCPU = 40 MHz) Reload value in WDTREL 76/176 Prescaler for fCPU = 40 MHz 2 (WDTIN = `0') 128 (WDTIN = `1') FFh 12.8 s 819.2 s 00h 3.277 ms 209.7 ms Doc ID 12968 Rev 4 ST10F272M 20 System reset System reset System reset initializes the MCU in a predefined state. There are six ways to activate a reset state. The system start-up configuration is different for each case as shown in Table 41. Table 41. Reset event definition Reset source Power-on reset Flag RPD status PONR Low Power-on Low tRSTIN >(1) High tRSTIN > (1032 + 12) TCL + max(4 TCL, 500ns)(2) tRSTIN > max(4 TCL, 500ns)(2) tRSTIN < (1032 + 12) TCL + max(4 TCL, 500ns)(2) Asynchronous hardware reset Synchronous long hardware reset LHWR Conditions Synchronous short hardware reset SHWR High Watchdog timer reset WDTR (3) WDT overflow SWR (3) SRST instruction execution Software reset 1. RSTIN pulse should be longer than 500 ns (filter) and than settling time for configuration of Port0. 2. See next Section 20.1 for more details on minimum reset pulse duration. 3. The RPD status has no influence unless bidirectional reset is activated (bit BDRSTEN in SYSCON): RPD low inhibits the bidirectional reset on SW and WDT reset events, that is RSTIN is not activated (refer to Sections 20.4, 20.5 and 20.6). The figures in the upcoming sections 20.2, 20.3, 20.5 and 20.6 use the following terminology: 20.1 Transparent: Level of the pin affects the internal reset logic Not transparent: Level of the pin does not affect internal logic Input filter On the RSTIN input pin an on-chip RC filter is implemented. It is sized to filter all spikes shorter than 50ns. On the other hand, a valid pulse longer than 500 ns is required for the ST10 to recognize a reset command. In between 50 ns and 500 ns a pulse can either be filtered or recognized as valid, depending on the operating conditions and process variations. For this reason all minimum durations mentioned in this chapter for the different kinds of reset events must be carefully evaluated, taking into account the above requirements. In particular, for short hardware reset, where only 4 TCL is specified as minimum input reset pulse duration, the operating frequency is a key factor. Examples: For a CPU clock of 40 MHz, 4 TCL is 50 ns, so it would be filtered. In this case the minimum becomes the one imposed by the filter (that is 500 ns). For a CPU clock of 4 MHz, 4 TCL is 500 ns. In this case the minimum from the formula is coherent with the limit imposed by the filter. Doc ID 12968 Rev 4 77/176 System reset 20.2 ST10F272M Asynchronous reset An asynchronous reset is triggered when RSTIN pin is pulled low while RPD pin is at low level. Then the ST10F272M is immediately (after the input filter delay) forced in reset default state. It pulls low RSTOUT pin, it cancels pending internal hold states if any, it aborts all internal/external bus cycles, it switches buses (data, address and control signals) and I/O pin drivers to high-impedance, it pulls high port0 pins. Note: If an asynchronous reset occurs during a read or write phase in internal memories, the content of the memory itself could be corrupted: to avoid this, synchronous reset usage is strongly recommended. Power-on reset The asynchronous reset must be used during the power-on of the device. Depending on crystal or resonator frequency, the on-chip oscillator needs about 1ms to 10 ms to stabilize (refer to Section 24: Electrical characteristics), with an already stable VDD. The logic of the ST10F272M does not need a stabilized clock signal to detect an asynchronous reset, so it is suitable for power-on conditions. To ensure a proper reset sequence, the RSTIN pin and the RPD pin must be held at low level until the device clock signal is stabilized and the system configuration value on port0 is settled. At power-on it is important to respect some additional constraints introduced by the start-up phase of the different embedded modules. In particular, the on-chip voltage regulator needs at least 1ms to stabilize the internal 1.8 V for the core logic: This time is computed from when the external reference (VDD) becomes stable (inside specification range, that is, at least 4.5 V). This is a constraint for the application hardware (external voltage regulator): The RSTIN pin assertion has to be extended to guarantee the voltage regulator stabilization. A second constraint is imposed by the embedded Flash. When booting from internal memory, starting from RSTIN releasing, it needs a maximum of 1ms for its initialization: before that, the internal reset (RST signal) is not released, so the CPU does not start code execution in internal memory. Note: This is not true if external memory is used (pin EA held low during reset phase). In this case, once the RSTIN pin is released, and after a few CPU clock cycles (Filter delay plus 3...8 TCL), the internal reset signal RST is released as well, so the code execution can start immediately after. Obviously, an eventual access to the data in internal Flash is forbidden before its initialization phase is completed: An eventual access during starting phase will return FFFFh (just at the beginning), while later 009Bh (an illegal opcode trap can be generated). At power-on, the RSTIN pin must be tied low for a minimum time that also includes the startup time of the main oscillator (tSTUP = 1ms for resonator, 10ms for crystal) and PLL synchronization time (tPSUP = 200 s): This means if the internal Flash is used, the RSTIN pin could be released before the main oscillator and PLL are stable to recover some time in the start-up phase (Flash initialization only needs stable V18, but does not need stable system clock since an internal dedicated oscillator is used). 78/176 Doc ID 12968 Rev 4 ST10F272M System reset Warning: It is recommended to provide the external hardware with a current limitation circuitry. This is necessary to avoid permanent damage of the device during the power-on transient, when the capacitance on V18 pin is charged. For the on-chip voltage regulator functionality 10nF is sufficient: In any case, a maximum of 100 nF on V18 pin should not generate problems of over-current (higher value is allowed if current is limited by the external hardware). External current limitation is nevertheless also recommended to avoid risks of damage in case of a temporary short between V18 and ground: The internal 1.8 V drivers are sized to drive currents of several tens of Amps, so the current must be limited by the external hardware. The limit of current is imposed by power dissipation considerations (refer to Section 24: Electrical characteristics). In figures 17 and 18 below, asynchronous power-on timing diagrams are shown, with boot from internal or external memory respectively, highlighting the reset phase extension introduced by the embedded Flash module when selected. Caution: Never power the device without keeping the RSTIN pin grounded: The device could enter into unpredictable states, risking also permanent damage. Doc ID 12968 Rev 4 79/176 System reset ST10F272M Figure 17. Asynchronous power-on reset (EA = 1) dPV IRUUHVRQDWRURVFLOODWLRQ3//VWDELOL]DWLRQ dPV IRUFU\VWDORVFLOODWLRQ3//VWDELOL]DWLRQ tPV IRURQFKLS95(*VWDELOL]DWLRQ d7&/ 9'' 9 ;7$/ 53' 567,1 tQV dQV 567) DIWHUILOWHU 7&/ 1RWW 3>@ 7UDQVSDUHQW 3>@ 7UDQVSDUHQW 1RWW 3>@ 1RWWUDQVSDUHQW 1RWW 1RWW 7&/ ,%86&6 ,QWHUQDO d PV )/$567 567 /DWFKLQJSRLQWRISRUWIRU V\VWHPVWDUWXSFRQILJXUDWLRQ *$3*5, 80/176 Doc ID 12968 Rev 4 ST10F272M System reset Figure 18. Asynchronous power-on reset (EA = 0) tPV IRUUHVRQDWRURVFLOODWLRQ3//VWDELOL]DWLRQ tPV IRUFU\VWDORVFLOODWLRQ3//VWDELOL]DWLRQ tPV IRURQFKLS95(*VWDELOL]DWLRQ 7&/ 9'' 9 ;7$/ 53' tQV dQV 567,1 567) DIWHUILOWHU 7&/ 3>@ 7UDQVSDUHQW 1RWW 3>@ 7UDQVSDUHQW 1RWW 3>@ 1RWWUDQVSDUHQW 1RWW 7&/ $/( 567 /DWFKLQJSRLQWRISRUWIRU V\VWHPVWDUWXSFRQILJXUDWLRQ *$3*5, 1. 3 to 8 TCL depending on clock source selection Hardware reset The asynchronous reset must be used to recover from catastrophic situations of the application. It may be triggered by the hardware of the application. Internal hardware logic and application circuitry are described in the reset circuitry chapter and in figures 30, 31 and 32. It occurs when RSTIN is low and RPD is detected (or becomes) low as well. Doc ID 12968 Rev 4 81/176 System reset ST10F272M Figure 19. Asynchronous hardware reset (EA = 1) 53' d 7&/ tQV dQV 567,1 tQV dQV 567) DIWHUILOWHU 7&/ 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 1RWW 1RWWUDQVSDUHQW 1RWW 3>@ 1RWW 1RWW 7&/ ,%86&6 LQWHUQDO d PV )/$567 567 /DWFKLQJSRLQWRISRUWIRU V\VWHPVWDUWXSFRQILJXUDWLRQ *$3*5, 1. Longer than port0 settling time + PLL synchronization (if needed, that is P0(15:13) changed). Longer than 500 ns to take account of input filter on RSTIN pin. 82/176 Doc ID 12968 Rev 4 ST10F272M System reset Figure 20. Asynchronous hardware reset (EA = 0) 53' 7&/ tQV dQV 567,1 tQV dQV 567) DIWHUILOWHU 7&/ 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 1RWW 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 1RWW 1RWWUDQVSDUHQW 1RWW 3>@ 7&/ $/( 567 /DWFKLQJSRLQWRISRUWIRU V\VWHPVWDUWXSFRQILJXUDWLRQ *$3*5, 1. Longer than port0 settling time + PLL synchronization (if needed, that is P0(15:13) changed). Longer than 500 ns to take account input filter on RSTIN pin. 2. 3 to 8 TCL depending on clock source selection. Exit from asynchronous reset state When the RSTIN pin is pulled high, the device restarts: As already mentioned, if internal Flash is used, the restarting occurs after the embedded Flash initialization routine is completed. The system configuration is latched from Port0: ALE, RD and WR/WRL pins are driven to their inactive level. The ST10F272M starts program execution from memory location 00'0000h in code segment 0. This starting location will typically point to the general initialization routine. The timings of asynchronous hardware reset sequence are summarized in Figure 19 and Figure 20. 20.3 Synchronous reset (warm reset) A synchronous reset is triggered when RSTIN pin is pulled low while RPD pin is at high level. In order to properly activate the internal reset logic of the device, the RSTIN pin must be held low, at least, during 4 TCL (two periods of CPU clock): Refer also to Section 20.1 for details on minimum reset pulse duration. The I/O pins are set to high impedance and RSTOUT pin is driven low. After RSTIN level is detected, a short duration of a maximum of 12 TCL (six periods of CPU clock) elapses, during which pending internal hold states are cancelled and the current internal access cycle if any is completed. External bus cycle is aborted. The internal pull-down of RSTIN pin is activated if bit BDRSTEN of SYSCON register was previously set by software. Note that this bit is always cleared on power-on or after a reset sequence. Doc ID 12968 Rev 4 83/176 System reset ST10F272M Short and long synchronous reset Once the first maximum 16 TCL are elapsed (4+12 TCL), the internal reset sequence starts. It is 1024 TCL cycles long. At the end of it, and after another 8 TCL the level of RSTIN is sampled (after the filter, see RSTF in the drawings). If it is already at high level, only a short reset is flagged (refer to Chapter 19 for details on reset flags). If it is still low, a long reset is flagged as well. The major difference between long and short resets is that during the long reset, P0(15:13) becomes transparent, so it is possible to change the clock options. Warning: In case of a short pulse on RSTIN pin, and when bidirectional reset is enabled, the RSTIN pin is held low by the internal circuitry. At the end of the 1024 TCL cycles, the RTSIN pin is released, but due to the presence of the input analog filter the internal input reset signal (RSTF in the drawings) is released later (from 50 to 500 ns). This delay is in parallel with the additional 8 TCL, at the end of which the internal input reset line (RSTF) is sampled, to decide if the reset event is short or long. If 8 TCL > 500 ns (fCPU < 8 MHz), the reset event is always recognized as short If 8 TCL < 500 ns (fCPU > 8 MHz), the reset event could be recognized either as short or long, depending on the real filter delay (between 50 and 500 ns) and the CPU frequency (RSTF sampled high means short reset, RSTF sampled low means long reset). Note that in case a long reset is recognized, once the 8 TCL are elapsed, the P0(15:13) pins becomes transparent, so the system clock can be reconfigured. The port returns not transparent 3-4 TCL after the internal RSTF signal becomes high. The same behavior just described, occurs also when unidirectional reset is selected and RSTIN pin is held low till the end of the internal sequence (exactly 1024 TCL + max 16 TCL) and released exactly at that time. Note: When running with CPU frequency lower than 40 MHz, the minimum valid reset pulse to be recognized by the CPU (4 TCL) could be longer than the minimum analog filter delay (50 ns); so it might happen that a short reset pulse is not filtered by the analog input filter, but on the other hand it is not long enough to trigger a CPU reset (shorter than 4 TCL): this would generate a Flash reset but not a system reset. In this condition, the Flash answers always with FFFFh, which leads to an illegal opcode and consequently a trap event is generated. Exit from synchronous reset state The reset sequence is extended until the RSTIN level becomes high. Moreover, it is internally prolonged by the Flash initialization when EA = 1 (internal memory selected). Then, the code execution restarts. The system configuration is latched from port0, and ALE, RD and WR/WRL pins are driven to their inactive level. The ST10F272M starts program execution from memory location 00'0000h in code segment 0. This starting location will typically point to the general initialization routine. Timing of synchronous reset sequence are summarized in figures 21 and 22 where a short reset event is shown, with particular emphasis on the fact that it can degenerate into long reset. The two figures show the behavior when booting from internal or external memory respectively. Figures 23 and 24 report the timing of a typical synchronous long reset, again when booting from internal or external memory. 84/176 Doc ID 12968 Rev 4 ST10F272M System reset Synchronous reset and RPD pin Whenever the RSTIN pin is pulled low (by external hardware or as a consequence of a Bidirectional reset), the RPD internal weak pull-down is activated. The external capacitance (if any) on RPD pin is slowly discharged through the internal weak pull-down. If the voltage level on RPD pin reaches the input low threshold (approximately 2.5 V), the reset event becomes immediately asynchronous. In case of hardware reset (short or long) the situation goes immediately to the one illustrated in Figure 19. There is no effect if RPD comes again above the input threshold: the asynchronous reset is completed coherently. To correctly complete a synchronous reset, the value of the capacitance must be big enough to maintain a sufficiently high voltage on the RPD pin for the duration of the internal reset sequence. For a software or watchdog reset events, an active synchronous reset is completed regardless of the RPD status. It is important to highlight that the signal that makes RPD status transparent under reset is the internal RSTF (after the noise filter). Figure 21. Synchronous short/long hardware reset (EA = 1) d7&/ d7&/ 567,1 7&/ tQV dQV tQV dQV tQV dQV d7&/ 567) DIWHUILOWHU 3>@ 3>@ 1RWWUDQVSDUHQW 1RWW 3>@ 7UDQVSDUHQW 1RWW 1RWWUDQVSDUHQW 1RWW 7&/ ,%86&6 ,QWHUQDO d PV )/$567 7&/ 7&/ 567 $WWKLVWLPH567)LVVDPSOHG+,*+RU/2: VRLWLV6+257RU/21*UHVHW 567287 53' $GLVFKDUJH 953'!9DV\QFKURQRXVUHVHWQRWHQWHUHG *$3*5, 1. RSTIN assertion can be released there. Refer also to Section 21.1 for details on minimum pulse duration. 2. If during the reset condition (RSTIN low), RPD voltage drops below the threshold voltage (about 2.5V for 5V operation), the asynchronous reset is then immediately entered. 3. RSTIN pin is pulled low if bit BDRSTEN (bit 3 of SYSCON register) was previously set by software. Bit Doc ID 12968 Rev 4 85/176 System reset ST10F272M BDRSTEN is cleared after reset. 4. Minimum RSTIN low pulse duration shall also be longer than 500ns to guarantee the pulse is not masked by the internal filter (refer to Section 21.1) Figure 22. Synchronous short/long hardware reset (EA = 0) d7&/ d7&/ 567,1 7&/ tQV dQV tQV dQV tQV dQV 567) DIWHUILOWHU 3>@ 3>@ 1RWWUDQVSDUHQW 1RWW 3>@ 7UDQVSDUHQW 1RWW 1RWWUDQVSDUHQW 1RWW 7&/ 7&/ $/( 7&/ 7&/ 567 $WWKLVWLPH567)LVVDPSOHG+,*+RU/2: VRLWLV6+257RU/21*UHVHW 567287 53' $GLVFKDUJH 953'!9DV\QFKURQRXVUHVHWQRWHQWHUHG *$3*5, 1. RSTIN assertion can be released there. Refer also to Section 21.1 for details on minimum pulse duration. 2. If during the reset condition (RSTIN low), RPD voltage drops below the threshold voltage (about 2.5V for 5V operation), the asynchronous reset is then immediately entered. 3. 3 to 8 TCL depending on clock source selection. 4. RSTIN pin is pulled low if bit BDRSTEN (bit 3 of SYSCON register) was previously set by software. Bit BDRSTEN is cleared after reset. 5. Minimum RSTIN low pulse duration shall also be longer than 500ns to guarantee the pulse is not masked by the internal filter (refer to Section 21.1). 86/176 Doc ID 12968 Rev 4 ST10F272M System reset Figure 23. Synchronous long hardware reset (EA = 1) d7&/ d7&/ 7&/ 567,1 tQV dQV tQV dQV tQV dQV 567) DIWHUILOWHU 3>@ 3>@ d 7&/ 7&/ 7UDQVSDUHQW 1RWWUDQVSDUHQW 1RWW 3>@ 1RWW 7UDQVSDUHQW 1RWW 1RWWUDQVSDUHQW 1RWW 7&/ ,%86&6 ,QWHUQDO d PV )/$567 7&/ 567 $WWKLVWLPH567)LVVDPSOHG/2: VRLWLVGHILQLWHO\/21*UHVHW 567287 53' $GLVFKDUJH 953'!9DV\QFKURQRXVUHVHWQRWHQWHUHG *$3*5, 1. If during the reset condition (RSTIN low), RPD voltage drops below the threshold voltage (about 2.5 V for 5V operation), the asynchronous reset is then immediately entered. Even if RPD returns above the threshold,the reset is defnitively taken as asynchronous. 2. Minimum RSTIN low pulse duration shall also be longer than 500 ns to guarantee the pulse is not masked by theinternal filter (refer to Section 21.1). Doc ID 12968 Rev 4 87/176 System reset ST10F272M Figure 24. Synchronous long hardware reset (EA = 0) 7&/ 7&/ 7&/ 567,1 tQV dQV tQV dQV tQV dQV 567) DIWHUILOWHU 7&/ 3>@ 1RWWUDQVSDUHQW 3>@ 1RWW 7UDQVSDUHQW 7UDQVSDUHQW 3>@ 1RWW 1RWW 1RWWUDQVSDUHQW 7&/ 7&/ $/( 7&/ 567 $WWKLVWLPH567)LVVDPSOHG/2: VRLWLV/21*UHVHW 567287 53' $GLVFKDUJH 953'!9DV\QFKURQRXVUHVHWQRWHQWHUHG *$3*5, 1. If during the reset condition (RSTIN low), RPD voltage drops below the threshold voltage (about 2.5 V for 5 V operation), the asynchronous reset is then immediately entered. 2. Minimum RSTIN low pulse duration shall also be longer than 500 ns to guarantee the pulse is not masked by theinternal filter (refer to Section 21.1). 3. 3 to 8 TCL depending on clock source selection. 20.4 Software reset A software reset sequence can be triggered at any time by the protected SRST (software reset) instruction. This instruction can be deliberately executed within a program, for example, to leave bootstrap loader mode, or on a hardware trap that reveals system failure. On execution of the SRST instruction, the internal reset sequence is started. The microcontroller behavior is the same as for a synchronous short reset, except that only bits P0.12...P0.8 are latched at the end of the reset sequence, while previously latched, bits P0.7...P0.2 are cleared (that is written at `1'). A software reset is always taken as synchronous: there is no influence on Software Reset behavior with RPD status. In case Bidirectional Reset is selected, a Software Reset event pulls RSTIN pin low: this occurs only if RPD is high; if RPD is low, RSTIN pin is not pulled low even though Bidirectional Reset is selected. Refer to the figures Figure 25 and Figure 26 for unidirectional SW reset timing, and to figures Figure 27, Figure 28 and Figure 29 for bidirectional. 88/176 Doc ID 12968 Rev 4 ST10F272M 20.5 System reset Watchdog timer reset When the watchdog timer is not disabled during the initialization, or serviced regularly during program execution, it will overflow and trigger the reset sequence. Unlike hardware and software resets, the watchdog reset completes a running external bus cycle if this bus cycle either does not use READY, or if READY is sampled active (low) after the programmed wait states. When READY is sampled inactive (high) after the programmed wait states the running external bus cycle is aborted. Then the internal reset sequence is started. Bit P0.12...P0.8 are latched at the end of the reset sequence and bit P0.7...P0.2 are cleared (that is written at `1'). A Watchdog reset is always taken as synchronous: there is no influence on watchdog reset behavior with RPD status. In case bidirectional reset is selected, a watchdog reset event pulls RSTIN pin low: this occurs only if RPD is high; if RPD is low, RSTIN pin is not pulled low even though bidirectional reset is selected. Refer to figures Figure 25 and Figure 26 for unidirectional SW reset timing, and to figures Figure 27, Figure 28 and Figure 29 for bidirectional. Figure 25. SW/WDT unidirectional reset (EA = 1) 567, 1 d7&/ 3>@ 1RWWUDQVSDUHQW 1RWW 7UDQVSDUHQW 3>@ 3>@ 1RWWUDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 1RWW 7&/ ,%86&6 LQWHUQDO d PV )/$56 7 7&/ 567 567287 *$3*5, Doc ID 12968 Rev 4 89/176 System reset ST10F272M Figure 26. SW/WDT unidirectional reset (EA = 0) 567,1 3>@ 1RWWUDQVSDUHQW 3>@ 7UDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 1RWW 1RWW 7&/ $/( 7&/ 567 567287 *$3*5, 20.6 Bidirectional reset As shown in the previous sections, the RSTOUT pin is driven active (low level) at the beginning of any reset sequence (synchronous/asynchronous hardware, software and watchdog timer resets). RSTOUT pin stays active low beyond the end of the initialization routine, until the protected EINIT instruction (end of initialization) is completed. The bidirectional reset function is useful when external devices require a reset signal but cannot be connected to RSTOUT pin, because RSTOUT signal lasts during initialization. It is, for instance, the case of external memory running initialization routine before the execution of EINIT instruction. Bidirectional reset function is enabled by setting bit 3 (BDRSTEN) in SYSCON register. It only can be enabled during the initialization routine, before EINIT instruction is completed. When enabled, the open drain of the RSTIN pin is activated, pulling down the reset signal, for the duration of the internal reset sequence (synchronous/asynchronous hardware, synchronous software and synchronous watchdog timer resets). At the end of the internal reset sequence the pull down is released and: 90/176 After a short synchronous bidirectional hardware reset, if RSTF is sampled low eight TCL periods after the internal reset sequence completion (refer to Figure 21 and Figure 22), the short reset becomes a long reset. On the contrary, if RSTF is sampled high the device simply exits reset state. After a software or watchdog bidirectional reset, the device exits from reset. If RSTF remains still low for at least four TCL periods (minimum time to recognize a short hardware reset) after the reset exiting (refer to Figure 27 and Figure 28), the software Doc ID 12968 Rev 4 ST10F272M System reset or watchdog reset become a short hardware reset. On the contrary, if RSTF remains low for less than 4 TCL, the device simply exits reset state. The bidirectional reset is not effective in case RPD is held low, when a software or watchdog reset event occurs. On the contrary, if a software or watchdog bidirectional reset event is active and RPD becomes low, the RSTIN pin is immediately released, while the internal reset sequence is completed regardless of RPD status change (1024 TCL). Note: The bidirectional reset function is disabled by any reset sequence (bit BDRSTEN of SYSCON is cleared). To be activated again it must be enabled during the initialization routine. WDTCON flags Similar to what is highlighted in the previous section, when discussing short reset and the degeneration into long reset, comparable situations may occur when bidirectional reset is enabled. The presence of the internal filter on RSTIN pin introduces a delay: When RSTIN is released, the internal signal after the filter (see RSTF in the drawings) is delayed, so it remains still active (low) for a while. It means that depending on the internal clock speed, a short reset may be recognized as a long reset: The WDTCON flags are set accordingly. Moreover, when either software or watchdog bidirectional reset events occur, when the RSTIN pin is released (at the end of the internal reset sequence), the RSTF internal signal (after the filter) remains low for a while, and depending on the clock frequency it is recognized high or low: 8TCL after the completion of the internal sequence, the level of RSTF signal is sampled, and if recognized still low a hardware reset sequence starts, and WDTCON will flag this last event, masking the previous one (software or watchdog reset). Typically, a short hardware reset is recognized, unless the RSTIN pin (and consequently internal signal RSTF) is sufficiently held low by the external hardware to inject a long hardware reset. After this occurrence, the initialization routine is not able to recognize a software or watchdog bidirectional reset event, since a different source is flagged inside WDTCON register. This phenomenon does not occur when internal Flash is selected during reset (EA = 1), since the initialization of the Flash itself extend the internal reset duration well beyond the filter delay. Figures Figure 27, Figure 28 and Figure 29 summarize the timing for software and watchdog timer bidirectional reset events: In particular Figure 29 shows the degeneration into hardware reset. Doc ID 12968 Rev 4 91/176 System reset ST10F272M Figure 27. SW/WDT bidirectional reset (EA = 1) 567,1 tQV dQV tQV dQV 567) DIWHUILOWHU 3>@ 1RWWUDQVSDUHQW 3>@ 7UDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 1RWW 1RWW d7&/ 7&/ ,%86&6 LQWHUQDO d PV )/$567 7&/ 567 567287 *$3*5, 92/176 Doc ID 12968 Rev 4 ST10F272M System reset Figure 28. SW/WDT bidirectional reset (EA = 0) 567, 1 tQV dQV tQV dQV 567) DIWHUILOWHU 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 3>@ 3>@ 1RWWUDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 1RWW 1RWW 7&/ $/( 7&/ 567 $WWKLVWLPH567)LVVDPSOHG+,*+ VR6:RU:'7UHVHWLVIODJJHGLQ:'7&21 567287 *$3*5, Figure 29. SW/WDT bidirectional reset (EA = 0) followed by a HW reset 567,1 tQV dQV tQV dQV 567) DIWHUILOWHU 3>@ 1RWWUDQVSDUHQW 3>@ 7UDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 3>@ 1RWWUDQVSDUHQW 1RWW 1RWW 7&/ $/( 7&/ 567 $WWKLVWLPH567)LVVDPSOHG/2: VR+:UHVHWLVHQWHUHG 567287 *$3*5, Doc ID 12968 Rev 4 93/176 System reset 20.7 ST10F272M Reset circuitry Internal reset circuitry is described in Figure 32. The RSTIN pin provides an internal pull-up resistor of 50 k to 250 k (The minimum reset time must be calculated using the lowest value). It also provides a programmable (BDRSTEN bit of SYSCON register) pull-down to output internal reset state signal (synchronous reset, watchdog timer reset or software reset). This bidirectional reset function is useful in applications where external devices require a reset signal but cannot be connected to RSTOUT pin. This is the case of an external memory running codes before EINIT (end of initialization) instruction is executed. RSTOUT pin is pulled high only when EINIT is executed. The RPD pin provides an internal weak pull-down resistor which discharges external capacitor at a typical rate of 200 A. If bit PWDCFG of SYSCON register is set, an internal pull-up resistor is activated at the end of the reset sequence. This pull-up will charge any capacitor connected on RPD pin. The simplest way to reset the ST10F272M is to insert a capacitor C1 between RSTIN pin and VSS, and a capacitor between RPD pin and VSS (C0) with a pull-up resistor R0 between RPD pin and VDD. The input RSTIN provides an internal pull-up device equalling a resistor of 50 k to 250 k (the minimum reset time must be determined by the lowest value). Select C1 that produce a sufficient discharge time to permit the internal or external oscillator and / or internal PLL and the on-chip voltage regulator to stabilize. To ensure correct power-up reset with controlled supply current consumption, specially if clock signal requires a long period of time to stabilize, an asynchronous hardware reset is required during power-up. For this reason, it is recommended to connect the external R0-C0 circuit shown in Figure 30 to the RPD pin. On power-up, the logical low level on RPD pin forces an asynchronous hardware reset when RSTIN is asserted low. The external pull-up R0 will then charge the capacitor C0. Note that an internal pull-down device on RPD pin is turned on when RSTIN pin is low, and causes the external capacitor (C0) to begin discharging at a typical rate of 100-200 A. With this mechanism, after power-up reset, short low pulses applied on RSTIN produce synchronous hardware reset. If RSTIN is asserted longer than the time needed for C0 to be discharged by the internal pull-down device, then the device is forced in an asynchronous reset. This mechanism insures recovery from catastrophic failure. 94/176 Doc ID 12968 Rev 4 ST10F272M System reset Figure 30. Minimum external reset circuitry 567287 567,1 ([WHUQDOKDUGZDUH & D +DUGZDUHUHVHW 9&& 5 E )RUSRZHUXSUHVHW DQGLQWHUUXSWLEOH SRZHUGRZQPRGH 53' & 67)0 *$3*5, The minimum reset circuit of Figure 30 is not adequate when the RSTIN pin is driven from the ST10F272M itself during software or watchdog triggered resets, because of the capacitor C1 that will keep the voltage on RSTIN pin above VIL after the end of the internal reset sequence, and thus will trigger an asynchronous reset sequence. Figure 31 shows an example of a reset circuit. In this example, R1-C1 external circuit is only used to generate power-up or manual reset, and R0-C0 circuit on RPD is used for power-up reset and to exit from power-down mode. Diode D1 creates a wired-OR gate connection to the reset pin and may be replaced by open-collector Schmitt trigger buffer. Diode D2 provides a faster cycle time for repetitive power-on resets. R2 is an optional pull-up for faster recovery and correct biasing of TTL open collector drivers. Doc ID 12968 Rev 4 95/176 System reset ST10F272M Figure 31. System reset circuit 9'' 9'' 5 ([WHUQDOKDUGZDUH 5 ' 567,1 9'' ' & ([WHUQDO UHVHWVRXUFH RG 5 2SHQGUDLQLQYHUWHU 53' & 67)0 *$3*5, Figure 32. Internal (simplified) reset circuitry (,1,7LQVWUXFWLRQ &OU 4 567287 6HW 5HVHWVWDWH PDFKLQH FORFN ,QWHUQDO UHVHW VLJQDO 9'' 6567LQVWUXFWLRQ ZDWFKGRJRYHUIORZ 7ULJJHU 567,1 &OU 5HVHWVHTXHQFH &38FORFNF\FOHV %'567(1 9'' $V\QFKURQRXV UHVHW 53' )URPWRH[LW 3RZHUGRZQ &LUFXLW :HDNSXOOGRZQ a$ *$3*5, 96/176 Doc ID 12968 Rev 4 ST10F272M 20.8 System reset Reset application examples The next two timing diagrams (Figure 33 and Figure 34) provide additional examples of bidirectional internal reset events (software and watchdog) including in particular the external capacitances charge and discharge transients (refer also to Figure 31 for the external circuit scheme). Figure 33. Example of software or watchdog bidirectional reset (EA = 1) 7&/ V PV &FKDUJH (,1,7 7&/ 567287 567,1 9,+ 9,/ 53' 7ILOWHU567 QV 7ILOWHU567 QV 567) LGHDO 9,/ 567 7&/ :'7&21>@ K &K K &K 7&/ 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 1RWWUDQVSDUHQW /DWFKLQJSRLQW 3>@ 1RWWUDQVSDUHQW 1RWWUDQVSDUHQW 7UDQVSDUHQW /DWFKLQJSRLQW 3>@ 7UDQVSDUHQW 1RWWUDQVSDUHQW 1RWWUDQVSDUHQW /DWFKLQJSRLQW 3>@ 1RWWUDQVSDUHQW 1RWWUDQVSDUHQW /DWFKLQJSRLQW *$3*5, Doc ID 12968 Rev 4 97/176 System reset ST10F272M Figure 34. Example of software or watchdog bidirectional reset (EA = 0) 7&/ V 7&/ PV &FKDUJH (,1,7 567287 567,1 9,+ 9,/ 7ILOWHU567 QV 567) LGHDO 53' 7ILOWHU567 QV 9,/ 567 7&/ :'7&21 >@ K &K K &K 7&/ 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 1RWWUDQVSDUHQW /DWFKLQJSRLQW 3>@ 1RWWUDQVSDUHQW 7UDQVSDUHQW 1RWWUDQVSDUHQW /DWFKLQJSRLQW 3>@ 7UDQVSDUHQW 1RWWUDQVSDUHQW 1RWWUDQVSDUHQW /DWFKLQJSRLQW 3>@ 1RWWUDQVSDUHQW 1RWWUDQVSDUHQW /DWFKLQJSRLQW *$3*5, 98/176 Doc ID 12968 Rev 4 ST10F272M 20.9 System reset Reset summary The following table summarizes the different reset events. LHWR SHWR SWR WDTR Short hardware reset (synchronous) (1) PONR Hardware reset (asynchronous) WDTCON flags Bidir Power-on reset RSTIN EA Event Synch. asynch. Reset event RPD Table 42. 0 0 1 ms (VREG) 1.2 ms N Asynch. (reson. + PLL) 10.2 ms (crystal + PLL) - 1 1 1 1 0 0 1 N Asynch. - 1 1 1 1 0 1 x x Forbidden x x Y - 0 0 N Asynch. 500 ns - 0 1 1 1 0 0 1 N Asynch. 500 ns - 0 1 1 1 0 0 0 Y Asynch. 500 ns - 0 1 1 1 0 0 1 Y Asynch. 500 ns - 0 1 1 1 0 1 0 N Synch. Max (4 TCL, 500 ns) 1032 + 12 TCL + max(4 TCL, 500 ns) 0 0 1 1 0 1 1 N Synch. max (4 TCL, 500 ns) 1032 + 12 TCL + max(4 TCL, 500 ns) 0 0 1 1 0 Max (4 TCL, 500 ns) 1032 + 12 TCL + max(4 TCL, 500 ns) 0 0 1 1 0 0 0 1 1 0 1 0 Y Min Max 1ms (VREG) Synch. Activated by internal logic for 1024 TCL Max (4 TCL, 500ns) 1 1 Y Synch. 1032 + 12 TCL + max(4 TCL, 500 ns) Activated by internal logic for 1024 TCL Long hardware reset (synchronous) 1 0 N Synch. 1032 + 12 TCL + Max(4 TCL, 500 ns) - 0 1 1 1 0 1 1 N Synch. 1032 + 12 TCL + Max(4 TCL, 500ns) - 0 1 1 1 0 0 Y 1032 + 12 TCL + Max(4 TCL, 500 ns) - 1 0 1 1 1 0 0 1 1 1 0 Synch. Activated by internal logic only for 1024 TCL 1 1 Y Synch. 1032 + 12 TCL + Max(4 TCL, 500 ns) - Activated by internal logic only for 1024 TCL Doc ID 12968 Rev 4 99/176 System reset Reset event (continued) LHWR SHWR SWR WDTR Synch. asynch. PONR Watchdog reset (2) Bidir Software reset (2) WDTCON flags EA Event RSTIN RPD Table 42. ST10F272M x 0 N Synch. Not activated 0 0 0 1 0 x 0 N Synch. Not activated 0 0 0 1 0 0 1 Y Synch. Not activated 0 0 0 1 0 1 1 Y Synch. Activated by internal logic for 1024 TCL 0 0 0 1 0 x 0 N Synch. Not activated 0 0 0 1 1 x 0 N Synch. Not activated 0 0 0 1 1 0 1 Y Synch. Not activated 0 0 0 1 1 1 1 Y Synch. Activated by internal logic for 1024 TCL 0 0 0 1 1 Min Max 1. It can degenerate into a long hardware reset and consequently differently flagged (see Section 20.3 for details). 2. When bidirectional is active (and with RPD = 0), it can be followed by a short hardware reset and consequently differently flagged (see Section 20.6 for details). The start-up configurations and some system features are selected on reset sequences as described in Table 43 and Figure 35. Table 43 describes the system configuration latched on port0 in the six different reset modes. Figure 35 summarizes the state of bits of PORT0 latched in RP0H, SYSCON, BUSCON0 registers. Table 43. PORT0 latched configuration for the different reset events BSL Reserved Reserved Adapt mode Emu mode P0H.4 P0H.3 P0H.2 P0H.1 P0H.0 WR configuration Reserved P0H.5 P0L.7 P0L.6 P0L.5 P0L.4 P0L.3 P0L.2 P0L.1 P0L.0 - - - X X X X X X X - - - - - - Watchdog reset - - - X X X X X X X - - - - - - Synchronous short hardware reset - - - X X X X X X X X X X X X X Synchronous long hardware reset X X X X X X X X X X X X X X X X Asynchronous hardware reset X X X X X X X X X X X X X X X X Asynchronous power-on reset X X X X X X X X X X X X X X X X Sample event 100/176 Chip selects Segment address lines X: Pin is sampled -: Pin is not sampled Doc ID 12968 Rev 4 Bus type P0H.6 Software reset Clock options P0H.7 Port0 ST10F272M System reset Figure 35. Port0 bits latched into the different registers after reset 3RUW + + + + + + + + &/.&)* 6$/6(/ &66(/ :5& &/.&)* 6$/6(/ &66(/ :5& &ORFN JHQHUDWRU 3RUW ORJLF 3RUW ORJLF / / / %867<3 / / %6/ / 5HV / / $'3 (08 53+ %RRWVWUDSORDGHU ,QWHUQDOFRQWUROORJLF ($967%< 3/ 3/ 6<6&21 520(1 %<7',6 %86&21 %86 $&7 :5&)* $/( &7/ %7<3 *$3*5, Doc ID 12968 Rev 4 101/176 Power reduction modes 21 ST10F272M Power reduction modes Three different power reduction modes with different levels of power reduction have been implemented in the ST10F272M. In idle mode only CPU is stopped, while peripheral still operates. In power-down mode both CPU and peripherals are stopped. In stand-by mode the main power supply (VDD) can be turned off while a portion of the internal RAM remains powered via VSTBY dedicated power pin. Idle and power-down modes are software activated by a protected instruction and are terminated in different ways as described in the following sections. Stand-by mode is entered simply removing VDD, holding the MCU under reset state. Note: All external bus actions are completed before idle or power-down mode is entered. However, idle or power-down mode is not entered if READY is enabled, but has not been activated (driven low for negative polarity, or driven high for positive polarity) during the last bus access. 21.1 Idle mode Idle mode is entered by running IDLE protected instruction. The CPU operation is stopped and the peripherals still run. Idle mode is terminated by any interrupt request. Whatever the interrupt is serviced or not, the instruction following the IDLE instruction will be executed after return from interrupt (RETI) instruction, then the CPU resumes the normal program. 21.2 Power-down mode Power-down mode starts by running PWRDN protected instruction. Internal clock is stopped, all MCU parts are on hold including the watchdog timer. The only exception could be the real-time clock if opportunely programmed and one of the two oscillator circuits as a consequence (either the main or the 32 kHz on-chip oscillator). When real-time clock module is used, when the device is in power-down mode a reference clock is needed. In this case, two possible configurations may be selected by the user application according to the desired level of power reduction: A 32 kHz crystal is connected to the on-chip low-power oscillator (pins XTAL3 / XTAL4) and running. In this case the main oscillator is stopped when power-down mode is entered, while the real-time clock continue counting using 32 kHz clock signal as reference. The presence of a running low-power oscillator is detected after the poweron: this clock is immediately assumed (if present, or as soon as it is detected) as reference for the real-time clock counter and it will be maintained forever (unless specifically disabled via software). Only the main oscillator is running (XTAL1 / XTAL2 pins). In this case the main oscillator is not stopped when power-down is entered, and the real-time clock continue counting using the main oscillator clock signal as reference. There are two different operating power-down modes: protected mode and interruptible mode. 102/176 Doc ID 12968 Rev 4 ST10F272M Power reduction modes Before entering power-down mode (by executing the instruction PWRDN), bit VREGOFF in XMISC register must be set. Note: Leaving the main voltage regulator active during power-down may lead to unexpected behavior (example: CPU wake-up) and power consumption higher than what is specified. 21.2.1 Protected power-down mode This mode is selected when PWDCFG (bit 5) of SYSCON register is cleared. The protected power-down mode is only activated if the NMI pin is pulled low when executing PWRDN instruction (this means that the PWRD instruction belongs to the NMI software routine). This mode is only deactivated with an external hardware reset on RSTIN pin. 21.2.2 Interruptible power-down mode This mode is selected when PWDCFG (bit 5) of SYSCON register is set. The interruptible power-down mode is only activated if all the enabled fast external interrupt pins are in their inactive level. This mode is deactivated with an external reset applied to RSTIN pin or with an interrupt request applied to one of the fast external interrupt pins, or with an interrupt generated by the real-time clock, or with an interrupt generated by the activity on CAN's and I2C module interfaces. To allow the internal PLL and clock to stabilize, the RSTIN pin must be held low according the recommendations described in Chapter 20: System reset on page 77. An external RC circuit must be connected to RPD pin, as shown in the Figure 36. Figure 36. External RC circuitry on RPD pin 67)0 9'' 5 N:PLQLPXP 53' & )W\SLFDO *$3*5, To exit power-down mode with an external interrupt, an EXxIN (x = 7...0) pin has to be asserted for at least 40 ns. 21.3 Stand-by mode In stand-by mode, it is possible to turn off the main VDD provided that VSTBY is available through the dedicated pin of the ST10F272M. To enter stand-by mode it is mandatory to held the device under reset: once the device is under reset, the RAM is disabled (see XRAM2EN bit of XPERCON register), and its digital interface is frozen in order to avoid any kind of data corruption. A dedicated embedded low-power voltage regulator is implemented to generate the internal low voltage supply (about 1.65 V in stand-by mode) to bias all those circuits that shall Doc ID 12968 Rev 4 103/176 Power reduction modes ST10F272M remain active: the portion of XRAM (16 Kbytes for ST10F272M), the RTC counters and 32 kHz on-chip oscillator amplifier. In normal running mode (that is when main VDD is on) the VSTBY pin can be tied to VSS during reset to exercise the EA functionality associated with the same pin: the voltage supply for the circuitries which are usually biased with VSTBY (see in particular the 32 kHz oscillator used in conjunction with real-time clock module), is granted by the active main VDD. It must be noted that stand-by mode can generate problems associated with the usage of different power supplies in CMOS systems; particular attention must be paid when the ST10F272M I/O lines are interfaced with other external CMOS integrated circuits: if VDD of ST10F272M becomes (for example, in stand-by mode) lower than the output level forced by the I/O lines of these external integrated circuits, the ST10F272M could be directly powered through the inherent diode existing on ST10F272M output driver circuitry. The same is valid for ST10F272M interfaced to active/inactive communication buses during stand-by mode: current injection can be generated through the inherent diode. Furthermore, the sequence of turning on/off of the different voltage could be critical for the system (not only for the ST10F272M device). The device stand-by mode current (ISTBY) may vary while VDD to VSTBY (and vice versa) transition occurs: some current flows between VDD and VSTBY pins. System noise on both VDD and VSTBY can contribute to increase this phenomenon. 21.3.1 Entering stand-by mode As already stated, to enter stand-by mode the XRAM2EN bit in the XPERCON register must be cleared: This allows the RAM interface to be frozen immediately, avoiding any data corruption. As a consequence of a reset event, the RAM power supply is switched to the internal low-voltage supply V18SB (derived from VSTBY through the low-power voltage regulator). The RAM interface remains frozen until the bit XRAM2EN is set again by software initialization routine (at next exit from main VDD power-on reset sequence). Since V18 is falling down (as a consequence of VDD turning off), it can happen that the XRAM2EN bit is no longer able to guarantee its content (logic "0"), being the XPERCON Register powered by internal V18. This does not generate any problem, because the standby mode switching dedicated circuit continues to confirm the RAM interface freezing, irrespective the XRAM2EN bit content; XRAM2EN bit status is considered again when internal V18 comes back over internal stand-by reference V18SB. If internal V18 becomes lower than internal stand-by reference (V18SB) of about 0.3 to 0.45V with bit XRAM2EN set, the RAM supply switching circuit is not active: in case of a temporary drop on internal V18 voltage versus internal V18SB during normal code execution, no spurious stand-by mode switching can occur (the RAM is not frozen and can still be accessed). The ST10F272M core module, generating the RAM control signals, is powered by internal V18 supply; during turning off transient these control signals follow the V18, while RAM is switched to V18SB internal reference. It could happen that a high level of RAM write strobe from ST10F272M core (active low signal) is low enough to be recognized as a logic "0" by the RAM interface (due to V18 lower than V18SB): The bus status could contain a valid address for the RAM and an unwanted data corruption could occur. For this reason, an extra interface, powered by the switched supply, is used to prevent the RAM from this kind of potential corruption mechanism. 104/176 Doc ID 12968 Rev 4 ST10F272M Power reduction modes Warning: 21.3.2 During power-off phase, it is important that the external hardware maintains a stable ground level on RSTIN pin, without any glitch, in order to avoid spurious exiting from reset status with unstable power supply. Exiting stand-by mode After the system has entered the stand-by mode, the procedure to exit this mode consists of a standard power-on sequence, with the only difference that the RAM is already powered through V18SB internal reference (derived from VSTBY pin external voltage). It is recommended to held the device under reset (RSTIN pin forced low) until external VDD voltage pin is stable. Even though, at the very beginning of the power-on phase, the device is maintained under reset by the internal low voltage detector circuit (implemented inside the main voltage regulator) till the internal V18 becomes higher than about 1.0 V, there is no guaranty that the device stays under reset status if RSTIN is at high level during power ramp up. So, it is important the external hardware is able to guarantee a stable ground level on RSTIN along the power-on phase, without any temporary glitch. The external hardware is responsible for driving the RSTIN pin low until the VDD is stable, even though the internal LVD is active. Once the internal reset signal goes low, the RAM (still frozen) power supply is switched to the main V18. At this time, everything becomes stable, and the execution of the initialization routines can start: XRAM2EN bit can be set, enabling the RAM. 21.3.3 Real-time clock and stand-by mode When stand-by mode is entered (turning off the main supply VDD), the real-time clock counting can be maintained running in case the on-chip 32 kHz oscillator is used to provide the reference to the counter. This is not possible if the main oscillator is used as reference for the counter: Being the main oscillator powered by VDD, once this is switched off, the oscillator is stopped. Doc ID 12968 Rev 4 105/176 Power reduction modes 21.3.4 ST10F272M Power reduction modes summary The different power reduction modes are summarized in the following Table 44. VSTBY CPU Peripherals RTC Main OSC 32 kHz OSC STBY XRAM XRAM Mode Power reduction modes summary VDD Table 44. On On Off On Off Run Off Biased Biased On On Off On On Run On Biased Biased On On Off Off Off Off Off Biased Biased On On Off Off On On Off Biased Biased On On Off Off On Off On Biased Biased Off On Off Off Off Off Off Biased Off Off On Off Off On Off On Biased Off Idle Power-down Stand-by 106/176 Doc ID 12968 Rev 4 ST10F272M 22 Programmable output clock divider Programmable output clock divider A specific register mapped on the XBUS can be used to choose the division factor on the CLKOUT signal (P3.15). This register is mapped on X-miscellaneous memory address range. When CLKOUT function is enabled by setting bit CLKEN of register SYSCON, by default the CPU clock is output on P3.15. Setting bit XMISCEN of register XPERCON and bit XPEN of register SYSCON, it is possible to program the clock prescaling factor. In this way on P3.15 a prescaled value of the CPU clock can be output. When CLKOUT function is not enabled (bit CLKEN of register SYSCON cleared), P3.15 does not output any clock signal, even though XCLKOUTDIV register is programmed. Doc ID 12968 Rev 4 107/176 Register set 23 ST10F272M Register set This section summarizes all registers implemented in the ST10F272M, ordered by name. 23.1 Special function registers Table 45 lists all SFRs which are implemented in the ST10F272M in alphabetical order. Bit-addressable SFRs are marked with the letter `b' in the column `Name'. SFRs within the extended sfr-space (ESFRs) are marked with the letter `E' in the `Physical address' comumn. Table 45. Name List of special function registers Physical address 8-bit address Description Reset value ADCICb FF98h CCh A/D converter end of conversion interrupt control register - - 00h ADCONb FFA0h D0h A/D converter control register 0000h ADDAT FEA0h 50h A/D converter result register 0000h ADDAT2 F0A0h E 50h A/D converter 2 result register 0000h ADDRSEL1 FE18h 0Ch Address select register 1 0000h ADDRSEL2 FE1Ah 0Dh Address select register 2 0000h ADDRSEL3 FE1Ch 0Eh Address select register 3 0000h ADDRSEL4 FE1Eh 0Fh Address select register 4 0000h ADEICb FF9Ah CDh A/D converter overrun error interrupt control register - - 00h BUSCON0b FF0Ch 86h Bus configuration register 0 0xx0h BUSCON1b FF14h 8Ah Bus configuration register 1 0000h BUSCON2b FF16h 8Bh Bus configuration register 2 0000h BUSCON3b FF18h 8Ch Bus configuration register 3 0000h BUSCON4b FF1Ah 8Dh Bus configuration register 4 0000h CAPREL FE4Ah 25h GPT2 capture/reload register 0000h CC0 FE80h 40h CAPCOM register 0 0000h CC0ICb FF78h BCh CAPCOM register 0 interrupt control register - - 00h CC1 FE82h 41h CAPCOM register 1 0000h CC1ICb FF7Ah BDh CAPCOM register 1 interrupt control register - - 00h CC2 FE84h 42h CAPCOM register 2 0000h CC2ICb FF7Ch BEh CAPCOM register 2 interrupt control register - - 00h CC3 FE86h 43h CAPCOM register 3 0000h CC3ICb FF7Eh BFh CAPCOM register 3 interrupt control register - - 00h CC4 FE88h 44h CAPCOM register 4 0000h 108/176 Doc ID 12968 Rev 4 ST10F272M Table 45. Name Register set List of special function registers (continued) Physical address 8-bit address Description Reset value CC4ICb FF80h C0h CAPCOM register 4 interrupt control register - - 00h CC5 FE8Ah 45h CAPCOM register 5 0000h CC5ICb FF82h C1h CAPCOM register 5 interrupt control register - - 00h CC6 FE8Ch 46h CAPCOM register 6 0000h CC6ICb FF84h C2h CAPCOM register 6 interrupt control register - - 00h CC7 FE8Eh 47h CAPCOM register 7 0000h CC7ICb FF86h C3h CAPCOM register 7 interrupt control register - - 00h CC8 FE90h 48h CAPCOM register 8 0000h CC8ICb FF88h C4h CAPCOM register 8 interrupt control register - - 00h CC9 FE92h 49h CAPCOM register 9 0000h CC9ICb FF8Ah C5h CAPCOM register 9 interrupt control register - - 00h CC10 FE94h 4Ah CAPCOM register 10 0000h CC10ICb FF8Ch C6h CAPCOM register 10 interrupt control register - - 00h CC11 FE96h 4Bh CAPCOM register 11 0000h CC11ICb FF8Eh C7h CAPCOM register 11 interrupt control register - - 00h CC12 FE98h 4Ch CAPCOM register 12 0000h CC12ICb FF90h C8h CAPCOM register 12 interrupt control register - - 00h CC13 FE9Ah 4Dh CAPCOM register 13 0000h CC13ICb FF92h C9h CAPCOM register 13 interrupt control register - - 00h CC14 FE9Ch 4Eh CAPCOM register 14 0000h CC14ICb FF94h CAh CAPCOM register 14 interrupt control register - - 00h CC15 FE9Eh 4Fh CAPCOM register 15 0000h CC15ICb FF96h CBh CAPCOM register 15 interrupt control register - - 00h CC16 FE60h 30h CAPCOM register 16 0000h CC16ICb F160hE B0h CAPCOM register 16 interrupt control register - - 00h CC17 FE62h 31h CAPCOM register 17 0000h CC17ICb F162hE B1h CAPCOM register 17 interrupt control register - - 00h CC18 FE64h 32h CAPCOM register 18 0000h CC18ICb F164hE B2h CAPCOM register 18 interrupt control register - - 00h CC19 FE66h 33h CAPCOM register 19 0000h CC19ICb F166hE B3h CAPCOM register 19 interrupt control register - - 00h CC20 FE68h 34h CAPCOM register 20 0000h CC20ICb F168hE B4h CAPCOM register 20 interrupt control register - - 00h CC21 FE6Ah 35h CAPCOM register 21 0000h Doc ID 12968 Rev 4 109/176 Register set Table 45. Name ST10F272M List of special function registers (continued) Physical address 8-bit address Description Reset value CC21ICb F16AhE B5h CAPCOM register 21 interrupt control register - - 00h CC22 FE6Ch 36h CAPCOM register 22 0000h CC22ICb F16ChE B6h CAPCOM register 22 interrupt control register - - 00h CC23 FE6Eh 37h CAPCOM register 23 0000h CC23ICb F16EhE B7h CAPCOM register 23 interrupt control register - - 00h CC24 FE70h 38h CAPCOM register 24 0000h CC24ICb F170hE B8h CAPCOM register 24 interrupt control register - - 00h CC25 FE72h 39h CAPCOM register 25 0000h CC25ICb F172hE B9h CAPCOM register 25 interrupt control register - - 00h CC26 FE74h 3Ah CAPCOM register 26 0000h CC26ICb F174hE BAh CAPCOM register 26 interrupt control register - - 00h CC27 FE76h 3Bh CAPCOM register 27 0000h CC27ICb F176hE BBh CAPCOM register 27 interrupt control register - - 00h CC28 FE78h 3Ch CAPCOM register 28 0000h CC28ICb F178hE BCh CAPCOM register 28 interrupt control register - - 00h CC29 FE7Ah 3Dh CAPCOM register 29 0000h CC29ICb F184hE C2h CAPCOM register 29 interrupt control register - - 00h CC30 FE7Ch 3Eh CAPCOM register 30 0000h CC30ICb F18ChE C6h CAPCOM register 30 interrupt control register - - 00h CC31 FE7Eh 3Fh CAPCOM register 31 0000h CC31ICb F194hE CAh CAPCOM register 31 interrupt control register - - 00h CCM0b FF52h A9h CAPCOM mode control register 0 0000h CCM1b FF54h AAh CAPCOM mode control register 1 0000h CCM2b FF56h ABh CAPCOM mode control register 2 0000h CCM3b FF58h ACh CAPCOM mode control register 3 0000h CCM4b FF22h 91h CAPCOM mode control register 4 0000h CCM5b FF24h 92h CAPCOM mode control register 5 0000h CCM6b FF26h 93h CAPCOM mode control register 6 0000h CCM7b FF28h 94h CAPCOM mode control register 7 0000h CP FE10h 08h CPU context pointer register FC00h CRICb FF6Ah B5h GPT2 CAPREL interrupt control register - - 00h CSP FE08h 04h CPU code segment pointer register (read only) 0000h DP0Lb F100hE 80h P0L direction control register - - 00h DP0Hb F102hE 81h P0h direction control register - - 00h 110/176 Doc ID 12968 Rev 4 ST10F272M Table 45. Name Register set List of special function registers (continued) Physical address 8-bit address Description Reset value DP1Lb F104hE 82h P1L direction control register - - 00h DP1Hb F106hE 83h P1h direction control register - - 00h DP2 b FFC2h E1h Port 2 direction control register 0000h DP3 b FFC6h E3h Port 3 direction control register 0000h DP4 b FFCAh E5h Port 4 direction control register - - 00h DP6 b FFCEh E7h Port 6 direction control register - - 00h DP7 b FFD2h E9h Port 7 direction control register - - 00h DP8 b FFD6h EBh Port 8 direction control register - - 00h DPP0 FE00h 00h CPU data page pointer 0 register (10-bit) 0000h DPP1 FE02h 01h CPU data page pointer 1 register (10-bit) 0001h DPP2 FE04h 02h CPU data page pointer 2 register (10-bit) 0002h DPP3 FE06h 03h CPU data page pointer 3 register (10-bit) 0003h EMUCON FE0Ah 05h Emulation control register EXICONb F1C0hE E0h External interrupt control register 0000h EXISELb F1DAhE EDh External interrupt source selection register 0000h IDCHIP F07ChE 3Eh Device identifier register (n is the device revision) 110nh IDMANUF F07EhE 3Fh Manufacturer identifier register 0403h IDMEM F07AhE 3Dh On-chip memory identifier register 2040h IDPROG F078hE 3Ch Programming voltage identifier register 0040h IDX0b FF08h 84h MAC unit address pointer 0 0000h IDX1b FF0Ah 85h MAC unit address pointer 1 0000h MAH FE5Eh 2Fh MAC unit accumulator - high word 0000h MAL FE5Ch 2Eh MAC unit accumulator - low word 0000h MCWb FFDCh EEh MAC unit control word 0000h MDCb FF0Eh 87h CPU multiply divide control register 0000h MDH FE0Ch 06h CPU multiply divide register - high word 0000h MDL FE0Eh 07h CPU multiply divide register - low word 0000h MRWb FFDAh EDh MAC unit repeat word 0000h MSWb FFDEh EFh MAC unit status word 0200h ODP2b F1C2hE E1h Port 2 open drain control register 0000h ODP3b F1C6hE E3h Port 3 open drain control register 0000h ODP4b F1CAhE E5h Port 4 open drain control register - - 00h ODP6b F1CEhE E7h Port 6 open drain control register - - 00h ODP7b F1D2hE E9h Port 7 open drain control register - - 00h Doc ID 12968 Rev 4 - - XXh 111/176 Register set Table 45. Name ST10F272M List of special function registers (continued) Physical address 8-bit address Description Reset value ODP8b F1D6hE EBh Port 8 open drain control register - - 00h ONESb FF1Eh 8Fh Constant value 1's register (read only) FFFFh P0L b FF00h 80h PORT0 low register (lower half of PORT0) - - 00h P0H b FF02h 81h PORT0 high register (upper half of PORT0) - - 00h P1L b FF04h 82h PORT1 low register (lower half of PORT1) - - 00h P1H b FF06h 83h PORT1 high register (upper half of PORT1) - - 00h P2 b FFC0h E0h Port 2 register 0000h P3 b FFC4h E2h Port 3 register 0000h P4 b FFC8h E4h Port 4 register (8-bit) - - 00h P5 b FFA2h D1h Port 5 register (read only) P6 b FFCCh E6h Port 6 register (8-bit) - - 00h P7 b FFD0h E8h Port 7 register (8-bit) - - 00h P8 b FFD4h EAh Port 8 register (8-bit) - - 00h P5DIDISb FFA4h D2h Port 5 digital disable register 0000h PECC0 FEC0h 60h PEC channel 0 control register 0000h PECC1 FEC2h 61h PEC channel 1 control register 0000h PECC2 FEC4h 62h PEC channel 2 control register 0000h PECC3 FEC6h 63h PEC channel 3 control register 0000h PECC4 FEC8h 64h PEC channel 4 control register 0000h PECC5 FECAh 65h PEC channel 5 control register 0000h PECC6 FECCh 66h PEC channel 6 control register 0000h PECC7 FECEh 67h PEC channel 7 control register 0000h PICONb F1C4hE E2h Port input threshold control register - - 00h PP0 F038hE 1Ch PWM module period register 0 0000h PP1 F03AhE 1Dh PWM module period register 1 0000h PP2 F03ChE 1Eh PWM module period register 2 0000h PP3 F03EhE 1Fh PWM module period register 3 0000h PSWb FF10h 88h CPU program status word 0000h PT0 F030hE 18h PWM module up/down counter 0 0000h PT1 F032hE 19h PWM module up/down counter 1 0000h PT2 F034hE 1Ah PWM module up/down counter 2 0000h PT3 F036hE 1Bh PWM module up/down counter 3 0000h PW0 FE30h 18h PWM module pulse width register 0 0000h PW1 FE32h 19h PWM module pulse width register 1 0000h 112/176 Doc ID 12968 Rev 4 XXXXh ST10F272M Table 45. Name Register set List of special function registers (continued) Physical address 8-bit address Description Reset value PW2 FE34h 1Ah PWM module pulse width register 2 0000h PW3 FE36h 1Bh PWM module pulse width register 3 0000h PWMCON0b FF30h 98h PWM module control register 0 0000h PWMCON1b FF32h 99h PWM module control register 1 0000h PWMICb F17EhE BFh PWM module interrupt control register - - 00h QR0 F004hE 02h MAC unit offset register r0 0000h QR1 F006hE 03h MAC unit offset register R1 0000h QX0 F000hE 00h MAC unit offset register X0 0000h QX1 F002hE 01h MAC unit offset register X1 0000h RP0Hb F108hE 84h System start-up configuration register (read only) S0BG FEB4h 5Ah Serial channel 0 baudrate generator reload register 0000h S0CONb FFB0h D8h Serial channel 0 control register 0000h S0EICb FF70h B8h Serial channel 0 error interrupt control register - - 00h S0RBUF FEB2h 59h Serial channel 0 receive buffer register (read only) - - XXh S0RICb FF6Eh B7h Serial channel 0 receive interrupt control register - - 00h S0TBICb F19ChE CEh Serial channel 0 transmit buffer interrupt control reg. - - 00h S0TBUF FEB0h 58h Serial channel 0 transmit buffer register (write only) 0000h S0TICb FF6Ch B6h Serial channel 0 transmit interrupt control register - - 00h SP FE12h 09h CPU system stack pointer register FC00h SSCBR F0B4hE 5Ah SSC baudrate register 0000h SSCCONb FFB2h D9h SSC control register 0000h SSCEICb FF76h BBh SSC error interrupt control register - - 00h SSCRB F0B2hE 59h SSC receive buffer (read only) SSCRICb FF74h BAh SSC receive interrupt control register - - 00h SSCTB F0B0hE 58h SSC transmit buffer (write only) 0000h SSCTICb FF72h B9h SSC transmit interrupt control register - - 00h STKOV FE14h 0Ah CPU stack overflow pointer register FA00h STKUN FE16h 0Bh CPU stack underflow pointer register FC00h SYSCONb FF12h 89h CPU system configuration register T0 FE50h 28h CAPCOM timer 0 register 0000h T01CONb FF50h A8h CAPCOM timer 0 and timer 1 control register 0000h T0ICb FF9Ch CEh CAPCOM timer 0 interrupt control register - - 00h T0REL FE54h 2Ah CAPCOM timer 0 reload register 0000h T1 FE52h 29h CAPCOM timer 1 register 0000h Doc ID 12968 Rev 4 - - XXh XXXXh 0xx0h(1) 113/176 Register set Table 45. Name ST10F272M List of special function registers (continued) Physical address 8-bit address Description Reset value T1ICb FF9Eh CFh CAPCOM timer 1 interrupt control register - - 00h T1REL FE56h 2Bh CAPCOM timer 1 reload register 0000h T2 FE40h 20h GPT1 timer 2 register 0000h T2CONb FF40h A0h GPT1 timer 2 control register 0000h T2ICb FF60h B0h GPT1 timer 2 interrupt control register - - 00h T3 FE42h 21h GPT1 timer 3 register 0000h T3CONb FF42h A1h GPT1 timer 3 control register 0000h T3ICb FF62h B1h GPT1 timer 3 interrupt control register - - 00h T4 FE44h 22h GPT1 timer 4 register 0000h T4CONb FF44h A2h GPT1 timer 4 control register 0000h T4ICb FF64h B2h GPT1 timer 4 interrupt control register - - 00h T5 FE46h 23h GPT2 timer 5 register 0000h T5CONb FF46h A3h GPT2 timer 5 control register 0000h T5ICb FF66h B3h GPT2 timer 5 interrupt control register - - 00h T6 FE48h 24h GPT2 timer 6 register 0000h T6CONb FF48h A4h GPT2 timer 6 control register 0000h T6ICb FF68h B4h GPT2 timer 6 interrupt control register - - 00h T7 F050hE 28h CAPCOM timer 7 register 0000h T78CONb FF20h 90h CAPCOM timer 7 and 8 control register 0000h T7ICb F17AhE BDh CAPCOM timer 7 interrupt control register - - 00h T7REL F054hE 2Ah CAPCOM timer 7 reload register 0000h T8 F052hE 29h CAPCOM timer 8 register 0000h T8ICb F17ChE BEh CAPCOM timer 8 interrupt control register - - 00h T8REL F056hE 2Bh CAPCOM timer 8 reload register 0000h TFR b FFACh D6h Trap flag register 0000h WDT FEAEh 57h Watchdog timer register (read only) 0000h WDTCONb FFAEh D7h Watchdog timer control register 00xxh(2) XADRS3 F01ChE 0Eh XPER address select register 3 800Bh XP0ICb F186hE C3h See Section 9.1 - - 00h(3) XP1ICb F18EhE C7h See Section 9.1 - - 00h(3) XP2ICb F196hE CBh See Section 9.1 - - 00h(3) XP3ICb F19EhE CFh See Section 9.1 - - 00h(3) XPERCONb F024hE 12h XPER configuration register - - 05h ZEROSb FF1Ch 8Eh Constant value 0's register (read only) 0000h 114/176 Doc ID 12968 Rev 4 ST10F272M Register set 1. The system configuration is selected during reset. SYSCON reset value is 0000 0xx0 x000 0000b. 2. Reset value depends on different triggered reset event. 3. The XPnIC interrupt control registers control interrupt requests from integrated X-bus peripherals. Some software controlled interrupt requests may be generated by setting the XPnIR bits (of XPnIC register) of the unused X-peripheral nodes. 23.2 X-registers The following table lists all X-bus registers which are implemented in the ST10F272M ordered by their name. Note: The X-Registers are not bit-addressable. Table 46. List of X-bus registers Name Physical address Description Reset value CAN1BRPER EF0Ch CAN1: BRP extension register 0000h CAN1BTR EF06h CAN1: Bit timing register 2301h CAN1CR EF00h CAN1: CAN control register 0001h CAN1EC EF04h CAN1: Error counter 0000h CAN1IF1A1 EF18h CAN1: IF1 arbitration 1 0000h CAN1IF1A2 EF1Ah CAN1: IF1 arbitration 2 0000h CAN1IF1CM EF12h CAN1: IF1 command mask 0000h CAN1IF1CR EF10h CAN1: IF1 command request 0001h CAN1IF1DA1 EF1Eh CAN1: IF1 data A 1 0000h CAN1IF1DA2 EF20h CAN1: IF1 data A 2 0000h CAN1IF1DB1 EF22h CAN1: IF1 data B 1 0000h CAN1IF1DB2 EF24h CAN1: IF1 data B 2 0000h CAN1IF1M1 EF14h CAN1: IF1 mask 1 FFFFh CAN1IF1M2 EF16h CAN1: IF1 mask 2 FFFFh CAN1IF1MC EF1Ch CAN1: IF1 message control 0000h CAN1IF2A1 EF48h CAN1: IF2 arbitration 1 0000h CAN1IF2A2 EF4Ah CAN1: IF2 arbitration 2 0000h CAN1IF2CM EF42h CAN1: IF2 command mask 0000h CAN1IF2CR EF40h CAN1: IF2 command request 0001h CAN1IF2DA1 EF4Eh CAN1: IF2 data A 1 0000h CAN1IF2DA2 EF50h CAN1: IF2 data A 2 0000h CAN1IF2DB1 EF52h CAN1: IF2 data B 1 0000h CAN1IF2DB2 EF54h CAN1: IF2 data B 2 0000h CAN1IF2M1 EF44h CAN1: IF2 Mask 1 FFFFh CAN1IF2M2 EF46h CAN1: IF2 mask 2 FFFFh Doc ID 12968 Rev 4 115/176 Register set Table 46. ST10F272M List of X-bus registers (continued) Name Physical address Description Reset value CAN1IF2MC EF4Ch CAN1: IF2 message control 0000h CAN1IP1 EFA0h CAN1: Interrupt pending 1 0000h CAN1IP2 EFA2h CAN1: Interrupt pending 2 0000h CAN1IR EF08h CAN1: Interrupt register 0000h CAN1MV1 EFB0h CAN1: Message valid 1 0000h CAN1MV2 EFB2h CAN1: Message valid 2 0000h CAN1ND1 EF90h CAN1: New data 1 0000h CAN1ND2 EF92h CAN1: New data 2 0000h CAN1SR EF02h CAN1: Status register 0000h CAN1TR EF0Ah CAN1: Test register 00x0h CAN1TR1 EF80h CAN1: Transmission request 1 0000h CAN1TR2 EF82h CAN1: Transmission request 2 0000h CAN2BRPER EE0Ch CAN2: BRP extension register 0000h CAN2BTR EE06h CAN2: Bit timing register 2301h CAN2CR EE00h CAN2: CAN control register 0001h CAN2EC EE04h CAN2: Error counter 0000h CAN2IF1A1 EE18h CAN2: IF1 arbitration 1 0000h CAN2IF1A2 EE1Ah CAN2: IF1 arbitration 2 0000h CAN2IF1CM EE12h CAN2: IF1 command mask 0000h CAN2IF1CR EE10h CAN2: IF1 command request 0001h CAN2IF1DA1 EE1Eh CAN2: IF1 data A 1 0000h CAN2IF1DA2 EE20h CAN2: IF1 data A 2 0000h CAN2IF1DB1 EE22h CAN2: IF1 data B 1 0000h CAN2IF1DB2 EE24h CAN2: IF1 data B 2 0000h CAN2IF1M1 EE14h CAN2: IF1 mask 1 FFFFh CAN2IF1M2 EE16h CAN2: IF1 mask 2 FFFFh CAN2IF1MC EE1Ch CAN2: IF1 message control 0000h CAN2IF2A1 EE48h CAN2: IF2 arbitration 1 0000h CAN2IF2A2 EE4Ah CAN2: IF2 arbitration 2 0000h CAN2IF2CM EE42h CAN2: IF2 command mask 0000h CAN2IF2CR EE40h CAN2: IF2 command request 0001h CAN2IF2DA1 EE4Eh CAN2: IF2 data A 1 0000h CAN2IF2DA2 EE50h CAN2: IF2 data A 2 0000h CAN2IF2DB1 EE52h CAN2: IF2 data B 1 0000h CAN2IF2DB2 EE54h CAN2: IF2 data B 2 0000h 116/176 Doc ID 12968 Rev 4 ST10F272M Table 46. Register set List of X-bus registers (continued) Name Physical address Description Reset value CAN2IF2M1 EE44h CAN2: IF2 mask 1 FFFFh CAN2IF2M2 EE46h CAN2: IF2 mask 2 FFFFh CAN2IF2MC EE4Ch CAN2: IF2 message control 0000h CAN2IP1 EEA0h CAN2: Interrupt pending 1 0000h CAN2IP2 EEA2h CAN2: Interrupt pending 2 0000h CAN2IR EE08h CAN2: Interrupt register 0000h CAN2MV1 EEB0h CAN2: Message valid 1 0000h CAN2MV2 EEB2h CAN2: Message valid 2 0000h CAN2ND1 EE90h CAN2: New data 1 0000h CAN2ND2 EE92h CAN2: New data 2 0000h CAN2SR EE02h CAN2: Status register 0000h CAN2TR EE0Ah CAN2: Test register 00x0h CAN2TR1 EE80h CAN2: Transmission request 1 0000h CAN2TR2 EE82h CAN2: Transmission request 2 0000h EA06h I 2C clock control register 1 0000h EA0Eh I2C clock control register 2 0000h I2CCR EA00h I 2C control register 0000h I2CDR EA0Ch I2C data register 0000h EA08h I2C own address register 1 0000h EA0Ah I 2C own address register 2 0000h 2C I2CCCR1 I2CCCR2 I2COAR1 I2COAR2 I2CSR1 EA02h I status register 1 0000h I2CSR2 EA04h I2C status register 2 0000h RTCAH ED14h RTC alarm register high byte XXXXh RTCAL ED12h RTC alarm register low byte XXXXh RTCCON ED00H RTC control register 000Xh RTCDH ED0Ch RTC divider counter high byte XXXXh RTCDL ED0Ah RTC divider counter low byte XXXXh RTCH ED10h RTC programmable counter high byte XXXXh RTCL ED0Eh RTC programmable counter low byte XXXXh RTCPH ED08h RTC prescaler register high byte XXXXh RTCPL ED06h RTC prescaler register low byte XXXXh XCLKOUTDIV EB02h CLKOUT divider control register - - 00h XEMU0 EB76h XBUS emulation register 0 (write only) XXXXh XEMU1 EB78h XBUS emulation register 1 (write only) XXXXh XEMU2 EB7Ah XBUS emulation register 2 (write only) XXXXh Doc ID 12968 Rev 4 117/176 Register set Table 46. ST10F272M List of X-bus registers (continued) Name Physical address Description Reset value XEMU3 EB7Ch X-bus emulation register 3 (write only) XXXXh XIR0CLR EB14h X-interrupt 0 clear register (write only) 0000h XIR0SEL EB10h X-interrupt 0 selection register 0000h XIR0SET EB12h X-interrupt 0 set register (write only) 0000h XIR1CLR EB24h X-interrupt 1 clear register (write only) 0000h XIR1SEL EB20h X-interrupt 1 selection register 0000h XIR1SET EB22h X-interrupt 1 set register (write only) 0000h XIR2CLR EB34h X-interrupt 2 clear register (write only) 0000h XIR2SEL EB30h X-interrupt 2 selection register 0000h XIR2SET EB32h X-interrupt 2 set register (write only) 0000h XIR3CLR EB44h X-interrupt 3 clear selection register (write only) 0000h XIR3SEL EB40h X-interrupt 3 selection register 0000h XIR3SET EB42h X-interrupt 3 set selection register (write only) 0000h XMISC EB46h X-bus miscellaneous features register 0000h XP1DIDIS EB36h Port 1 digital disable register 0000h XPEREMU EB7Eh XPERCON copy for emulation (write only) XXXXh XPICON EB26h Extended port input threshold control register - - 00h XPOLAR EC04h XPWM module channel polarity register 0000h XPP0 EC20h XPWM module period register 0 0000h XPP1 EC22h XPWM module period register 1 0000h XPP2 EC24h XPWM module period register 2 0000h XPP3 EC26h XPWM module period register 3 0000h XPT0 EC10h XPWM module up/down counter 0 0000h XPT1 EC12h XPWM module up/down counter 1 0000h XPT2 EC14h XPWM module up/down counter 2 0000h XPT3 EC16h XPWM module up/down counter 3 0000h XPW0 EC30h XPWM module pulse width register 0 0000h XPW1 EC32h XPWM module pulse width register 1 0000h XPW2 EC34h XPWM module pulse width register 2 0000h XPW3 EC36h XPWM module pulse width register 3 0000h XPWMCON0 EC00h XPWM module control register 0 0000h XPWMCON0CLR EC08h XPWM module clear control reg. 0 (write only) 0000h XPWMCON0SET EC06h XPWM module set control register 0 (write only) 0000h XPWMCON1 EC02h XPWM module control register 1 0000h XPWMCON1CLR EC0Ch XPWM module clear control reg. 0 (write only) 0000h 118/176 Doc ID 12968 Rev 4 ST10F272M Table 46. Register set List of X-bus registers (continued) Name Physical address Description XPWMCON1SET EC0Ah XPWM module set control register 0 (write only) 0000h XPWMPORT EC80h XPWM module port control register 0000h XS1BG E906h XASC baudrate generator reload register 0000h XS1CON E900h XASC control register 0000h XS1CONCLR E904h XASC clear control register (write only) 0000h XS1CONSET E902h XASC set control register (write only) 0000h XS1PORT E980h XASC port control register 0000h XS1RBUF E90Ah XASC receive buffer register 0000h XS1TBUF E908h XASC transmit buffer register 0000h XSSCBR E80Ah XSSC baudrate register 0000h XSSCCON E800h XSSC control register 0000h XSSCCONCLR E804h XSSC clear control register (write only) 0000h XSSCCONSET E802h XSSC set control register (write only) 0000h XSSCPORT E880h XSSC port control register 0000h XSSCRB E808h XSSC receive buffer XXXXh XSSCTB E806h XSSC transmit buffer 0000h Doc ID 12968 Rev 4 Reset value 119/176 Register set 23.3 ST10F272M Flash registers ordered by name The following table lists all Flash control registers which are implemented in the ST10F272M ordered by their name. These registers are physically mapped on the IBus, except for XFVTAUR0, which is mapped on X-bus. Note that these registers are not bit-addressable. Table 47. Name Note: 120/176 List of Flash registers Physical address Description Reset value FARH 0x0008 0012 Flash address register - high 0000h FARL 0x0008 0010 Flash address register - low 0000h FCR0H 0x0008 0002 Flash control register 0 - high 0000h FCR0L 0x0008 0000 Flash control register 0 - low 0000h FCR1H 0x0008 0006 Flash control register 1 - high 0000h FCR1L 0x0008 0004 Flash control register 1 - low 0000h FDR0H 0x0008 000A Flash data register 0 - high FFFFh FDR0L 0x0008 0008 Flash data register 0 - low FFFFh FDR1H 0x0008 000E Flash data register 1 - high FFFFh FDR1L 0x0008 000C Flash data register 1 - low FFFFh FER 0x0008 0014 Flash error register 0000h FNVAPR0 0x0008 DFB8 Flash non-volatile access protection reg.0 ACFFh FNVAPR1H 0x0008 DFBE Flash non-volatile access protection reg.1 - high FFFFh FNVAPR1L 0x0008 DFBC Flash non-volatile access protection reg.1 - low FFFFh FNVWPIR 0x0008 DFB0 Flash non-volatile protection I register FFFFh XFVTAUR0 0x0000 EB50 X-bus Flash volatile temporary access unprotection register 0 0000h XFVTAUR0 register is mapped on the X-bus in the XMiscellaneous window. Therefore XMISCEN, bit 10 of XPERCON register, must be set in order to access this register. Doc ID 12968 Rev 4 ST10F272M 23.4 Register set Identification registers The ST10F272M has four identification registers, mapped in ESFR space. These registers contain: A manufacturer identifier A chip identifier with its revision An internal Flash and size identifier Programming voltage description IDMANUF (F07Eh / 3Fh) 15 14 Table 48. 13 12 ESFR 11 10 9 8 Name 15:5 MANUF 4 3 2 1 0 MANUF 0 0 0 1 1 RO RO RO RO RO RO Table 49. 5 Function Manufacturer identifier 020h: STMicroelectronics manufacturer (JTAG worldwide normalization) IDCHIP (F07Ch / 3Eh) 14 6 IDMANUF register description Bit 15 7 Reset value: 0403h 13 12 ESFR 11 10 9 8 7 Reset value: 110Xh 6 5 4 3 2 1 IDCHIP REVID RO RO 0 IDCHIP register description Bit Name Function 15:4 IDCHIP Device identifier 110h: ST10F272M identifier (272) 3:0 REVID Device revision identifier Xh: According to revision number Doc ID 12968 Rev 4 121/176 Register set ST10F272M IDMEM (F07Ah / 3Dh) 15 14 13 ESFR 12 11 10 9 8 7 Reset value: 2040h 6 5 MEMTYP MEMSIZE RO RO Table 50. 4 3 2 1 0 IDMEM register description Bit Name Function 15:12 MEMSIZE Internal memory size Internal memory size is 4 x (MEMSIZE) (in Kbyte) 040h for 256 Kbytes (ST10F272M) Internal memory type 11:0 MEMTYP 0h: ROM-Less 1h: (M) ROM memory 2h: (S) Standard Flash memory (ST10F272M) 3h: (H) High performance Flash memory 4h...Fh: Reserved IDPROG (F078h / 3Ch) 15 14 Table 51. Bit Note: 122/176 13 ESFR 12 11 10 9 8 7 Reset value: 0040h 6 5 4 3 PROGVPP PROGVDD RO RO 2 1 0 IDPROG register description Name Function 15:8 PROGVPP Programming VPP voltage (no need of external VPP) - 00h 7:0 Programming VDD voltage PROGVDD VDD voltage when programming EPROM or Flash devices is calculated using the following formula: VDD = 20 x [PROGVDD] / 256 (volts) - 40h for ST10F272M (5V). All identification words are read-only registers. Doc ID 12968 Rev 4 ST10F272M Electrical characteristics 24 Electrical characteristics 24.1 Absolute maximum ratings Table 52. Absolute maximum ratings Symbol Note: Parameter Values Unit VDD Voltage on VDD pins with respect to ground (VSS) -0.5 to +6.5 V VSTBY Voltage on VSTBY pin with respect to ground (VSS) -0.5 to +6.5 V VAREF Voltage on VAREF pins with respect to ground (VSS) -0.5 to VDD + 0.5 V VAGND Voltage on VAGND pins with respect to ground (VSS) VSS V -0.5 to VDD + 0.5 V VIO Voltage on any pin with respect to ground (VSS) IOV Input current on any pin during overload condition 10 mA ITOV Absolute sum of all input currents during overload condition | 75 | mA TST Storage temperature -65 to +150 C ESD ESD susceptibility (Human body model) 2000 V Stresses above those listed under `absolute maximum ratings' may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. During overload conditions (VIN > VDD or VIN < VSS) the voltage on pins with respect to ground (VSS) must not exceed the values defined by the absolute maximum ratings. During power-on and power-off transients (including standby entering/exiting phases), the relationships between voltages applied to the device and the main VDD must always be respected. In particular, power-on and power-off of VAREF must be coherent with VDD transient, in order to avoid undesired current injection through the on-chip protection diodes. Doc ID 12968 Rev 4 123/176 Electrical characteristics 24.2 ST10F272M Recommended operating conditions Table 53. Recommended operating conditions Value Symbol VDD Parameter Unit Min Max 4.5 5.5 0 VDD + 0.1 Operating supply voltage VSTBY Operation stand-by supply voltage(1) VAREF Operating analog reference voltage(2) TA Ambient temperature under bias TJ Junction temperature under bias V +125 -40 C +150 1. The value of the VSTBY voltage is specified in the range of 4.5 to 5.5 volts. When VSTBY voltage is lower than main VDD, the input section of VSTBY/EA pin can generate a spurious static consumption on VDD power supply (in the range of tenth of A). 2. For details on operating conditions concerning the usage of A/D converter refer to Section 24.7. 24.3 Power considerations The average chip-junction temperature, TJ, in degrees Celsius, may be calculated using the following equation: TJ = TA + (PD x JA) (1) Where: TA is the ambient temperature in C, JA is the package junction-to-ambient thermal resistance, in C/W, PD is the sum of PINT and PI/O (PD = PINT + PI/O) PINT is the product of IDD and VDD, expressed in Watts. This is the chip internal power PI/O represents the power dissipation on input and output pins; user determined. Most of the time PI/O < PINT and may be neglected. On the other hand, PI/O may be significant if the device is configured to continuously drive external modules and/or memories. An approximate relationship between PD and TJ (if PI/O is neglected) is given by: PD = K/(TJ + 273C) (2) Therefore (solving equations 1 and 2): K = PD x (TA + 273C) + JA x PD2 (3) Where: K is a constant for the particular part, which may be determined from equation (3) by measuring PD (at equilibrium) for a known TA. Using this value of K, the values of PD and TJ may be obtained by solving equations (1) and (2) iteratively for any value of TA. 124/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Table 54. Thermal characteristics Symbol Description Thermal resistance junction-ambient LQFP 144 - 20 x 20 mm/0.5 mm pitch LQFP 144 - 20 x 20 mm/0.5 mm pitch on four-layer FR4 board (2 layers signals/2 layers power) JA Value (typical) 40 Unit C/W 35 Based on thermal characteristics of the package and with reference to the power consumption figures provided in the next tables and diagrams, the following product classification can be proposed. However, the exact power consumption of the device inside the application must be computed according to different working conditions, thermal profiles, real thermal resistance of the system (including printed circuit board or other substrata), I/O activity, and so on. Table 55. 24.4 Package characteristics Package Ambient temperature range CPU frequency range LQFP 144 -40 to +125C 1 to 40 MHz Parameter interpretation The parameters listed in the following tables represent the characteristics of the ST10F272M and its demands on the system. Where the ST10F272M logic provides signals with their respective timing characteristics, the symbol `CC' for controller characteristics, is included in the `Symbol' column. Where the external system must provide signals with their respective timing characteristics to the ST10F272M, the symbol `SR' for system requirement, is included in the `Symbol' column. Doc ID 12968 Rev 4 125/176 Electrical characteristics 24.5 ST10F272M DC characteristics VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C Table 56. DC characteristics Limit values Parameter Symbol Min Max Unit Test condition Input low voltage (TTL mode) (except RSTIN, EA, NMI, RPD, XTAL1, READY) VIL SR -0.3 0.8 V - Input low voltage (CMOS mode) (except RSTIN, EA, NMI, RPD, XTAL1, READY) VILS SR -0.3 0.3 VDD V - Input low voltage RSTIN, EA, NMI, RPD VIL1 SR -0.3 0.3 VDD V - Input low voltage XTAL1 (CMOS only) VIL2 SR -0.3 0.3 VDD V Direct drive mode Input low voltage READY (TTL only) VIL3 SR -0.3 0.8 V - Input high voltage (TTL mode) (except RSTIN, EA, NMI, RPD, XTAL1) VIH SR 2.0 VDD + 0.3 V - Input high voltage (CMOS mode) (except RSTIN, EA, NMI, RPD, XTAL1) VIHS SR 0.7 VDD VDD + 0.3 V - Input high voltage RSTIN, EA, NMI, RPD VIH1 SR 0.7 VDD VDD + 0.3 V - Input high voltage XTAL1 (CMOS only) VIH2 SR 0.7 VDD VDD + 0.3 V Direct drive mode Input high voltage READY (TTL only) VIH3 SR 2.0 VDD + 0.3 V - Input hysteresis (TTL mode) (except RSTIN, EA, NMI, XTAL1, RPD) VHYS CC 400 700 mV (1) Input hysteresis (CMOS mode) (except RSTIN, EA, NMI, XTAL1, RPD) VHYSS CC 750 1400 mV (1) Input hysteresis RSTIN, EA, NMI VHYS1 CC 750 1400 mV (1) Input hysteresis XTAL1 VHYS2 CC 0 50 mV (1) Input hysteresis READY (TTL only) VHYS3 CC 400 700 mV (1) Input hysteresis RPD VHYS4 CC 500 1500 mV (1) Output low voltage (P6[7:0], ALE, RD, WR/WRL, BHE/WRH, CLKOUT, RSTIN, RSTOUT) VOL CC - 0.4 0.05 V IOL = 8 mA IOL = 1 mA Output low voltage (P0[15:0], P1[15:0], P2[15:0], P3[15,13:0], P4[7:0], P7[7:0], P8[7:0]) VOL1 CC - 0.4 0.05 V IOL1 = 4 mA IOL1 = 0.5 mA Output low voltage RPD VOL2 CC - VDD 0.5 VDD 0.3 VDD V IOL2 = 85 A IOL2 = 80 A IOL2 = 60 A CC VDD - 0.8 VDD - 0.08 - V IOH = - 8mA IOH = - 1mA Output high voltage (P6[7:0], ALE, RD, WR/WRL, BHE/WRH, CLKOUT, RSTOUT) 126/176 VOH Doc ID 12968 Rev 4 ST10F272M Table 56. Electrical characteristics DC characteristics (continued) Limit values Parameter Symbol Min Max Unit Test condition Output high voltage(2) (P0[15:0], P1[15:0], P2[15:0], P3[15,13:0], P4[7:0], P7[7:0], P8[7:0]) VOH1 CC VDD - 0.8 VDD - 0.08 - V IOH1 = - 4 mA IOH1 = - 0.5 mA Output high voltage RPD VOH2 CC 0 0.3 VDD 0.5 VDD - V IOH2 = - 2 mA IOH2 = - 750 A IOH2 = - 150 A Input leakage current (P5[15:0])(3) |IOZ1 | CC - 0.2 A - Input leakage current (all except P5[15:0], P2[0], RPD, P3[12], P3[15]) |IOZ2 | CC - 0.5 A - Input leakage current (P2[0])(4) |IOZ3 | CC - +1.0 -0.5 A - Input leakage current (RPD) |IOZ4 | CC - 3.0 A - Input leakage current (P3[12], P3[15]) |IOZ5 | CC - 1.0 A - Overload current (all except P2[0]) |IOV1 | SR - 5 mA (1)(5) Overload current (P2[0])(4) |IOV2 | SR - +5 -1 mA (1)(5) RRST CC 50 250 k 100 k nominal RSTIN pull-up resistor (6)(7) Read/write inactive current IRWH - -40 A VOUT = 2.4 V Read/write active current(6)(8) IRWL -500 - A VOUT = 0.4 V IALEL 20 - A VOUT = 0.4 V IALEH - 300 A VOUT = 2.4 V IP6H - -40 A VOUT = 2.4 V IP6L ALE inactive current ALE active current (6)(7) (6)(8) Port 6 inactive current (P6[4:0])(6)(7) Port 6 active current (P6[4:0])(6)(8) PORT0 configuration current(6) -500 - A VOUT = 0.4 V IP0H(6) - -10 A VIN = 2.0 V IP0L(7) -100 - A VIN = 0.8 V - 10 pF (1)(6) CC Pin capacitance (digital inputs/outputs) CIO Run mode power supply current(9) (execution from internal RAM) ICC1 - 15 + 1.5 fCPU mA - Run mode power supply current(1)(9) (execution from internal Flash) ICC2 - 15 + 1.5 fCPU mA - Idle mode supply current(10) IID - 15 + 0.6 fCPU mA - Power-down supply current(11) (RTC off, oscillators off, Main voltage regulator off) IPD1 - 150 A TA = 25 C Power-down supply current(11) (RTC on, main oscillator on, Main voltage regulator off) IPD2 - 400 typical value A TA = 25 C Doc ID 12968 Rev 4 127/176 Electrical characteristics Table 56. ST10F272M DC characteristics (continued) Limit values Parameter Power-down supply current(11) (RTC on, 32 kHz oscillator on, Main voltage regulator off) Symbol IPD3 (11) Stand-by supply current (RTC off, oscillators off, VDD off, VSTBY on) Unit Test condition 200 A TA = 25 C - 120 A VSTBY = 5.5 V TA = TJ = 25 C - 500 A VSTBY = 5.5 V TA = TJ = 125 C - 120 A VSTBY = 5.5 V TA = TJ = 25 C - 500 A VSTBY = 5.5 V TA = TJ = 125 C - 2.5 mA - Min Max - ISB1 Stand-by supply current(11) (RTC on, 32 kHz oscillator on, main VDD off, VSTBY on) ISB2 Stand-by supply current(1)(11) (VDD transient condition) ISB3 1. Not 100% tested, guaranteed by design characterization. 2. This specification is not valid for outputs which are switched to open drain mode. In this case the respective output will float and the voltage is imposed by the external circuitry. 3. Port 5 leakage values are granted for not selected A/D converter channel. One channel is always selected (by default, after reset, P5.0 is selected). For the selected channel the leakage value is similar to that of other port pins. 4. The leakage of P2.0 is higher than other pins due to the additional logic (pass gates active only in specific test modes) implemented on input path. Pay attention to not stress P2.0 input pin with negative overload beyond the specified limits: failures in Flash reading may occur (sense amplifier perturbation). Refer to next Figure 37 for a scheme of the input circuitry. 5. Overload conditions occur if the standard operating conditions are exceeded, that is, the voltage on any pin exceeds the specified range (that is, VOV > VDD + 0.3 V or VOV < -0.3 V). The absolute sum of input overload currents on all port pins may not exceed 50 mA. The supply voltage must remain within the specified limits. 6. This specification is only valid during reset, or during hold- or adapt-mode. Port 6 pins are only affected, if they are used for CS output and the open drain function is not enabled. 7. The maximum current may be drawn while the respective signal line remains inactive. 8. The minimum current must be drawn in order to drive the respective signal line active. 9. The power supply current is a function of the operating frequency (fCPU is expressed in MHz). This dependency is illustrated in Figure 38 below. This parameter is tested at VDDmax and at maximum CPU clock frequency with all outputs disconnected and all inputs at VIL or VIH, RSTIN pin at VIH1min. This implies I/O current is not considered. The device is doing the following: Fetching code from IRAM and XRAM1, accessing in read and write to both XRAM modules Watchdog timer is enabled and regularly serviced RTC is running with main oscillator clock as reference, generating a tick interrupts every 192 clock cycles Four channel of XPWM are running (waves period: 2, 2.5, 3 and 4 CPU clock cycles): no output toggling Five general purpose timers are running in timer mode with prescaler equal to 8 (T2, T3, T4, T5, T6) ADC is in autoscan continuous conversion mode on all 16 channels of port5 All interrupts generated by XPWM, RTC, timers and ADC are not serviced 10. The idle mode supply current is a function of the operating frequency (fCPU is expressed in MHz). This dependency is illustrated in Figure 37 below. These parameters are tested and at maximum CPU clock with all outputs disconnected and all inputs at VIL or VIH, RSTIN pin at VIH1min. 11. This parameter is tested including leakage currents. All inputs (including pins configured as inputs) at 0 V to 0.1 V or at VDD - 0.1V to VDD, VAREF = 0V, all outputs (including pins configured as outputs) disconnected. Also, the main voltage regulator is assumed to be off; if it is not, an additional 1mA must be added. 128/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 37. Port2 test mode structure 3 &&,2 2XWSXW EXIIHU &ORFN ,QSXW ODWFK $OWHUQDWHGDWDLQSXW )DVWH[WHUQDOLQWHUUXSWLQSXW 7HVWPRGH )ODVKVHQVHDPSOLILHU DQGFROXPQGHFRGHU *$3*5, Figure 38. Supply current versus the operating frequency (run and idle modes) ,&& ,&& ,>P$@ ,,' I&38>0+]@ *$3*5, Doc ID 12968 Rev 4 129/176 Electrical characteristics 24.6 ST10F272M Flash characteristics VDD = 5 V 10 %, VSS = 0 V Table 57. Flash characteristics Parameter Typical Maximum TA = 25 C TA = 125 C 0 cycles(1) 0 cycles(1) Unit Notes 100 k cycles Word program (32-bit) (2) 35 80 290 s - Double word program (64-bit)(2) 60 150 570 s - Bank 0 program (256 Kbyte) (double word program) 1.6 2.0 3.9 s - Sector erase (8 Kbyte) 0.6 0.5 0.9 0.8 1.0 0.9 s Not preprogrammed Preprogrammed Sector erase (32 Kbyte) 1.1 0.8 2.0 1.8 2.7 2.5 s Not preprogrammed Preprogrammed Sector erase (64 Kbyte) 1.7 1.3 3.7 3.3 5.1 4.7 s Not preprogrammed Preprogrammed Bank 0 erase (256 Kbyte)(3) 5.6 4.0 13.6 11.9 19.2 17.5 s Not preprogrammed Preprogrammed Recovery from power-down (tPD) - 40 40 s (4) Program suspend latency(4) - 10 10 s - - 30 30 s - Erase suspend request rate(4) 20 20 20 ms Minimum delay between two requests Set protection(4) 40 90 300 s - Erase suspend latency (4) 1. The figures are given after about 100 cycles due to testing routines (0 cycles at the final customer). 2. Word and double word programming times are provided as average values derived from a full sector programming time. Absolute value of a word or double word programming time could be longer than the average value. 3. Bank erase is obtained through a multiple sector erase operation (setting bits related to all sectors of the bank). As ST10F272M implements only one bank, the bank erase operation is equivalent to module and chip erase operations. 4. Not 100% tested, guaranteed by design characterization. 130/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Table 58. Flash data retention characteristics Number of program/erase cycles (-40 C < TA < 125 C) Data retention time (average ambient temperature 60 C) 256 Kbyte (code store) 64 Kbyte (EEPROM emulation)(1) 0 - 100 > 20 years > 20 years 1000 - > 20 years 10000 - 10 years 100000 - 1 year 1. Two 64 Kbyte Flash sectors may be typically used to emulate up to 4, 8 or 16 Kbytes of EEPROM. Therefore, in case of an emulation of a 16 Kbyte EEPROM, 100,000 Flash program/erase cycles are equivalent to 800,000 EEPROM Program/Erase cycles. For an efficient use of the EEPROM emulation please refer to dedicated application note document (AN2061 - "EEPROM Emulation with ST10F2xx"). Contact your local field service, local sales person or STMicroelectronics representative to obtain a copy of such a guideline document. 24.7 A/D converter characteristics VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C, 4.5 V VAREF VDD, VSS VAGND VSS + 0.2 V Table 59. A/D converter characteristics Limit values Parameter Symbol Unit Min Max Test condition Analog reference voltage(1) VAREF SR 4.5 VDD V Analog ground voltage VAGND SR VSS VSS + 0.2 V VAGND VAREF V IAREF CC - - 5 1 mA A Running mode(3) Power-down mode Analog input voltage(2) Reference supply current VAIN SR Sample time tS CC 1 - s (4) Conversion time tC CC 3 - s (5) DNL CC -1 +1 LSB No overload INL CC -1.5 +1.5 LSB No overload Offset error(6) OFS CC -1.5 +1.5 LSB No overload Total unadjusted error(6) TUE CC -2.0 -5.0 -7.0 +2.0 +5.0 +7.0 LSB Port5 Port1 - no overload(3) Port1 - overload(3) Coupling factor between inputs(3)(7) K CC - 10-6 - CP1 CC - 3 pF CP2 CC - 4 6 pF CS CC - 3.5 pF Differential nonlinearity(6) Integral nonlinearity(6) Input pin capacitance(3)(8) Sampling capacitance(3)(8) Doc ID 12968 Rev 4 On both Port5 and Port1 Port5 Port1 131/176 Electrical characteristics Table 59. ST10F272M A/D converter characteristics (continued) Limit values Parameter Analog switch resistance(3)(8) Symbol Unit Min Max RSW CC - - 600 1600 W RAD CC - 1300 W Test condition Port5 Port1 1. VAREF can be tied to ground when A/D converter is not in use. There is increased consumption (approximately 200 A) on main VDD due to internal analog circuitry not being completely turned off. Therefore, it is suggested to maintain the VAREF at VDD level even when not in use, and to eventually switch off the A/D converter circuitry setting bit ADOFF in ADCON register. 2. VAIN may exceed VAGND or VAREF up to the absolute maximum ratings. However, the conversion result in these cases will be 0x000H or 0x3FFH, respectively 3. Not 100% tested, guaranteed by design characterization 4. During the sample time the input capacitance CAIN can be charged/discharged by the external source. The internal resistance of the analog source must allow the capacitance to reach its final voltage level within tS. After the end of the sample time tS, changes of the analog input voltage have no effect on the conversion result. Values for the sample clock tS depend on programming and can be taken from Table 60: A/D converter programming. 5. This parameter includes the sample time tS, the time for determining the digital result and the time to load the result register with the conversion result. Values for the conversion clock tCC depend on programming and can be taken from the next Table 60. 6. DNL, INL, OFS and TUE are tested at VAREF = 5.0 V, VAGND = 0 V, VDD = 5.0 V. It is guaranteed by design characterization for all other voltages within the defined voltage range. `LSB' has a value of VAREF/1024. For port5 channels, the specified TUE ( 2 LSB) is guaranteed also with an overload condition (see IOV specification) occurring on maximum 2 not selected analog input pins of port5 and the absolute sum of input overload currents on all Port5 analog input pins does not exceed 10 mA. For port1 channels, the specified TUE is guaranteed when no overload condition is applied to port1 pins: when an overload condition occurs on maximum 2 not selected analog input pins of port1 and the input positive overload current on all analog input pins does not exceed 10 mA (either dynamic or static injection), the specified TUE is degraded ( 7 LSB). To obtain the same accuracy, the negative injection current on port1 pins must not exceed -1mA in case of both dynamic and static injection. 7. The coupling factor is measured on a channel while an overload condition occurs on the adjacent not selected channels with the overload current within the different specified ranges (for both positive and negative injection current). 8. Refer to scheme shown in Figure 40. 24.7.1 Conversion timing control When a conversion is started, first the capacitances of the converter are loaded via the respective analog input pin to the current analog input voltage. The time to load the capacitances is referred to as sample time. Next the sampled voltage is converted to a digital value several successive steps, which correspond to the 10-bit resolution of the ADC. During these steps the internal capacitances are repeatedly charged and discharged via the VAREF pin. The current that has to be drawn from the sources for sampling and changing charges depends on the time that each respective step takes, because the capacitors must reach their final voltage level within the given time, at least with a certain approximation. The maximum current, however, that a source can deliver, depends on its internal resistance. The time that the two different actions during conversion take (sampling, and converting) can be programmed within a certain range in the ST10F272M relative to the CPU clock. The absolute time that is consumed by the different conversion steps therefore is independent from the general speed of the controller. This allows adjustment of the ST10F272M A/D converter to the system's properties: 132/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Fast conversion can be achieved by programming the respective times to their absolute possible minimum. This is preferable for scanning high frequency signals. The internal resistance of analog source and analog supply must be sufficiently low, however. High internal resistance can be achieved by programming the respective times to a higher value, or the possible maximum. This is preferable when using analog sources and supply with a high internal resistance in order to keep the current as low as possible. The conversion rate in this case may be considerably lower, however. The conversion times are programmed via the upper four bits of register ADCON. Bit fields ADCTC and ADSTC are used to define the basic conversion time and in particular the partition between sample phase and comparison phases. The table below lists the possible combinations. The timings refer to the unit TCL, where fCPU = 1/2 TCL. A complete conversion time includes the conversion itself, the sample time and the time required to transfer the digital value to the result register. Table 60. A/D converter programming ADCTC ADSTC Sample Comparison Extra Total conversion 00 00 TCL * 120 TCL * 240 TCL * 28 TCL * 388 00 01 TCL * 140 TCL * 280 TCL * 16 TCL * 436 00 10 TCL * 200 TCL * 280 TCL * 52 TCL * 532 00 11 TCL * 400 TCL * 280 TCL * 44 TCL * 724 11 00 TCL * 240 TCL * 480 TCL * 52 TCL * 772 11 01 TCL * 280 TCL * 560 TCL * 28 TCL * 868 11 10 TCL * 400 TCL * 560 TCL * 100 TCL * 1060 11 11 TCL * 800 TCL * 560 TCL * 52 TCL * 1444 10 00 TCL * 480 TCL * 960 TCL * 100 TCL * 1540 10 01 TCL * 560 TCL * 1120 TCL * 52 TCL * 1732 10 10 TCL * 800 TCL * 1120 TCL * 196 TCL * 2116 10 11 TCL * 1600 TCL * 1120 TCL * 164 TCL * 2884 Note: The total conversion time is compatible with the formula valid for ST10F269, while the meaning of the bit fields ADCTC and ADSTC is no longer compatible: the minimum conversion time is 388 TCL, which at 40 MHz CPU frequency corresponds to 4.85 s (see ST10F269). 24.7.2 A/D conversion accuracy The A/D converter compares the analog voltage sampled on the selected analog input channel to its analog reference voltage (VAREF) and converts it into 10-bit digital data. The absolute accuracy of the A/D conversion is the deviation between the input analog value and the output digital value. It includes the following errors: Offset error (OFS) Gain error (GE) Quantization error Nonlinearity error (differential and integral) Doc ID 12968 Rev 4 133/176 Electrical characteristics ST10F272M These four error quantities are explained below using Figure 39. Offset error Offset error is the deviation between actual and ideal A/D conversion characteristics when the digital output value changes from the minimum (zero voltage) 00 to 01 (Figure 39, see OFS). Gain error Gain error is the deviation between the actual and ideal A/D conversion characteristics when the digital output value changes from the 3FE to the maximum 3FF, once offset error is subtracted. Gain error combined with offset error represents the so-called full-scale error (Figure 39, OFS + GE). Quantization error Quantization error is the intrinsic error of the A/D converter and is expressed as 1/2 LSB. Nonlinearity error Nonlinearity error is the deviation between actual and the best-fitting A/D conversion characteristics (see Figure 39): Differential nonlinearity error is the actual step dimension versus the ideal one (1 LSBIDEAL). Integral nonlinearity error is the distance between the center of the actual step and the center of the bisector line, in the actual characteristics. Note that for integral nonlinearity error, the effect of offset, gain and quantization errors is not included. Note: Bisector characteristic is obtained drawing a line from 1/2 LSB before the first step of the real characteristic, and 1/2 LSB after the last step again of the real characteristic. 24.7.3 Total unadjusted error The total unadjusted error specifies the maximum deviation from the ideal characteristic: the number provided in the data sheet represents the maximum error with respect to the entire characteristic. It is a combination of the offset, gain and integral linearity errors. The different errors may compensate each other depending on the relative sign of the offset and gain errors. Refer to Figure 39, see TUE. 134/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 39. A/D conversion characteristics *DLQHUURU*( 2IIVHWHUURU2)6 )) )( )' ,GHDOFKDUDFWHULVWLF )& )% )$ %LVHFWRUFKDUDFWHULVWLF 'LJLWDORXW +(; ([DPSOHRIDQDFWXDOWUDQVIHUFXUYH 7KHLGHDOWUDQVIHUFXUYH 'LIIHUHQWLDOQRQOLQHDULW\HUURU '1/ ,QWHJUDOQRQOLQHDULW\HUURU ,1/ &HQWHURIDVWHSRIWKHDFWXDOWUDQVIHUFXUYH 4XDQWL]DWLRQHUURU /6% 7RWDOXQDGMXVWHGHUURU 78( /6% LGHDO 9$,1 /6%,'($/ >/6%,'($/ 9$5()@ 2IIVHWHUURU2)6 *$3*5, 24.7.4 Analog reference pins The accuracy of the A/D converter depends on how accurate is its analog reference: a noise in the reference results in at least that much error in a conversion. A low pass filter on the A/D converter reference source (supplied through pins VAREF and VAGND), is recommended in order to clean the signal, minimizing the noise. A simple capacitive bypassing may be sufficient in most of the cases; in presence of high RF noise energy, inductors or ferrite beads may be necessary. In this architecture, VAREF and VAGND pins represents also the power supply of the analog circuitry of the A/D converter: there is an effective DC current requirement from the reference voltage by the internal resistor string in the R-C DAC array and by the rest of the analog circuitry. An external resistance on VAREF could introduce error under certain conditions: for this reasons, series resistance are not advisable, and more in general any series devices in the filter network should be designed to minimize the DC resistance. Analog input pins To improve the accuracy of the A/D converter, it is definitively necessary that analog input pins have low AC impedance. Placing a capacitor with good high frequency characteristics at the input pin of the device, can be effective: the capacitor should be as large as possible, ideally infinite. This capacitor contributes to attenuating the noise present on the input pin. Doc ID 12968 Rev 4 135/176 Electrical characteristics ST10F272M Moreover, it sources charge during the sampling phase, when the analog signal source is a high-impedance source. A real filter, can typically be obtained by using a series resistance with a capacitor on the input pin (simple RC Filter). The RC filtering may be limited according to the value of source impedance of the transducer or circuit supplying the analog signal to be measured. The filter at the input pins must be designed taking into account the dynamic characteristics of the input signal (bandwidth). Figure 40. A/D converter input pins scheme ([WHUQDOFLUFXLW ,QWHUQDOFLUFXLWVFKHPH 9'' 6RXUFH 56 9$ )LOWHU &XUUHQWOLPLWHU 5) 5/ &) &3 &KDQQHO VHOHFWLRQ 6DPSOLQJ 56: 5$' &3 &6 56 6RXUFHLPSHGDQFH 5) )LOWHUUHVLVWDQFH &) )LOWHUFDSDFLWDQFH 5/ &XUUHQWOLPLWHUUHVLVWDQFH 56: &KDQQHOVHOHFWLRQVZLWFKLPSHGDQFH 5$' 6DPSOLQJVZLWFKLPSHGDQFH &3 3LQFDSDFLWDQFH WZRFRQWULEXWLRQV&3DQG&3 &6 6DPSOLQJFDSDFLWDQFH *$3*5, Input leakage and external circuit The series resistor utilized to limit the current to a pin (see RL in Figure 40), in combination with a large source impedance can lead to a degradation of A/D converter accuracy when input leakage is present. Data about maximum input leakage current at each pin is provided in Table 56: DC characteristics on page 126. Input leakage is greatest at high operating temperatures, and in general it decreases by one half for each 10 C decrease in temperature. Considering that, for a 10-bit A/D converter one count is about 5mV (assuming VAREF = 5 V), an input leakage of 100 nA acting though an RL = 50 k of external resistance leads to an error of exactly one count (5 mV); if the resistance were 100 k the error would become two counts. Eventual additional leakage due to external clamping diodes must also be taken into account in computing the total leakage affecting the A/D converter measurements. Another contribution to the total leakage is represented by the charge sharing effects with the sampling capacitance: being CS substantially a switched capacitance, with a frequency equal to the conversion rate of a single channel (maximum when fixed channel continuous conversion mode is selected), it can be seen as a resistive path to ground. For instance, assuming a conversion rate of 250 kHz, with CS equal to 4 pF, a resistance of 1 M is obtained (REQ = 1/fCCS, where fC represents the conversion rate at the considered 136/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics channel). To minimize the error induced by the voltage partitioning between this resistance (sampled voltage on CS) and the sum of RS + RF + RL + RSW + RAD, the external circuit must be designed to respect the following relation: R S + R F + R L + R SW + R AD 1 V A ------------------------------------------------------------------------------ < --- LSB 2 R EQ The formula above provides constraints for external network design, in particular on resistive path. A second aspect involving the capacitance network must be considered. Assuming the three capacitances CF, CP1 and CP2 initially charged at the source voltage VA (refer to the equivalent circuit shown in Figure 40), when the sampling phase is started (A/D switch close), a charge sharing phenomena is installed. Figure 41. Charge sharing timing diagram during sampling phase 9ROWDJHWUDQVLHQWRQ&6 9&6 9$ '9/6% 9$ W 56:5$' &676 W 5/ &6&3&3 9$ 76 W *$3*5, In particular two different transient periods can be distinguished (see Figure 41): A first and quick charge transfer from the internal capacitance CP1 and CP2 to the sampling capacitance CS occurs (CS is supposed initially completely discharged): considering a worst case (since the time constant in reality would be faster) in which CP2 is shown in parallel to CP1 (call CP = CP1 + CP2), the two capacitance CP and CS are in series, and the time constant is: CP CS 1 = ( R SW + R AD ) ----------------------CP + CS This relation can again be simplified considering only CS as an additional worst condition. In reality, the transient is faster, but the A/D converter circuitry has been designed to be robust also in the very worst case: the sampling time TS is always much longer than the internal time constant: 1 < ( R SW + R AD ) C S < < T S The charge of CP1 and CP2 is redistributed also on CS, determining a new value of the voltage VA1 on the capacitance according to the following equation: V A1 ( C S + C P1 + C P2 ) = V A ( C P1 + C P2 ) Doc ID 12968 Rev 4 137/176 Electrical characteristics ST10F272M A second charge transfer involves also CF (that is typically bigger than the on-chip capacitance) through the resistance RL: again considering the worst case in which CP2 and CS were in parallel to CP1 (since the time constant in reality would be faster), the time constant is: 2 < R L ( C S + C P1 + C P2 ) In this case, the time constant depends on the external circuit: in particular imposing that the transient is completed well before the end of sampling time TS, a constraint on RL sizing is obtained: 10 2 = 10 R L ( C S + C P1 + C P2 ) TS Of course, RL must also be sized according to the current limitation constraints, in combination with RS (source impedance) and RF (filter resistance). Being CF definitively bigger than CP1, CP2 and CS, then the final voltage VA2 (at the end of the charge transfer transient) will be much higher than VA1. The following equation must be respected (charge balance assuming now CS already charged at VA1): VA2 ( C S + C P1 + C P2 + C F ) = V A C F + V A1 ( C P1 + C P2 + C S ) The two transients above are not influenced by the voltage source that, due to the presence of the RFCF filter, is not able to provide the extra charge to compensate the voltage drop on CS with respect to the ideal source VA; the time constant RFCF of the filter is very high with respect to the sampling time (TS). The filter is typically designed to act as anti-aliasing (see Figure 42). Calling f0 the bandwidth of the source signal (and as a consequence the cut-off frequency of the anti-aliasing filter, fF), according to Nyquist theorem the conversion rate fC must be at least 2f0; it means that the constant time of the filter is greater than or at least equal to twice the conversion period (TC). Again the conversion period TC is longer than the sampling time TS, which is just a portion of it, even when fixed channel continuous conversion mode is selected (fastest conversion rate at a specific channel): in conclusion it is evident that the time constant of the filter RFCF is definitively much higher than the sampling time TS, so the charge level on CS cannot be modified by the analog signal source during the time in which the sampling switch is closed. 138/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 42. Anti-aliasing filter and conversion rate $QDORJVRXUFHEDQGZLGWK 9$ 7&d5)&) FRQYHUVLRQUDWHYVILOWHUSROH 1RLVH I) I $QWLDOLDVLQJILOWHULQJFRQGLWLRQ IdI& 1\TXLVW I I $QWLDOLDVLQJILOWHU I) 5&ILOWHUSROH I) 6DPSOHGVLJQDOVSHFWUXP I& FRQYHUVLRQUDWH I I I& I *$3*5, The considerations above imposes new constraints on the external circuit, to reduce the accuracy error due to the voltage drop on CS. From the two charge balance equations above, it is simple to derive the following relation between the ideal and real sampled voltage on CS: VA C P1 + C P2 + C F ----------- = -----------------------------------------------------------V A2 C P1 + C P2 + C F + C S From this formula, in the worst case (when VA is maximum, that is for instance 5 V), assuming to accept a maximum error of half a count (~2.44 mV), a constraint is immediately evident on CF value: C F > 2048 C S In the next section an example of how to design the external network is provided, assuming some reasonable values for the internal parameters and making a hypothesis on the characteristics of the analog signal to be sampled. Example of external network sizing The following hypotheses are formulated in order to proceed in designing the external network on A/D converter input pins: Analog signal source bandwidth (f0): 10 kHz Conversion rate (fC): 25 kHz Sampling time (TS): 1s Pin input capacitance (CP1): 5 pF Pin input routing capacitance (CP2): 1 pF Sampling capacitance (CS): 4pF Maximum input current injection (IINJ): 3 mA Maximum analog source voltage (VAM): 12 V Analog source impedance (RS): 100 Channel switch resistance (RSW): 500 Sampling switch resistance (RAD): 200 Doc ID 12968 Rev 4 139/176 Electrical characteristics 1. ST10F272M Supposing a design of the filter, with the pole exactly at the maximum frequency of the signal, the time constant of the filter is: 1 R C C F = ------------ = 15.9s 2f 0 2. Using the relation between CF and CS and taking some margin (4000 instead of 2048), it is possible to define CF: C F = 4000 C S = 16nF 3. As a consequence of step 1 and 2, RC can be chosen: 1 R F = --------------------- = 995 1k 2f 0 C F 4. Considering the current injection limitation and supposing that the source can go up to 12 V, the total series resistance can be defined as: V AM R S + R F + R L = ------------- = 4k I INJ from which it is now simple to define the value of RL: V AM R L = ------------- - R F - R S = 2.9k I INJ 5. Now the three elements of the external circuit RF, CF and RL are defined. Some conditions discussed in the previous paragraphs have been used to size the component, the other must now be verified. The relation which allows minimization of the accuracy error introduced by the switched capacitance equivalent resistance is in this case: 1 R EQ = --------------- = 10M fC CS So the error due to the voltage partitioning between the real resistive path and CS is less then half a count (considering the worst case when VA = 5 V): R S + R F + R L + R SW + R AD 1 V A --------------------------------------------------------------------------- = 2.35mV < --- LSB 2 R EQ The other condition to be verified is if the time constants of the transients are really and significantly shorter than the sampling period duration TS: 1 = ( R SW + R AD ) C S = 2.8ns << TS = 1s 10 2 = 10 R L( C S + C P1 + C P2 ) = 290ns < TS = 1s For the complete set of parameters characterizing the ST10F272M A/D converter equivalent circuit, refer to Section 24.7: A/D converter characteristics on page 131. 140/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics 24.8 AC characteristics 24.8.1 Test waveforms Figure 43. Input/output waveforms 9 9 9 7HVWSRLQWV 9 9 9 $&LQSXWVGXULQJWHVWLQJDUHGULYHQDW9IRUDORJLFDQG9IRUDORJLF 7LPLQJPHDVXUHPHQWVDUHPDGHDW9,+PLQIRUDORJLFDQG9,/PD[IRUDORJLF *$3*5, Figure 44. Float waveforms 92+ 92+9 9/2$'9 7LPLQJ UHIHUHQFH 9/2$' SRLQWV 9/2$'9 92/9 92/ )RUWLPLQJSXUSRVHVDSRUWSLQLVQRORQJHUIORDWLQJZKHQ9/2$'FKDQJHVRIP9 ,WEHJLQVWRIORDWZKHQDP9FKDQJHIURPWKHORDGHG92+92/OHYHORFFXUV ,2+,2/ P$ *$3*5, 24.8.2 Definition of internal timing The internal operation of the ST10F272M is controlled by the internal CPU clock fCPU. Both edges of the CPU clock can trigger internal (for example, pipeline) or external (for example, bus cycles) operations. The specification of the external timing (AC characteristics) therefore depends on the time between two consecutive edges of the CPU clock, called `TCL'. The CPU clock signal can be generated by different mechanisms. The duration of TCL and its variation (and also the derived external timing) depends on the mechanism used to generate fCPU. This influence must be regarded when calculating the timings for the ST10F272M. The example for PLL operation shown in Figure 45 refers to a PLL factor of 4. The mechanism used to generate the CPU clock is selected during reset by the logic levels on pins P0.15-13 (P0H.7-5). Doc ID 12968 Rev 4 141/176 Electrical characteristics ST10F272M Figure 45. Generation mechanisms for the CPU clock 3KDVHORFNHGORRSRSHUDWLRQ I;7$/ I&38 7&/7&/ 'LUHFWFORFNGULYH I;7$/ I&38 7&/7&/ 3UHVFDOHURSHUDWLRQ I;7$/ I&38 7&/ 7&/ *$3*5, 24.8.3 Clock generation modes The next Table 61 associates the combinations of these three bits with the respective clock generation mode. Table 61. On-chip clock generator selections P0.15-13 (P0H.7-5) CPU frequency fCPU = fXTAL x F External clock input range(1)(3) 1 1 1 fXTAL x 4 4 to 8 MHz 1 1 0 fXTAL x 3 5.3 to 8 MHz 1 0 1 fXTAL x 8 4 to 5 MHz 1 0 0 fXTAL x 5 6.4 to 8 MHz 0 1 1 fXTAL x 1 1 to 40 MHz 0 1 0 fXTAL x 10 4 MHz 0 0 1 fXTAL/2 4 to 8 MHz 0 0 0 - - Notes Default configuration Direct drive (oscillator bypassed)(2) CPU clock via prescaler(3) Reserved 1. The external clock input range refers to a CPU clock range of 1...40 MHz. Moreover, the PLL usage is limited to 4-8 MHz. All configurations need a crystal (or ceramic resonator) to generate the CPU clock through the internal oscillator amplifier (apart from direct drive). Vice versa, the clock can be forced through an external clock source only in direct drive mode (on-chip oscillator amplifier disabled, so no crystal or resonator can be used). 2. The maximum depends on the duty cycle of the external clock signal. When 40 MHz is used, 50% duty cycle is granted (low phase = high phase = 12.5 ns); when 20 MHz is selected a 25 % duty cycle can be accepted (minimum phase, high or low, again equal to 12.5 ns). 3. The limits on input frequency are 4-8 MHz since the usage of the internal oscillator amplifier is required. Also when the PLL is not used and the CPU clock corresponds to fXTAL/2, an external crystal or resonator must be used: It is not possible to force any clock though an external clock source. 142/176 Doc ID 12968 Rev 4 ST10F272M 24.8.4 Electrical characteristics Prescaler operation When pins P0.15-13 (P0H.7-5) equal `001' during reset, the CPU clock is derived from the internal oscillator (input clock signal) by a 2:1 prescaler. The frequency of fCPU is half the frequency of fXTAL and the high and low time of fCPU (that is, the duration of an individual TCL) is defined by the period of the input clock fXTAL. The timings listed in the AC characteristics that refer to TCL therefore can be calculated using the period of fXTAL for any TCL. Note that if the bit OWDDIS in SYSCON register is cleared, the PLL runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. If bit OWDDIS is set, then the PLL is switched off. 24.8.5 Direct drive When pins P0.15-13 (P0H.7-5) equal `011' during reset the on-chip phase locked loop is disabled, the on-chip oscillator amplifier is bypassed and the CPU clock is directly driven by the input clock signal on XTAL1 pin. The frequency of CPU clock (fCPU) directly follows the frequency of fXTAL so the high and low time of fCPU (that is, the duration of an individual TCL) is defined by the duty cycle of the input clock fXTAL. Therefore, the timings given in this chapter refer to the minimum TCL. This minimum value can be calculated by the following formula: TCL min = 1 fXTALl xlDC min DC = duty cycle For two consecutive TCLs, the deviation caused by the duty cycle of fXTAL is compensated, so the duration of 2 TCL is always 1/fXTAL. The minimum value TCLmin has to be used only once for timings that require an odd number of TCLs (1,3,...). Timings that require an even number of TCLs (2,4,...) may use the formula: 2TCL = 1 f XTAL The address float timings in Multiplexed bus mode (t11 and t45) use the maximum duration of TCL (TCLmax = 1/fXTAL x DCmax) instead of TCLmin. Similarly to what happen for prescaler operation, if the bit OWDDIS in SYSCON register is cleared, the PLL runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. If bit OWDDIS is set, then the PLL is switched off. 24.8.6 Oscillator watchdog (OWD) An on-chip watchdog oscillator is implemented in the ST10F272M. This feature is used for safety operation with external crystal oscillator (available only when using direct drive mode with or without prescaler, so the PLL is not used to generate the CPU clock multiplying the frequency of the external crystal oscillator). This watchdog oscillator operates as following. The reset default configuration enables the watchdog oscillator. It can be disabled by setting the OWDDIS (bit 4) of SYSCON register. When the OWD is enabled, the PLL runs at its free-running frequency, and it increments the watchdog counter. On each transition of external clock, the watchdog counter is cleared. If Doc ID 12968 Rev 4 143/176 Electrical characteristics ST10F272M an external clock failure occurs, then the watchdog counter overflows (after 16 PLL clock cycles). The CPU clock signal will be switched to the PLL free-running clock signal, and the oscillator watchdog interrupt request is flagged. The CPU clock will not switch back to the external clock even if a valid external clock exits on XTAL1 pin. Only a hardware reset (or bidirectional software/watchdog reset) can switch the CPU clock source back to direct clock input. When the OWD is disabled, the CPU clock is always the external oscillator clock (in direct drive or prescaler operation) and the PLL is switched off to decrease consumption supply current. 24.8.7 Phase locked loop (PLL) For all other combinations of pins P0.15-13 (P0H.7-5) during reset the on-chip phase locked loop is enabled and it provides the CPU clock (see Table 61). The PLL multiplies the input frequency by the factor F which is selected via the combination of pins P0.15-13 (fCPU = fXTAL x F). With every F'th transition of fXTAL the PLL circuit synchronizes the CPU clock to the input clock. This synchronization is done smoothly, so the CPU clock frequency does not change abruptly. Due to this adaptation to the input clock the frequency of fCPU is constantly adjusted so it is locked to fXTAL. The slight variation causes a jitter of fCPU which also effects the duration of individual TCLs. The timings listed in the AC characteristics that refer to TCLs therefore must be calculated using the minimum TCL that is possible under the respective circumstances. The real minimum value for TCL depends on the jitter of the PLL. The PLL tunes fCPU to keep it locked on fXTAL. The relative deviation of TCL is the maximum when it is referred to one TCL period. This is especially important for bus cycles using wait states and for example, such as for the operation of timers or serial interfaces. For all slower operations and longer periods (for example, pulse train generation or measurement, or lower baudrates) the deviation caused by the PLL jitter is negligible. Refer to next Section 24.8.9: PLL jitter for more details. 144/176 Doc ID 12968 Rev 4 ST10F272M 24.8.8 Electrical characteristics Voltage controlled oscillator The ST10F272M implements a PLL which combines different levels of frequency dividers with a voltage controlled oscillator (VCO) working as frequency multiplier. The following table gives a detailed summary of the internal settings and VCO frequency. Table 62. Internal PLL divider mechanism PLL P0.15-13 (P0H.7-5) 1 1 1 XTAL frequency Input prescaler 4 to 8 MHz (1) Output CPU frequency prescaler fCPU = fXTAL x F Multiply by Divide by fXTAL/4 64 4 - fXTAL x 4 1 1 0 5.3 to 8 MHz fXTAL/4 48 4 - fXTAL x 3 1 0 1 4 to 5 MHz fXTAL/4 64 2 - fXTAL x 8 fXTAL/4 40 2 - fXTAL x 5 PLL bypassed - fXTAL x 1 40 - fXTAL x 10 fPLL/2 fXTAL/2 1 0 0 0 1 1 1 to 40 MHz - 0 1 0 4 MHz fXTAL/2 0 0 1 0 0 0 6.4 to 8 MHz(1) 4 to 8 MHz (1) - 2 PLL bypassed - 1. The PLL input frequency range is limited to 1 to 3.5 MHz, while the VCO oscillation range is 64 to 128 MHz. The CPU clock frequency range when PLL is used is 16 to 40 MHz. Example 1 fXTAL = 4 MHz P0(15:13) = `110' (multiplication by 3) PLL input frequency = 1 MHz VCO frequency = 48 MHz: NOT VALID, must be 64 to 128 MHz fCPU = NOT VALID Example 2 fXTAL = 8 MHz P0(15:13) = `100' (multiplication by 5) PLL input frequency = 2 MHz VCO frequency = 80 MHz PLL output frequency = 40 MHz (VCO frequency divided by 2) fCPU = 40 MHz (no effect of output prescaler) Doc ID 12968 Rev 4 145/176 Electrical characteristics 24.8.9 ST10F272M PLL jitter The following terminology is defined below: Self referred single period jitter Also called `period jitter', it can be defined as the difference of the Tmax and Tmin, where Tmax is maximum time period of the PLL output clock and Tmin is the minimum time period of the PLL output clock. Self referred long term jitter Also called `N period jitter', it can be defined as the difference of Tmax and Tmin, where Tmax is the maximum time difference between N+1 clock rising edges and Tmin is the minimum time difference between N+1 clock rising edges. Here N should be kept sufficiently large to have the long term jitter. For N = 1, this becomes the single period jitter. Jitter at the PLL output can be due to the following reasons: Jitter in the input clock Noise in the PLL loop Jitter in the input clock PLL acts like a low pass filter for any jitter in the input clock. Input clock jitter with the frequencies within the PLL loop bandwidth is passed to the PLL output and higher frequency jitter (frequency > PLL bandwidth) is attenuated @20dB/decade. Noise in the PLL loop This contribution again can be caused by the following sources: Device noise of the circuit in the PLL Noise in supply and substrate. Device noise of the circuit in the PLL The long term jitter is inversely proportional to the bandwidth of the PLL: the wider the loop bandwidth is, the lower the jitter is due to noise in the loop. Moreover, the long term jitter is practically independent of the multiplication factor. The most noise sensitive circuit in the PLL circuit is definitively the VCO (voltage controlled oscillator). There are two main sources of noise: thermal (random noise, frequencyindependent noise, thus, practically white noise) and flicker (low frequency noise, 1/f). For the frequency characteristics of the VCO circuitry, the effect of the thermal noise results in a 1/f2 region in the output noise spectrum, while the flicker noise in a 1/f3. Assuming a noiseless PLL input and supposing that the VCO is dominated by its 1/f2 noise, the RMS value of the accumulated jitter is proportional to the square root of N, where N is the number of clock periods within the considered time interval. On the contrary, assuming again a noiseless PLL input and supposing that the VCO is dominated by its 1/f3 noise, the RMS value of the accumulated jitter is proportional to N, where N is the number of clock periods within the considered time interval. The jitter in the PLL loop can be modelized as dominated by the i1/f2 noise for N smaller than a certain value depending on the PLL output frequency and on the bandwidth characteristics of loop. Above this first value, the jitter becomes dominated by the i1/f3 noise component. Lastly, for N greater than a second value of N, a saturation effect is evident, so the jitter does not grow anymore when considering a longer time interval (jitter stable increasing the number of clock periods N). The PLL loop acts as a high pass filter for any 146/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics noise in the loop, with cutoff frequency equal to the bandwidth of the PLL. The saturation value corresponds to what has been called self referred long term jitter of the PLL. In Figure 46 the maximum jitter trend versus the number of clock periods N (for some typical CPU frequencies) is shown: The curves represent the very worst case, computed taking into account all corners of temperature, power supply and process variations: The real jitter is always measured well below the given worst case values. Noise in supply and substrate Digital supply noise adds deterministic components to the PLL output jitter, independent of the multiplication factor. Its effects are strongly reduced thanks to the particular care used in the physical implementation and integration of the PLL module inside the device. Nonetheless, the contribution of the digital noise to the global jitter is widely taken into account in the curves provided in Figure 46. Figure 46. ST10F272M PLL jitter r 0+] 0+] 0+] 0+] 0+] -LWWHU>QV@ r r r r 7-,7 1 &38FORFNSHULRGV *$3*5, 24.8.10 PLL lock/unlock During normal operation, if the PLL gets unlocked for any reason, an interrupt request to the CPU is generated, and the reference clock (oscillator) is automatically disconnected from the PLL input: in this way, the PLL goes into free-running mode, providing the system with a backup clock signal (free running frequency ffree). This feature allows recovery from a crystal failure occurrence without risking to go into an undefined configuration: The system is provided with a clock allowing the execution of the PLL unlock interrupt routine in a safe mode. The path between reference clock and PLL input can be restored only by a hardware reset, or by a bidirectional software or watchdog reset event that forces the RSTIN pin low. Note: The external RC circuit on RSTIN pin must be properly sized in order to extend the duration of the low pulse to lock the PLL before the level at RSTIN pin is recognized high: A Doc ID 12968 Rev 4 147/176 Electrical characteristics ST10F272M bidirectional reset internally drives the RSTIN pin low for just 1024 TCL (definitly not sufficient to lock the PLL starting from free-running mode). Table 63. PLL characteristics (VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C) Value Symbol Parameter Conditions Unit Min Max tPSUP PLL start-up time(1) Stable VDD and reference clock - 300 s tLOCK PLL lock-in time Stable VDD and reference clock, starting from free-running mode - 250 s TJIT Single period jitter(1) (cycle to cycle = 2 TCL) 6 sigma time period variation (peak to peak) -500 +500 ps Multiplication factors: 3, 4 250 2000 ffree PLL free running frequency Multiplication factors: 5, 8, 10, 16 500 4000 kHz 1. Not 100 % tested, guaranteed by design characterization 24.8.11 Main oscillator specifications VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C Table 64. Main oscillator characteristics Value Symbol gm Parameter Conditions Oscillator transconductance Typ Max 1.4 2.6 4.2 mA/V Oscillation amplitude(1) Peak to peak - 1.5 - V VAV Oscillation voltage level(1) Sine wave middle - 0.8 - V Oscillator start-up time(1) Stable VDD - crystal - 6 10 ms tSTUP Stable VDD - resonator - 1 2 ms VOSC 1. Not 100% tested, guaranteed by design characterization 148/176 Unit Min Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 47. Crystal oscillator and resonator connection diagram 67)0 ;7$/ ;7$/ ;7$/ ;7$/ 67)0 &U\VWDO 5HVRQDWRU &$ &$ *$3*5, Table 65. Main oscillator negative resistance (module) CA = 15 pF CA = 25 pF CA = 35 pF Min Typ Max Min Typ Max Min Typ Max 4 MHz 545 1035 - 550 1050 - 430 850 - 8 MHz 240 450 - 170 350 - 120 250 - The given values of CA do not include the stray capacitance of the package and of the printed circuit board: the negative resistance values are calculated assuming additional 5 pF to the values in the table. The crystal shunt capacitance (C0) and the package capacitance between XTAL1 and XTAL2 pins is globally assumed equal to 10 pF. The external resistance between XTAL1 and XTAL2 is not necessary, since already present on the silicon. 24.8.12 32 kHz oscillator specifications VDD = 5 V 10%, VSS = 0 V, TA = -40 to +125 C Table 66. 32 kHz oscillator characteristics Value Symbol gm32 Parameter Conditions Oscillator transconductance(1) VOSC32 Oscillation amplitude(2) VAV32 Oscillation voltage level(2) tSTUP32 Oscillator startup time(2) Unit Min Typ Max Startup 20 31 50 A/V Normal run 8 17 30 A/V Peak to peak 0.5 1.0 2.4 V Sine wave middle 0.7 0.9 1.2 V - 1 5 s Stable VDD Doc ID 12968 Rev 4 149/176 Electrical characteristics ST10F272M 1. At power-on a high current biasing is applied for faster oscillation start-up. Once the oscillation is started, the current biasing is reduced to lower the power consumption of the system. 2. Not 100% tested, guaranteed by design characterization. Figure 48. 32 kHz crystal oscillator connection diagram ;7$/ ;7$/ 67)0 &U\VWDO &$ &$ *$3*5, Table 67. Minimum values of negative resistance (module) for 32 kHz oscillator Frequency CA = 6 pF CA = 12 pF CA = 15 pF CA = 18 pF CA = 22 pF CA = 27 pF CA = 33 pF 32 kHz - - - - 150 k 120 k 90 k The given values of CA do not include the stray capacitance of the package and of the printed circuit board: the negative resistance values are calculated assuming additional 5 pF to the values in the table. The crystal shunt capacitance (C0) and the package capacitance between XTAL3 and XTAL4 pins is globally assumed equal to 4 pF. The external resistance between XTAL3 and XTAL4 is not necessary, since already present on the silicon. Warning: 24.8.13 Direct driving on XTAL3 pin is not supported. Always use a 32 kHz crystal oscillator. External clock drive XTAL1 When direct drive configuration is selected during reset, it is possible to drive the CPU clock directly from the XTAL1 pin, without particular restrictions on the maximum frequency, since the on-chip oscillator amplifier is bypassed. The speed limit is imposed by internal logic that targets a maximum CPU frequency of 40 MHz. In all other clock configurations (direct drive with prescaler or PLL usage) the on-chip oscillator amplifier is not bypassed, so it determines the input clock speed limit. Then, when the on-chip oscillator is enabled it is forbidden to use any external clock source different from crystal or ceramic resonator. 150/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Table 68. External clock drive Parameter Symbol XTAL1 period(1)(2) tOSC SR time(3) Direct drive with prescaler fCPU = fXTAL/2 Direct drive fCPU = fXTAL PLL usage fCPU = fXTAL x F Unit Min Max Min Max Min Max 25 - 83.3 250 83.3 250 ns t1 SR 6 - 3 - 6 - ns (3) t2 SR 6 - 3 - 6 - ns (3) Rise time t3 SR - 2 - 2 - 2 ns Fall time(3) t4 SR - 2 - 2 - 2 ns High Low time 1. The minimum value for the XTAL1 signal period is considered the theoretical minimum. The real minimum value depends on the duty cycle of the input clock signal. 2. 4 to 8 MHz is the input frequency range when using an external clock source. 40 MHz can be applied with an external clock source only when direct drive mode is selected: in this case, the oscillator amplifier is bypassed so it does not limit the input frequency. 3. The input clock signal must reach the defined levels VIL2 and VIH2. Figure 49. External clock drive XTAL1 W W W 9,+ 9,/ W W26& *$3*5, Note: When direct drive is selected, an external clock source can be used to drive XTAL1. The maximum frequency of the external clock source depends on the duty cycle: When 40 MHz is used, 50% duty cycle is granted (low phase = high phase = 12.5 ns); when for instance 20 MHz is used, a 25 % duty cycle can be accepted (minimum phase, high or low, again equal to 12.5 ns). 24.8.14 Memory cycle variables The tables below use three variables which are derived from the BUSCONx registers and represent the special characteristics of the programmed memory cycle. The following table describes how these variables are to be computed. Table 69. Memory cycle variables Description Symbol Values ALE extension tA TCL x [ALECTL] Memory cycle time wait states tC 2TCL x (15 - [MCTC]) Memory tri-state time tF 2TCL x (1 - [MTTC]) Doc ID 12968 Rev 4 151/176 Electrical characteristics 24.8.15 ST10F272M External memory bus timing The following sections include the external memory bus timings. The given values are computed for a maximum CPU clock of 40 MHz. Note: 152/176 All external memory bus timings and SSC timings listed in the following tables are granted by design characterization and not fully tested in production. Doc ID 12968 Rev 4 ST10F272M 24.8.16 Electrical characteristics Multiplexed bus VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C, CL = 50 pF, ALE cycle time = 6 TCL + 2tA + tC + tF (75 ns at 40 MHz CPU clock without wait states) Table 70. Symbol Multiplexed bus timings fCPU = 40 MHz TCL = 12.5 ns Parameter Variable CPU clock 1/2 TCL = 1 to 40 MHz Unit Min Max Min Max 4 + tA - TCL - 8.5 + tA - ns 1.5 + tA - TCL - 11 + tA - ns t5 CC ALE high time t6 CC Address setup to ALE t7 CC Address hold after ALE 4 + tA - TCL - 8.5 + tA - ns t8 tCC ALE falling edge to RD, WR (with RW-delay) 4 + tA - TCL - 8.5 + tA - ns t9 CC ALE falling edge to RD, WR (no RW-delay) - 8.5 + tA - - 8.5 + tA - ns t10 CC Address float after RD, WR (with RW-delay)1 - 6 - 6 ns t11 CC Address float after RD, WR (no RW-delay)1 - 18.5 - TCL + 6 ns t12 CC RD, WR low time (with RW-delay) 15.5 + tC - 2TCL - 9.5 + tC - ns t13 CC RD, WR low time (no RW-delay) 28 + tC - 3TCL - 9.5 + tC - ns t14 SR RD to valid data in (with RW-delay) - 6 + tC - 2TCL - 19 + tC ns t15 SR RD to valid data in (no RW-delay) - 18.5 + tC - 3TCL - 19 + tC ns t16 SR ALE low to valid data in - 17.5 + tA + tC - 3TCL - 20 + tA + tC ns t17 SR Address/unlatched CS to valid data in - 20 + 2tA + tC - 4TCL - 30 + 2tA + tC ns t18 SR Data hold after RD rising edge 0 - 0 - ns t19 SR Data float after RD1 - 16.5 + tF - 2TCL - 8.5 + tF ns t22 CC Data valid to WR 10 + tC - 2TCL - 15 + tC - ns t23 CC Data hold after WR 4 + tF - 2TCL - 8.5 + tF - ns t25 CC ALE rising edge after RD, WR 15 + tF - 2TCL - 10 + tF - ns t27 CC Address/unlatched CS hold after RD, WR 10 + tF - 2TCL - 15 + tF - ns t38 CC ALE falling edge to latched CS - 4 - tA 10 - tA - 4 - tA 10 - tA ns t39 SR Latched CS low to valid data in - 16.5 + tC + 2tA - 3TCL - 21 + tC + 2tA ns t40 CC Latched CS hold after RD, WR 27 + tF - 3TCL - 10.5 + tF - ns Doc ID 12968 Rev 4 153/176 Electrical characteristics Table 70. Symbol ST10F272M Multiplexed bus timings (continued) fCPU = 40 MHz TCL = 12.5 ns Parameter Variable CPU clock 1/2 TCL = 1 to 40 MHz Min Max Min Max Unit t42 CC ALE fall. edge to RdCS, WrCS (with RW delay) 7 + tA - TCL - 5.5 + tA - ns t43 CC ALE fall. edge to RdCS, WrCS (no RW delay) -5.5 + tA - -5.5 + tA - ns t44 CC Address float after RdCS, WrCS (with RW delay)1 - 1.5 - 1.5 ns t45 CC Address float after RdCS, WrCS (no RW delay)1 - 14 - TCL + 1.5 ns t46 SR RdCS to valid data In (with RW delay) - 4 + tC - 2TCL - 21 + tC ns t47 SR RdCS to Valid Data In (no RW delay) - 16.5 + tC - 3TCL - 21 + tC ns t48 CC RdCS, WrCS low time (with RW delay) 15.5 + tC - 2TCL - 9.5 + tC - ns t49 CC RdCS, WrCS low time (no RW delay) 28 + tC - 3TCL - 9.5 + tC - ns t50 CC Data valid to WrCS 10 + tC - 2TCL - 15 + tC - ns t51 SR Data hold after RdCS 0 - 0 - ns t52 SR Data float after RdCS1 - 16.5 + tF - 2TCL - 8.5 + tF ns t54 CC Address hold after RdCS, WrCS 6 + tF - 2TCL - 19 + tF - ns t56 CC Data hold after WrCS 6 + tF - 2TCL - 19 + tF - ns 154/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 50. External memory cycle: Multiplexed bus, with/without read/write delay, normal ALE &/.287 $/( W W W W W W W W W &6[ W W W $$ $GGUHVV $$ %+( W 5HDGF\FOH $GGUHVVGDWD EXV 3 W W W $GGUHVV 'DWDLQ W W $GGUHVV W W 5' W W W W W :ULWHF\FOH W $GGUHVVGDWD EXV 3 $GGUHVV 'DWDRXW W :5 W :5/ :5+ W W W *$3*5, Doc ID 12968 Rev 4 155/176 Electrical characteristics ST10F272M Figure 51. External memory cycle: Multiplexed bus, with/without read/write delay, extended ALE W W W $/( W W W W W W &6[ W W $$ $GGUHVV $$ %+( W 5HDGF\FOH $GGUHVVGDWD EXV 3 W W 'DWDLQ $GGUHVV W W W W W W W 5' W W W :ULWHF\FOH $GGUHVVGDWD EXV 3 'DWDRXW $GGUHVV W W :5 W W W W :5/ :5+ W W *$3*5, 156/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 52. External memory cycle: Multiplexed bus, with/without r/w delay, normal ALE, r/w CS &/.287 W W W $/( W W W $$ $GGUHVV $$ %+( W 5HDGF\FOH $GGUHVVGDWD EXV 3 W W W $GGUHVV $GGUHVV 'DWDLQ W W W W 5G&6[ W W W W W :ULWHF\FOH $GGUHVVGDWD EXV 3 W 'DWDRXW $GGUHVV W W :U&6[ W W W *$3*5, Doc ID 12968 Rev 4 157/176 Electrical characteristics ST10F272M Figure 53. External memory cycle: Multiplexed bus, with/without r/w delay, extended ALE, r/w CS &/.287 W W W $/( W W $$ $GGUHVV $$ %+( W 5HDGF\FOH W $GGUHVVGDWD EXV 3 W 'DWDLQ $GGUHVV W W W W W W W 5G&6[ W W W :ULWHF\FOH $GGUHVVGDWD 'DWDRXW $GGUHVV EXV 3 W W W W W W :U&6[ W W *$3*5, 158/176 Doc ID 12968 Rev 4 ST10F272M 24.8.17 Electrical characteristics Demultiplexed bus VDD = 5 V 10%, VSS = 0 V, TA = -40 to +125 C, CL = 50 pF, ALE cycle time = 4 TCL + 2 tA + tC + tF (50 ns at 40 MHz CPU clock without wait states). Table 71. Symbol Demultiplexed bus timings . Parameter fCPU = 40 MHz TCL = 12.5 ns Variable CPU clock 1/2 TCL = 1 to 40 MHz Unit Min Max Min Max 4 + tA - TCL - 8.5 + tA - ns 1.5 + tA - TCL - 11 + tA - ns t5 CC ALE high time t6 CC Address setup to ALE t80 CC Address/Unlatched CS setup 12.5 + 2tA to RD, WR (with RW-delay) - 2TCL - 12.5 + 2tA - ns t81 CC Address/Unlatched CS setup to RD, WR (no RW-delay) 0.5 + 2tA - TCL - 12 + 2tA - ns t12 CC RD, WR low time (with RW-delay) 15.5 + tC - 2TCL - 9.5 + tC - ns t13 CC RD, WR low time (no RW-delay) 28 + tC - 3TCL - 9.5 + tC - ns t14 SR RD to valid data in (with RW-delay) - 6 + tC - 2TCL - 19 + tC ns t15 SR RD to valid data in (no RW-delay) - 18.5 + tC - 3TCL - 19 + tC ns t16 SR ALE low to valid data in - 17.5 + tA + tC - 3TCL - 20 + tA + tC ns t17 SR Address/Unlatched CS to valid data in - 20 + 2tA + tC - 4TCL - 30 + 2tA + tC ns t18 SR Data hold after RD rising edge 0 - 0 - ns t20 SR Data float after RD rising edge (with RW-delay)(1) - 16.5 + tF - 2TCL - 8.5 + tF + 2tA ns t21 SR Data float after RD rising edge (no RW-delay)(1) - 4 + tF - TCL - 8.5 + tF + 2tA ns t22 CC Data valid to WR 10 + tC - 2TCL - 15 + tC - ns t24 CC Data hold after WR 4 + tF - TCL - 8.5 + tF - ns t26 CC ALE rising edge after RD, WR -10 + tF - -10 + tF - ns t28 CC Address/unlatched CS hold after RD, WR(2) 0 + tF - 0 + tF - ns t28h CC Address/unlatched CS hold after WRH -5 + tF - -5 + tF - ns t38 CC ALE falling edge to latched CS -4 - tA 6 - tA -4 - tA 6 - tA ns t39 SR Latched CS low to valid data in - 16.5 + tC + 2tA - 3TCL - 21 + tC + 2tA ns Doc ID 12968 Rev 4 159/176 Electrical characteristics Table 71. Symbol ST10F272M Demultiplexed bus timings (continued) Parameter Latched CS hold after RD, WR fCPU = 40 MHz TCL = 12.5 ns Variable CPU clock 1/2 TCL = 1 to 40 MHz Unit Min Max Min Max 2 + tF - TCL - 10.5 + tF - ns t41 CC t82 Address setup to RdCS, CC WrCS (with RW-delay) 14 + 2tA - 2TCL - 11 + 2tA - ns t83 Address setup to RdCS, CC WrCS (no RW-delay) 2 + 2tA - TCL - 10.5 + 2 tA - ns t46 SR RdCS to valid data in (with RW-delay) - 4 + tC - 2TCL - 21 + tC ns t47 SR RdCS to valid data in (no RW-delay) - 16.5 + tC - 3TCL - 21 + tC ns t48 CC RdCS, WrCS low time (with RW-delay) 15.5 + tC - 2TCL - 9.5 + tC - ns t49 CC RdCS, WrCS low time (no RW-delay) 28 + tC - 3TCL - 9.5 + tC - ns t50 CC Data valid to WrCS 10 + tC - 2TCL - 15 + tC - ns t51 SR Data hold after RdCS 0 - 0 - ns t53 SR Data float after RdCS (with RW-delay)(3) - 16.5 + tF - 2TCL - 8.5 + tF ns t68 SR Data float after RdCS (no RW-delay)(3) - 4 + tF - TCL - 8.5 + tF ns t55 CC Address hold after RdCS, WrCS -8.5 + tF - -8.5 + tF - ns t57 CC Data hold after WrCS 2 + tF - TCL - 10.5 + tF - ns 1. RW-delay and tA refer to the next following bus cycle. 2. Read data is latched with the same clock edge that triggers the address change and the rising RD edge. Therefore address changes before the end of RD have no impact on read cycles. 3. Partially tested, guaranteed by design characterization. 160/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 54. External memory cycle: Demultiplexed bus, with/without r/w delay, normal ALE &/.287 W $/( W W W W W W WX W &6[ W W RUWK W $$ $GGUHVV $$ 3 %+( W 5HDGF\FOH 'DWDEXV 3 'DWDLQ '' '' W W W W W W 5' W W :ULWHF\FOH 'DWDEXV 3 '' '' 'DWDRXW W W W W :5 :5/ :5+ W W *$3*5, Doc ID 12968 Rev 4 161/176 Electrical characteristics ST10F272M Figure 55. External memory cycle: Demultiplexed bus, with/without r/w delay, extended ALE &/.287 W W W $/( W W W W W W &6[ W W W $$ $GGUHVV $$ 3 %+( W 5HDGF\FOH 'DWDEXV 3 'DWDLQ '' '' W W W W W W 5' W W :ULWHF\FOH 'DWDEXV 3 'DWDRXW '' '' W W W W :5 :5/ :5+ W W *$3*5, 162/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 56. External memory cycle: Demultipl. bus, with/without r/w delay, normal ALE, r/w CS &/.287 W W W $/( W W W $$ $GGUHVV $$ 3 %+( W 5HDGF\FOH 'DWDEXV 3 'DWDLQ '' '' W W W W W W 5G&6[ W W :ULWHF\FOH 'DWDEXV 3 'DWDRXW '' '' W W W W :U&6[ W W *$3*5, Doc ID 12968 Rev 4 163/176 Electrical characteristics ST10F272M Figure 57. External memory cycle: Demultiplexed bus, without r/w delay, extended ALE, r/w CS &/.287 W W W $/( W W W $$ $GGUHVV $$ 3 %+( W 5HDGF\FOH 'DWDEXV 3 'DWDLQ '' '' W W W W W W 5G&6[ W W :ULWHF\FOH 'DWDEXV 3 'DWDRXW '' '' W W W W :U&6[ W W *$3*5, 164/176 Doc ID 12968 Rev 4 ST10F272M 24.8.18 Electrical characteristics CLKOUT and READY VDD = 5 V 10 %, VSS = 0 V, TA = -40 to + 125 C, CL = 50 pF Table 72. CLKOUT and READY timings Symbol fCPU = 40 MHz TCL = 12.5ns Parameter Variable CPU clock 1/2 TCL = 1 to 40 MHz Unit Min Max Min Max t29 CC CLKOUT cycle time 25 25 2TCL 2TCL ns t30 CC CLKOUT high time 9 - TCL - 3.5 - ns t31 CC CLKOUT low time 10 - TCL - 2.5 - ns t32 CC CLKOUT rise time - 4 - 4 ns t33 CC CLKOUT fall time - 4 - 4 ns -2 + tA 8 + tA -2 + tA 8 + tA ns t35 SR Synchronous READY setup time to CLKOUT 17 - 17 - ns t36 SR Synchronous READY hold time after CLKOUT 2 - 2 - ns t37 SR Asynchronous READY low time 35 - 2TCL + 10 - ns 17 - 17 - ns 2 - 2 - ns 0 2tA + tC + tF 0 2tA + tC + tF ns t34 CC CLKOUT rising edge to ALE falling edge t58 SR Asynchronous READY setup t59 SR Asynchronous READY hold t60 SR time(1) time(1) Asynchronous READY hold time after RD, WR high (demultiplexed Bus)(2) 1. These timings are given for characterization purposes only, in order to assure recognition at a specific clock edge. 2. Demultiplexed bus is the worst case. For multiplexed bus 2 TCL are to be added to the maximum values. This adds even more time for deactivating READY. 2tA and tC refer to the next following bus cycle, tF refers to the current bus cycle. Doc ID 12968 Rev 4 165/176 Electrical characteristics ST10F272M Figure 58. CLKOUT and READY 5($'< ZDLWVWDWH 5XQQLQJF\FOH &/.287 W 08;WULVWDWH W W W W W $/( 5':5 W 6\QFKURQRXV W W W 5($'< $V\QFKURQRXV 5($'< W W W W W W *$3*5, 1. Cycle as programmed, including MCTC wait states (example shows 0 MCTC WS). 2. The leading edge of the respective command depends on RW-delay. 3. READY sampled HIGH at this sampling point generates a READY controlled wait state, READY sampled LOW at this sampling point terminates the currently running bus cycle. 4. READY may be deactivated in response to the trailing (rising) edge of the corresponding command (RD or WR). 5. If the Asynchronous READY signal does not fulfill the indicated setup and hold times with respect to CLKOUT (for example, because CLKOUT is not enabled), it must fulfill t37 in order to be safely synchronized. This is guaranteed, if READY is removed in response to the command (see Note 4). 6. Multiplexed bus modes have a MUX wait state added after a bus cycle, and an additional MTTC wait state may be inserted here. For a multiplexed bus with MTTC wait state this delay is two CLKOUT cycles, for a demultiplexed bus without MTTC wait state this delay is zero. 7. The next external bus cycle may start here. 166/176 Doc ID 12968 Rev 4 ST10F272M 24.8.19 Electrical characteristics External bus arbitration VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C, CL = 50 pF Table 73. External bus arbitration timings Symbol fCPU = 40 MHz TCL = 12.5ns Parameter Variable CPU clock 1/2 TCL = 1 to 40 MHz Min Max Min Max Unit t61 SR HOLD input setup time to CLKOUT 18.5 - 18.5 - ns t62 CC CLKOUT to HLDA high or BREQ low delay - 12.5 - 12.5 ns t63 CC CLKOUT to HLDA low or BREQ high delay - 12.5 - 12.5 ns - 20 - 20 ns -4 15 -4 15 ns - 20 - 20 ns -4 15 -4 15 ns t64 CC CSx release(1) t65 CC CSx drive t66 CC Other signals release (1) t67 CC Other signals drive 1. Partially tested, guaranteed by design characterization Figure 59. External bus arbitration (releasing the bus) &/.287 W +2/' W +/'$ W %5(4 W &6[ 3[ W 2WKHUV *$3*5, 1. The ST10F272M will complete the currently running bus cycle before granting bus access. 2. This is the first possibility for BREQ to become active. 3. The CS outputs will be resistive high (pull-up) after t64. Doc ID 12968 Rev 4 167/176 Electrical characteristics ST10F272M Figure 60. External bus arbitration (regaining the bus) &/.287 W +2/' W +/'$ W W W %5(4 W &6[ RQ3[ W 2WKHU VLJQDOV *$3*5, 1. This is the last chance for BREQ to trigger the indicated regain-sequence. Even if BREQ is activated earlier, the regainsequence is initiated by HOLD going high. Please note that HOLD may also be deactivated without the ST10F272M requesting the bus. 2. The next ST10F272M driven bus cycle may start here. 24.8.20 High-speed synchronous serial interface (SSC) timing 24.8.20.1 Master mode VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C, CL = 50 pF Table 74. Symbol SSC master mode timings Maximum baudrate 6.6 Mbaud(1) @ fCPU = 40 MHz ( = 0002h) Parameter Variable baudrate ( = 0001h - FFFFh) Min Max Min Max Unit t300 CC SSC clock cycle time(2) 150 150 8TCL 262144 TCL ns t301 CC SSC clock high time 63 - t300/2 - 12 - ns t302 CC SSC clock low time 63 - t300/2 - 12 - ns t303 CC SSC clock rise time - 10 - 10 ns t304 CC SSC clock fall time - 10 - 10 ns t305 CC Write data valid after shift edge - 15 - 15 ns -2 - -2 - ns t306 CC Write data hold after shift 168/176 edge(3) Doc ID 12968 Rev 4 ST10F272M Table 74. Electrical characteristics SSC master mode timings (continued) Symbol Maximum baudrate 6.6 Mbaud(1) @ fCPU = 40 MHz ( = 0002h) Parameter Read data setup time before latch t307p SR edge, phase error detection on (SSCPEN = 1) Variable baudrate ( = 0001h - FFFFh) Unit Min Max Min Max 37.5 - 2TCL + 12.5 - ns 50 - 4TCL - ns Read data hold time after latch t308p SR edge, phase error detection on (SSCPEN = 1) t307 Read data setup time before latch SR edge, phase error detection off (SSCPEN = 0) 25 - 2TCL - ns t308 Read data hold time after latch SR edge, phase error detection off (SSCPEN = 0) 0 - 0 - ns 1. When 40 MHz CPU clock is used the maximum baudrate cannot be higher than 6.6Mbaud ( = `2h') due to the limited granularity of . Value `1h' for can be used only with CPU clock equal to (or lower than) 32 MHz. 2. Formula for SSC clock cycle time: t300 = 4 TCL x ( + 1) Where represents the content of the SSC baudrate register, taken as unsigned 16-bit integer. Minimum limit allowed for t300 is 125 ns (corresponding to 8 Mbaud). 3. Partially tested, guaranteed by design characterization. Figure 61. SSC master timing W W W 6&/. W 0765 VWRXWELW W 0567 W W W W QGRXWELW W VWLQELW W /DVWRXWELW W QGLQELW W /DVWLQELW *$3*5, 1. The phase and polarity of shift and latch edge of SCLK is programmable. This figure uses the leading clock edge as shift edge (drawn in bold), with latch on trailing edge (SSCPH = 0b), Idle clock line is low, leading clock edge is low-to-high transition (SSCPO = 0b). 2. The bit timing is repeated for all bits to be transmitted or received. Doc ID 12968 Rev 4 169/176 Electrical characteristics ST10F272M 24.8.20.2 Slave mode VDD = 5 V 10 %, VSS = 0 V, TA = -40 to +125 C, CL = 50 pF Table 75. Symbol SSC slave mode timings Parameter Maximum baudrate 6.6 Mbaud(1) @ fCPU = 40 MHz ( = 0002h) Variable baudrate ( = 0001h - FFFFh) Min Max Min Max Unit t310 SR SSC clock cycle time(2) 150 150 8TCL 262144 TCL ns t311 SR SSC clock high time 63 - t310/2 - 12 - ns t312 SR SSC clock low time 63 - t310/2 - 12 - ns t313 SR SSC clock rise time - 10 - 10 ns t314 SR SSC clock fall time - 10 - 10 ns t315 CC Write data valid after shift edge - 55 - 2TCL + 30 ns t316 CC Write data hold after shift edge 0 - 0 - ns Read data setup time before latch t317p SR edge, phase error detection on (SSCPEN = 1) 62 - 4TCL + 12 - ns Read data hold time after latch t318p SR edge, phase error detection on (SSCPEN = 1) 87 - 6TCL + 12 - ns t317 Read data setup time before latch SR edge, phase error detection off (SSCPEN = 0) 6 - 6 - ns t318 Read data hold time after latch SR edge, phase error detection off (SSCPEN = 0) 31 - 2TCL + 6 - ns 1. When 40 MHz CPU clock is used the maximum baudrate cannot be higher than 6.6Mbaud ( = `2h') due to the limited granularity of . Value `1h' for may be used only with CPU clock lower than 32 MHz (after checking that resulting timings are suitable for the master). 2. Formula for SSC clock cycle time: t310 = 4 TCL * ( + 1) Where represents the content of the SSC baudrate register, taken as unsigned 16-bit integer. Minimum limit allowed for t310 is 125ns (corresponding to 8 Mbaud). 170/176 Doc ID 12968 Rev 4 ST10F272M Electrical characteristics Figure 62. SSC slave timing W W W 6&/. W VWRXWELW 0567 W 0765 W W W W QGRXWELW W VWLQELW W /DVWRXWELW W QGLQELW W /DVWLQELW *$3*5, 1. The phase and polarity of shift and latch edge of SCLK is programmable. This figure uses the leading clock edge as shift edge (drawn in bold), with latch on trailing edge (SSCPH = 0b), Idle clock line is low, leading clock edge is low-to-high transition (SSCPO = 0b). 2. The bit timing is repeated for all bits to be transmitted or received. Doc ID 12968 Rev 4 171/176 Package information ST10F272M 25 Package information 25.1 ECOPACK(R) packages In order to meet environmental requirements, ST offers these devices in different grades of ECOPACK(R) packages, depending on their level of environmental compliance. ECOPACK(R) specifications, grade definitions and product status are available at: www.st.com. ECOPACK(R) is an ST trademark. 25.2 LQFP144 mechanical data Figure 63. LQFP144 package dimension 1RWH([DFWVKDSHRIHDFKFRUQHULVRSWLRQDO % *$3*5, Table 76. LQFP144 mechanical data mm inches Dim Min Typ A 172/176 Max Min Typ 1.600 A1 0.050 A2 1.350 1.400 0.0630 0.150 0.0019 1.450 0.0531 Doc ID 12968 Rev 4 Max 0.0059 0.0551 0.0571 ST10F272M Package information Table 76. LQFP144 mechanical data (continued) mm inches Dim Min Typ Max Min Typ Max B 0.170 0.220 0.270 0.0067 0.0087 0.0106 C 0.090 0.200 0.0035 0.0089 D 22.000 0.8661 D1 20.000 0.7874 D3 17.500 0.6890 e 0.500 0.0197 E 22.000 0.8661 E1 20.000 0.7874 E3 17.500 0.6890 L L1 K 0.450 0.600 0.750 0.0177 1.000 0.0236 0.0295 0.0394 3.5 min, 7 max Doc ID 12968 Rev 4 173/176 Ordering information 26 ST10F272M Ordering information Table 77. Device summary Order code Package ST10F272MR-4T3 Packing 174/176 CPU frequency range (MHz) -40 to +125 1 to 40 Tray LQFP144 ST10F272MR-4TX3 Temperature range (C) Tape and reel Doc ID 12968 Rev 4 ST10F272M 27 Revision history Revision history Table 78. Document revision history Date Revision Changes 09-May-2007 1 Initial release 04-Jan-2008 2 Changed document status from Preliminary Data to DatasheetSection 4: Memory organization on page 21: Changed size of B0TF from 8 to 4Kbytes Table 2: Summary of IFlash address range on page 21: Changed size of B0TF from 8 to 4Kbytes Figure 5: Flash structure on page 25: Changed Test-Flash size from 8 to 4Kbytes Table 5: Flash modules sectorization (write operations or with ROMS1 = `1' or bootstrap mode) on page 26: Changed B0TF address and size (8 to 4Kbytes) Section 14: A/D converter on page 66: Replaced `40.630 CPU clock cycles' with `40630 CPU clock cycles' in end of section Table 52: Absolute maximum ratings on page 123: Changed VAREF value from "-0.3 to VDD" to "-0.5 to VDD + 0.5" Table 53: Recommended operating conditions on page 124: Added missing VAREF values. Table 56: DC characteristics on page 126: Changed max value for IPD1 from 200A to 150A Table 61: On-chip clock generator selections on page 142: - changed external clock input range for fXTAL x 8 - changed external clock input range for fXTAL x 1 - changed external clock input range for fXTAL x 10 - changed configuration from fXTAL x 16 to Reserved Table 62: Internal PLL divider mechanism on page 145: - changed external clock input range for fXTAL x 3 - changed external clock input range for fXTAL x 8 Table 76: PQFP144 mechanical data on page 173 and Table 76: LQFP144 mechanical data on page 172: Package mechanical data for inches converted to 4 decimal places 15-May-2012 3 Removed PQFP144 package . Update Table 77: Device summary. 18-Sep-2013 4 Updated Disclaimer Doc ID 12968 Rev 4 175/176 ST10F272M Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ("ST") reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST's terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST'S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. ST PRODUCTS ARE NOT DESIGNED OR AUTHORIZED FOR USE IN: (A) SAFETY CRITICAL APPLICATIONS SUCH AS LIFE SUPPORTING, ACTIVE IMPLANTED DEVICES OR SYSTEMS WITH PRODUCT FUNCTIONAL SAFETY REQUIREMENTS; (B) AERONAUTIC APPLICATIONS; (C) AUTOMOTIVE APPLICATIONS OR ENVIRONMENTS, AND/OR (D) AEROSPACE APPLICATIONS OR ENVIRONMENTS. WHERE ST PRODUCTS ARE NOT DESIGNED FOR SUCH USE, THE PURCHASER SHALL USE PRODUCTS AT PURCHASER'S SOLE RISK, EVEN IF ST HAS BEEN INFORMED IN WRITING OF SUCH USAGE, UNLESS A PRODUCT IS EXPRESSLY DESIGNATED BY ST AS BEING INTENDED FOR "AUTOMOTIVE, AUTOMOTIVE SAFETY OR MEDICAL" INDUSTRY DOMAINS ACCORDING TO ST PRODUCT DESIGN SPECIFICATIONS. PRODUCTS FORMALLY ESCC, QML OR JAN QUALIFIED ARE DEEMED SUITABLE FOR USE IN AEROSPACE BY THE CORRESPONDING GOVERNMENTAL AGENCY. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. (c) 2013 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 176/176 Doc ID 12968 Rev 4