![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
this is information on a product in full production. may 2013 doc id 13587 rev 15 1/105 1 stm32f103x8 stm32f103xb medium-density performance lin e arm-based 32-bit mcu with 64 or 128 kb flash, usb, can, 7 ti mers, 2 adcs, 9 com. interfaces datasheet ? production data features arm 32-bit cortex?-m3 cpu core ? 72 mhz maximum frequency, 1.25 dmips/mhz (dhrystone 2.1) performance at 0 wait state memory access ? single-cycle multiplication and hardware division memories ? 64 or 128 kbytes of flash memory ? 20 kbytes of sram clock, reset and supply management ? 2.0 to 3.6 v application supply and i/os ? por, pdr, and programmable voltage detector (pvd) ? 4-to-16 mhz crystal oscillator ? internal 8 mhz factory-trimmed rc ? internal 40 khz rc ? pll for cpu clock ? 32 khz oscillator for rtc with calibration low power ? sleep, stop and standby modes ?v bat supply for rtc and backup registers 2 x 12-bit, 1 s a/d converters (up to 16 channels) ? conversion range: 0 to 3.6 v ? dual-sample and hold capability ? temperature sensor dma ? 7-channel dma controller ? peripherals supported: timers, adc, spis, i 2 cs and usarts up to 80 fast i/o ports ? 26/37/51/80 i/os, all mappable on 16 external interrupt vectors and almost all 5 v-tolerant debug mode ? serial wire debug (swd) & jtag interfaces 7 timers ? three 16-bit timers, each with up to 4 ic/oc/pwm or pulse counter and quadrature (incremental) encoder input ? 16-bit, motor control pwm timer with dead- time generation and emergency stop ? 2 watchdog timers (independent and window) ? systick timer 24-bit downcounter up to 9 communication interfaces ? up to 2 x i 2 c interfaces (smbus/pmbus) ? up to 3 usarts (iso 7816 interface, lin, irda capability, modem control) ? up to 2 spis (18 mbit/s) ? can interface (2.0b active) ? usb 2.0 full-speed interface crc calculation unit, 96-bit unique id packages are ecopack ? table 1. device summary reference part number stm32f103x8 stm32f103c8, stm32f103r8 stm32f103v8, stm32f103t8 stm32f103xb stm32f103rb stm32f103vb, stm32f103cb, stm32f103tb bga100 10 10 mm ufbga100 7 x 7 mm bga64 5 5 mm vfqfpn36 6 6 mm lqfp100 14 14 mm lqfp64 10 10 mm lqfp48 7 7 mm ufqfpn48 7 7 mm www.st.com
contents stm32f103x8, stm32f103xb 2/105 doc id 13587 rev 15 contents 1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2 description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1 device overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2 full compatibility throughout the family . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3 overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.3.1 arm ? cortex?-m3 core with embedded flash and sram . . . . . . . . . 14 2.3.2 embedded flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.3.3 crc (cyclic redundancy check) calculation unit . . . . . . . . . . . . . . . . . . 14 2.3.4 embedded sram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.3.5 nested vectored interrupt controller (nvic) . . . . . . . . . . . . . . . . . . . . . . 14 2.3.6 external interrupt/event controller (exti) . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.7 clocks and startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.8 boot modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.9 power supply schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.10 power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.11 voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.12 low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3.13 dma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3.14 rtc (real-time clock) and backup registers . . . . . . . . . . . . . . . . . . . . . . 17 2.3.15 timers and watchdogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 2.3.16 i2c bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.17 universal synchronous/asynchronous receiver transmitter (usart) . . 19 2.3.18 serial peripheral interface (spi) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.19 controller area network (can) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.20 universal serial bus (usb) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.3.21 gpios (general-purpose inputs/outputs) . . . . . . . . . . . . . . . . . . . . . . . . 20 2.3.22 adc (analog-to-digital converter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.3.23 temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.3.24 serial wire jtag debug port (swj-dp) . . . . . . . . . . . . . . . . . . . . . . . . . 20 3 pinouts and pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4 memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 stm32f103x8, stm32f103xb contents doc id 13587 rev 15 3/105 5 electrical characteristi cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1 parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1.1 minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1.2 typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1.3 typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1.4 loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1.5 pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.1.6 power supply scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.1.7 current consumption measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.2 absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.3 operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.3.1 general operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.3.2 operating conditions at power-up / power-down . . . . . . . . . . . . . . . . . . 39 5.3.3 embedded reset and power control block characteristics . . . . . . . . . . . 39 5.3.4 embedded reference voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.3.5 supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 5.3.6 external clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.3.7 internal clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.3.8 pll characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.3.9 memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.3.10 emc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 5.3.11 absolute maximum ratings (electrical sensitivity) . . . . . . . . . . . . . . . . . 60 5.3.12 i/o current injection characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 5.3.13 i/o port characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 5.3.14 nrst pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 5.3.15 tim timer characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 5.3.16 communications interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 5.3.17 can (controller area network) interface . . . . . . . . . . . . . . . . . . . . . . . . . 75 5.3.18 12-bit adc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 5.3.19 temperature sensor characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 6 package characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 6.1 package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 6.2 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 6.2.1 reference document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 6.2.2 selecting the product temperature range . . . . . . . . . . . . . . . . . . . . . . . . 94 contents stm32f103x8, stm32f103xb 4/105 doc id 13587 rev 15 7 ordering information scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 8 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 stm32f103x8, stm32f103xb list of tables doc id 13587 rev 15 5/105 list of tables table 1. device summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 table 2. stm32f103xx medium-density device features and peripheral counts . . . . . . . . . . . . . . . 10 table 3. stm32f103xx family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 table 4. timer feature comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 table 5. medium-density stm32f103xx pin definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 table 6. voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 table 7. current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 table 8. thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 table 9. general operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 table 10. operating conditions at power-up / power-down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 11. embedded reset and power control block characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . 40 table 12. embedded internal reference voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1 table 13. maximum current consumption in run mode, code with data processing running from flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 table 14. maximum current consumption in run mode, code with data processing running from ram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 table 15. maximum current consumption in sleep mode, code running from flash or ram. . . . . . . 44 table 16. typical and maximum current consumptions in stop and standby modes . . . . . . . . . . . . 45 table 17. typical current consumption in run mode, code with data processing running from flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 table 18. typical current consumption in sleep mode, code running from flash or ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 table 19. peripheral current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 table 20. high-speed external user clock characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 table 21. low-speed external user clock characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 table 22. hse 4-16 mhz oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 table 23. lse oscillator characteristics (f lse = 32.768 khz) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 table 24. hsi oscillator characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 table 25. lsi oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 table 26. low-power mode wakeup timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 table 27. pll characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 table 28. flash memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 table 29. flash memory endurance and data retention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 table 30. ems characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 table 31. emi characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 table 32. esd absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 table 33. electrical sensitivities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 table 34. i/o current injection susceptibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 table 35. i/o static characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 table 36. output voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 table 37. i/o ac characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 table 38. nrst pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 table 39. timx characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 table 40. i 2 c characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 table 41. scl frequency (f pclk1 = 36 mhz.,v dd_i2c = 3.3 v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 table 42. spi characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 table 43. usb startup time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 table 44. usb dc electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 list of tables stm32f103x8, stm32f103xb 6/105 doc id 13587 rev 15 table 45. usb: full-speed electrical characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 table 46. adc characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 table 47. r ain max for f adc = 14 mhz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 48. adc accuracy - limited test conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 table 49. adc accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 table 50. ts characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 table 51. vfqfpn36 6 x 6 mm, 0.5 mm pitch, package mechanical data . . . . . . . . . . . . . . . . . . . . 82 table 52. ufqfpn48 7 x 7 mm, 0.5 mm pitch, package mechanical data . . . . . . . . . . . . . . . . . . . . 83 table 53. lfbga100 - 10 x 10 mm low profile fine pitch ball grid array package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 table 54. lqpf100, 14 x 14 mm 100-pin low-profile quad flat package mechanical data. . . . . . . . . 87 table 55. ufbga100 - ultra fine pitch ball grid array, 7 x 7 mm, 0.50 mm pitch, package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 table 56. lqfp64, 10 x 10 mm, 64-pin low-profile quad flat package mechanical data . . . . . . . . . . 89 table 57. tfbga64 - 8 x 8 active ball array, 5 x 5 mm, 0.5 mm pitch, package mechanical data. . . 90 table 58. lqfp48, 7 x 7 mm, 48-pin low-profile quad flat package mechanical data . . . . . . . . . . . . 92 table 59. package thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 table 60. ordering information scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 stm32f103x8, stm32f103xb list of figures doc id 13587 rev 15 7/105 list of figures figure 1. stm32f103xx performance line block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 figure 2. clock tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 figure 3. stm32f103xx performance line lfbga100 ballout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 4. stm32f103xx performance line lqfp100 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 5. stm32f103xx performance line ufbga100 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 figure 6. stm32f103xx performance line lqfp64 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 figure 7. stm32f103xx performance line tfbga64 ballout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 figure 8. stm32f103xx performance line lqfp48 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 9. stm32f103xx performance line ufqfpn48 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 figure 10. stm32f103xx performance line vfqfpn36 pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 figure 11. memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 figure 12. pin loading conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 figure 13. pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 figure 14. power supply scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 figure 15. current consumption measurement scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 figure 16. typical current consumption in run mode versus frequency (at 3.6 v) - code with data processing running from ram, peripherals enabled. . . . . . . . . . . . . . . . . . 43 figure 17. typical current consumption in run mode versus frequency (at 3.6 v) - code with data processing running from ram, peripherals disabled . . . . . . . . . . . . . . . . . 43 figure 18. typical current consumption on v bat with rtc on versus temperature at different v bat values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 figure 19. typical current consumption in stop mode with regulator in run mode versus temperature at v dd = 3.3 v and 3.6 v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 figure 20. typical current consumption in stop mode with regulator in low-power mode versus temperature at v dd = 3.3 v and 3.6 v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 figure 21. typical current consumption in standby mode versus temperature at v dd = 3.3 v and 3.6 v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 figure 22. high-speed external clock source ac timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 figure 23. low-speed external clock source ac timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 figure 24. typical application with an 8 mhz crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 figure 25. typical application with a 32.768 khz crystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 figure 26. standard i/o input characteristics - cmos port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 figure 27. standard i/o input characteristics - ttl port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4 figure 28. 5 v tolerant i/o input characteristics - cmos port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 figure 29. 5 v tolerant i/o input characteristics - ttl port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 figure 30. i/o ac characteristics definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 figure 31. recommended nrst pin protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 figure 32. i 2 c bus ac waveforms and measurement circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 figure 33. spi timing diagram - slave mode and cpha = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 figure 34. spi timing diagram - slave mode and cpha = 1 (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 figure 35. spi timing diagram - master mode (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 figure 36. usb timings: definition of data signal rise and fall time . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 figure 37. adc accuracy characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 figure 38. typical connection diagram using the adc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 figure 39. power supply and reference decoupling (v ref+ not connected to v dda ). . . . . . . . . . . . . . 79 figure 40. power supply and reference decoupling (v ref+ connected to v dda ). . . . . . . . . . . . . . . . . 80 figure 41. vfqfpn36 6 x 6 mm, 0.5 mm pitch, package outline (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 figure 42. recommended footprint (dimensions in mm) (1)(2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 list of figures stm32f103x8, stm32f103xb 8/105 doc id 13587 rev 15 figure 43. ufqfpn48 7 x 7 mm, 0.5 mm pitch, package outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 figure 44. recommended footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 figure 45. lfbga100 - 10 x 10 mm low profile fine pitch ball grid array package outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 figure 46. recommended pcb design rules (0.80/0.75 mm pitch bga) . . . . . . . . . . . . . . . . . . . . . . 86 figure 47. lqfp100, 14 x 14 mm 100-pin low-profile quad flat package outline . . . . . . . . . . . . . . . . 87 figure 48. recommended footprint (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 figure 49. ufbga100 - ultra fine pitch ball grid array, 7 x 7 mm, 0.50 mm pitch, package outline. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 figure 50. lqfp64, 10 x 10 mm, 64-pin low-profile quad flat package outline . . . . . . . . . . . . . . . . . . 89 figure 51. recommended footprint (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 figure 52. tfbga64 - 8 x 8 active ball array, 5 x 5 mm, 0.5 mm pitch, package outline . . . . . . . . . . 90 figure 53. recommended pcb design rules for pads (0.5 mm pitch bga) . . . . . . . . . . . . . . . . . . . . 91 figure 54. lqfp48, 7 x 7 mm, 48-pin low-profile quad flat package outline . . . . . . . . . . . . . . . . . . . . 92 figure 55. recommended footprint (1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 figure 56. lqfp100 p d max vs. t a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 stm32f103x8, stm32f103xb introduction doc id 13587 rev 15 9/105 1 introduction this datasheet provides the ordering information and mechanical device characteristics of the stm32f103x8 and stm32f103xb medium-density performance line microcontrollers. for more details on the whole stmicroelectronics stm32f103xx family, please refer to section 2.2: full compatib ility throughout the family . the medium-density stm32f103xx datasheet should be read in conjunction with the low-, medium- and high-density stm32f10xxx reference manual . the reference and flash programming manuals are both available from the stmicroelectronics website www.st.com. for information on the cortex?-m3 core please refer to the cortex?-m3 technical reference manual, available from the www.arm.com website at the following address: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337e/. 2 description the stm32f103xx medium-density performance line family incorporates the high- performance arm cortex?-m3 32-bit risc core operating at a 72 mhz frequency, high- speed embedded memories (flash memory up to 128 kbytes and sram up to 20 kbytes), and an extensive range of en hanced i/os and peri pherals connected to two apb buses. all devices offer two 12-bit adcs, three general purpose 16-bit timers plus one pwm timer, as well as standard and advanced communication interfaces: up to two i 2 cs and spis, three usarts, an usb and a can. the devices operate from a 2.0 to 3.6 v power supply. they are available in both the ?40 to +85 c temperature range and the ?40 to +105 c extended temperature range. a comprehensive set of power-saving mode allows the design of low-power applications. the stm32f103xx medium-density performance line family includes devices in six different package types: from 36 pins to 100 pins. depe nding on the device chosen, different sets of peripherals are included, the description below gives an overview of the complete range of peripherals proposed in this family. these features make the stm32f103xx medium-density performance line microcontroller family suitable for a wide range of applications such as motor drives, application control, medical and handheld equipment, pc and gaming peripherals, gps platforms, industrial applications, plcs, inverters, printers, scanners, alarm systems, video intercoms, and hvacs. description stm32f103x8, stm32f103xb 10/105 doc id 13587 rev 15 2.1 device overview table 2. stm32f103xx medium-density device features and peripheral counts peripheral stm32f103tx stm32f103cx stm32f103rx stm32f103vx flash - kbytes 64 128 64 128 64 128 64 128 sram - kbytes 20 20 20 20 timers general-purpose 33 3 3 advanced-control 11 1 1 communication spi 12 2 2 i 2 c 12 2 2 usart 23 3 3 usb 11 1 1 can 11 1 1 gpios 26 37 51 80 12-bit synchronized adc number of channels 2 10 channels 2 10 channels 2 16 channels (1) 1. on the tfbga64 package only 15 channels are av ailable (one analog input pin has been replaced by ?vref+?). 2 16 channels cpu frequency 72 mhz operating voltage 2.0 to 3.6 v operating temperatures ambient temperatures: ?40 to +85 c /?40 to +105 c (see ta bl e 9 ) junction temperature: ?40 to + 125 c (see ta bl e 9 ) packages vfqfpn36 lqfp48, ufqfpn48 lqfp64, tfbga64 lqfp100, lfbga100, ufbga100 stm32f103x8, stm32f103xb description doc id 13587 rev 15 11/105 figure 1. stm32f103xx performance line block diagram 1. t a = ?40 c to +105 c (junction temperature up to 125 c). 2. af = alternate function on i/o port pin. u s bdp/can_tx pa[ 15:0] exti wwdg 12 b it adc1 16af jtdi jtck/ s wclk jtm s / s wdio njtr s t tr s t jtdo nr s t v dd = 2 to 3 .6v 8 0af pb[ 15:0] pc[15:0] ahb2 mo s i,mi s o, s ck,n ss s ram 2x( 8 x16 b it) wakeup gpioa gpiob gpioc f m a x : 72 m hz v ss s cl, s da i2c2 v ref+ gp dma tim2 tim 3 xtal o s c 4-16 mhz xtal 3 2 khz o s c_in o s c_out o s c 3 2_out o s c 3 2_in pll & apb1 : f m a x =24 / 3 6 mhz pclk1 hclk clock managt pclk2 as af as af fl as h 12 8 kb volt. reg. 3 . 3 v to 1. 8 v power b a ck u p i nterf a ce as af tim 4 b us m a trix 64 b it inte rf a ce 20 kb rtc rc 8 mhz cortex-m 3 cpu i bu s d bus p bu s o b l fl as h s ram 512b tr a ce controlle r u s art1 u s art2 s pi2 b xcan 7 ch a nnel s b a ck u p reg 4 ch a nn el s tim1 3 co mpl. ch a nn el s s cl, s da, s mba i2c1 as af rx,tx, ct s , rt s , u s art 3 temp s en s or v ref- pd[15:0] gpiod pe[15:0] gpioe ahb:f m a x =4 8 /72 mhz etr a nd bkin 4 ch a nn el s 4 ch a nn el s 4 ch a nn el s fclk rc 40 khz s t a nd b y iwdg @vbat por / pdr s upply @vdda vdda v ss a @vdda v bat rx,tx, ct s , rt s , s m a rt c a rd as af rx,tx, ct s , rt s , ck, s m a rtc a rd as af apb2 : f m a x =4 8 / 72 mhz nvic s pi1 mo s i,mi s o, s ck,n ss as af 12 b i t adc2 if if if interf a ce @vdda s upervi s ion pvd r s t int @vdd ahb2 apb2 apb 1 awu tamper-rtc @vdd u s b 2.0 f s u s bdm/can_rx s y s tem a i14 3 90d traceclk traced[0: 3 ] as a s s w/jtag tpiu tr a ce/trig ck, s m a rtc a rd as af description stm32f103x8, stm32f103xb 12/105 doc id 13587 rev 15 figure 2. clock tree 1. when the hsi is used as a pll clock input, the maxi mum system clock frequency t hat can be achieved is 64 mhz. 2. for the usb function to be available, both hse and pll must be enabled, with usbclk running at 48 mhz. 3. to have an adc conversion time of 1 s, apb2 must be at 14 mhz, 28 mhz or 56 mhz. hse osc 4-16 mhz osc_in osc_out osc32_in osc32_out lse osc 32.768 khz hsi rc 8 mhz lsi rc 40 khz to independent watchdog (iwdg) pll x2, x3, x4 pllmul legend: mco clock output main pllxtpre /2 ..., x16 ahb prescaler /1, 2..512 /2 pllclk hsi hse apb1 prescaler /1, 2, 4, 8, 16 adc prescaler /2, 4, 6, 8 adcclk pclk1 hclk pllclk to ahb bus, core, memory and dma usbclk to usb interface to tim2, 3 and 4 usb prescaler /1, 1.5 to adc lse lsi hsi /128 /2 hsi hse peripherals to apb1 peripheral clock enable (13 bits) enable (3 bits) p eripheral clock apb2 prescaler /1, 2, 4, 8, 16 pclk2 to tim1 peripherals to apb2 peripheral clock enable (11 bits) enable (1 bit) peripheral clock 48 mhz 72 mhz max 72 mhz 72 mhz max 36 mhz max to rtc pllsrc sw mco css to cortex system timer /8 clock enable (3 bits) sysclk max rtcclk rtcsel[1:0] tim1clk timxclk iwdgclk sysclk fclk cortex free running clock tim2,3, 4 if (apb1 prescaler =1) x1 else x2 tim1 timer if (apb2 prescaler =1) x1 else x2 hse = high-speed external clock signal hsi = high-speed internal clock signal lsi = low-speed internal clock signal lse = low-speed external clock signal ai14903 flitfclk to flash programming interface stm32f103x8, stm32f103xb description doc id 13587 rev 15 13/105 2.2 full compatibility throughout the family the stm32f103xx is a complete family whose members are fully pin-to-pin, software and feature compatible. in the reference manual, the stm32f103x4 and stm32f103x6 are identified as low-density devices, the stm32f103x8 and stm32f103xb are referred to as medium-density devices, and the stm32f103xc, stm32f103xd and stm32f103xe are referred to as high-density devices. low- and high-density devices are an extension of the stm32f103x8/b devices, they are specified in the stm32f103x4/6 and stm32f103xc/d/e datasheets, respectively. low- density devices feature lower flash memory and ram capacities, less timers and peripherals. high-density devices have higher flash memory and ram capacities, and additional peripherals like sdio, fsmc, i 2 s and dac, while remaini ng fully compatible with the other members of the stm32f103xx family. the stm32f103x4, stm32f103x6, stm32f103xc, stm32f103xd and stm32f103xe are a drop-in replacement for stm32f103x8/b medium-density devices, allowing the user to try different memory densities and providing a greater degree of freedom during the development cycle. moreover, the stm32f103xx performance line fam ily is fully compatible with all existing stm32f101xx access line and stm32f102xx usb access line devices. table 3. stm32f103xx family pinout low-density devices medium-density devices high-density devices 16 kb flash 32 kb flash (1) 1. for orderable part numbers that do not show the a inte rnal code after the temperature range code (6 or 7), the reference datasheet for electric al characteristics is that of the stm32f103x8/b medium-density devices. 64 kb flash 128 kb flash 256 kb flash 384 kb flash 512 kb flash 6 kb ram 10 kb ram 20 kb ram 20 kb ram 48 kb ram 64 kb ram 64 kb ram 144 5 usarts 4 16-bit timers, 2 basic timers 3 spis, 2 i 2 ss, 2 i2cs usb, can, 2 pwm timers 3 adcs, 2 dacs, 1 sdio fsmc (100 and 144 pins) 100 3 usarts 3 16-bit timers 2 spis, 2 i 2 cs, usb, can, 1 pwm timer 2 adcs 64 2 usarts 2 16-bit timers 1 spi, 1 i 2 c, usb, can, 1 pwm timer 2 adcs 48 36 description stm32f103x8, stm32f103xb 14/105 doc id 13587 rev 15 2.3 overview 2.3.1 arm ? cortex?-m3 core with embedded flash and sram the arm cortex?-m3 processor is the latest generation of arm processors for embedded systems. it has been developed to provide a low-cost platform that meets the needs of mcu implementation, with a reduced pin count and low-power consumption, while delivering outstanding computational performance and an advanced system response to interrupts. the arm cortex?-m3 32-bit risc processor features exceptional code-efficiency, delivering the high-performance expected from an arm core in the memory size usually associated with 8- and 16-bit devices. the stm32f103xx performance line family having an embedded arm core, is therefore compatible with all arm tools and software. figure 1 shows the general block diagram of the device family. 2.3.2 embedded flash memory 64 or 128 kbytes of embedded flash is available for storing programs and data. 2.3.3 crc (cyclic redundanc y check) calculation unit the crc (cyclic redundancy check) calculation unit is used to get a crc code from a 32-bit data word and a fixed generator polynomial. among other applications, crc-based techniques are used to verify data transmission or storage integrity. in the scope of the en/iec 60335-1 standard, they offer a means of verifying the flash memory integrity. the crc ca lculation unit helps co mpute a signature of the software during runtime, to be compared with a reference signature generated at link- time and stored at a given memory location. 2.3.4 embedded sram twenty kbytes of embedded sram accessed (read/write) at cpu clock speed with 0 wait states. 2.3.5 nested vectored interrupt controller (nvic) the stm32f103xx performance line embeds a nested vectored interrupt controller able to handle up to 43 maskable interrupt channels (not including the 16 interrupt lines of cortex?-m3) and 16 priority levels. closely coupled nvic gives low-latency interrupt processing interrupt entry vector table address passed directly to the core closely coupled nvic core interface allows early processing of interrupts processing of late arriving higher priority interrupts support for tail-chaining processor state automatically saved interrupt entry restored on interrupt exit with no instruction overhead stm32f103x8, stm32f103xb description doc id 13587 rev 15 15/105 this hardware block provides flexible interrupt management features with minimal interrupt latency. 2.3.6 external interrupt /event controller (exti) the external interrupt/event controller consists of 19 edge detector lines used to generate interrupt/event requests. each line can be independently configured to select the trigger event (rising edge, falling edge, both) and can be masked independently. a pending register maintains the status of the interrupt requests. the exti can detect an external line with a pulse width shorter than the internal apb2 cl ock period. up to 80 gp ios can be connected to the 16 external interrupt lines. 2.3.7 clocks and startup system clock selection is performed on startup, however the internal rc 8 mhz oscillator is selected as default cpu clock on reset. an ex ternal 4-16 mhz clock can be selected, in which case it is monitored for failure. if failure is detected, the system automatically switches back to the internal rc oscillato r. a software interrupt is genera ted if enabled. similarly, full interrupt management of the pll clock entry is available when necessary (for example on failure of an indirectly used extern al crystal, resonator or oscillator). several prescalers allow the configurati on of the ahb frequenc y, the high-speed apb (apb2) and the low-speed apb (apb1) domains. the maximum frequency of the ahb and the high-speed apb domains is 72 mhz. the maximum allowed frequency of the low-speed apb domain is 36 mhz. see figure 2 for details on the clock tree. 2.3.8 boot modes at startup, boot pins are used to select one of three boot options: boot from user flash boot from system memory boot from embedded sram the boot loader is located in system memory. it is used to reprogram the flash memory by using usart1. for further details please refer to an2606. 2.3.9 power supply schemes v dd = 2.0 to 3.6 v: external power supply for i/os and the internal regulator. provided externally through v dd pins. v ssa , v dda = 2.0 to 3.6 v: external analog power supplies for adc, reset blocks, rcs and pll (minimum voltage to be applied to v dda is 2.4 v when the adc is used). v dda and v ssa must be connected to v dd and v ss , respectively. v bat = 1.8 to 3.6 v: power supply for rtc, external clock 32 khz oscillator and backup registers (through power switch) when v dd is not present. for more details on how to connect power pins, refer to figure 14: power supply scheme . 2.3.10 power supply supervisor the device has an integrated power-on reset (por)/power-down reset (pdr) circuitry. it is always active, and ensures proper operation starting from/down to 2 v. the device remains description stm32f103x8, stm32f103xb 16/105 doc id 13587 rev 15 in reset mode when v dd is below a specified threshold, v por/pdr , without the need for an external reset circuit. the device features an embedded programmable voltage detector (pvd) that monitors the v dd /v dda power supply and compares it to the v pvd threshold. an interrupt can be generated when v dd /v dda drops below the v pvd threshold and/or when v dd /v dda is higher than the v pvd threshold. the interrupt service routine can then generate a warning message and/or put the mcu into a safe state. the pvd is enabled by software. refer to table 11: embedded reset and power control block characteristics for the values of v por/pdr and v pvd . 2.3.11 voltage regulator the regulator has three operation modes: main (mr), low power (lpr) and power down. mr is used in the nominal regulation mode (run) lpr is used in the stop mode power down is used in standby mode: the regulator output is in high impedance: the kernel circuitry is powered down, inducing ze ro consumption (but the contents of the registers and sram are lost) this regulator is always enabled after reset. it is disabled in standby mode, providing high impedance output. 2.3.12 low-power modes the stm32f103xx performance line supports three low-power modes to achieve the best compromise between low power consumption, short startup time and available wakeup sources: sleep mode in sleep mode, only the cpu is stopped. all peripherals continue to operate and can wake up the cpu when an interrupt/event occurs. stop mode the stop mode achieves the lowest power consumption while retaining the content of sram and registers. all clocks in the 1.8 v domain are stopped, the pll, the hsi rc and the hse crystal oscillators are disabled. the voltage regulator can also be put either in normal or in low power mode. the device can be woken up from stop mode by any of the exti line. the exti line source can be one of the 16 external lines, the pvd output, the rtc alarm or the usb wakeup. standby mode the standby mode is used to achieve the lowest power consumption. the internal voltage regulator is switched off so that the entire 1.8 v domain is powered off. the pll, the hsi rc and the hse crystal oscillators are also switched off. after entering standby mode, sram and register contents are lost except for registers in the backup domain and standby circuitry. the device exits standby mode when an external reset (nrst pin), an iwdg reset, a rising edge on the wkup pin, or an rtc alarm occurs. note: the rtc, the iwdg, and the corresponding clock sources are not stopped by entering stop or standby mode. stm32f103x8, stm32f103xb description doc id 13587 rev 15 17/105 2.3.13 dma the flexible 7-channel general-purpose dma is able to manage memory-to-memory, peripheral-to-memory and memory-to-peripheral transfers. the dma controller supports circular buffer management avoiding the generation of interrupts when the controller reaches the end of the buffer. each channel is connected to dedicated hardware dma requests, with support for software trigger on each channel. configuration is made by software and transfer sizes between source and destination are independent. the dma can be used with the main peripherals: spi, i 2 c, usart, general-purpose and advanced-control timers timx and adc. 2.3.14 rtc (real-time cl ock) and backup registers the rtc and the backup registers are supplied through a switch that takes power either on v dd supply when present or through the v bat pin. the backup registers are ten 16-bit registers used to store 20 bytes of user application data when v dd power is not present. the real-time clock provides a set of continuo usly running counters which can be used with suitable software to provide a clock calendar function, and provides an alarm interrupt and a periodic interrupt. it is clocke d by a 32.768 khz external crysta l, resonator or oscillator, the internal low-power rc oscillator or the hi gh-speed external cloc k divided by 128. the internal low-power rc has a typical frequency of 40 khz. the rtc can be calibrated using an external 512 hz output to compensate for any natural crystal deviation. the rtc features a 32-bit programmable counter for long-term measurement using the compare register to generate an alarm. a 20-bit prescaler is used for the time base clock and is by default configured to generate a time base of 1 second from a clock at 32.768 khz. 2.3.15 timers and watchdogs the medium-density stm32f103xx performance line devices include an advanced-control timer, three general-purpose timers, two watchdog timers and a systick timer. ta bl e 4 compares the features of the advanced-control and general-purpose timers. table 4. timer feature comparison timer counter resolution counter type prescaler factor dma request generation capture/compare channels complementary outputs tim1 16-bit up, down, up/down any integer between 1 and 65536 ye s 4 ye s tim2, tim3, tim4 16-bit up, down, up/down any integer between 1 and 65536 ye s 4 n o description stm32f103x8, stm32f103xb 18/105 doc id 13587 rev 15 advanced-control timer (tim1) the advanced-control timer (tim1) can be seen as a three-phase pwm multiplexed on 6 channels. it has complementary pwm outputs with programmable inserted dead-times. it can also be seen as a complete general-purpose timer. the 4 independent channels can be used for input capture output compare pwm generation (edge- or center-aligned modes) one-pulse mode output if configured as a general-purpose 16-bit timer, it has the same features as the timx timer. if configured as the 16-bit pw m generator, it has full modu lation capability (0-100%). in debug mode, the advanced-control timer counter can be frozen and the pwm outputs disabled to turn off any power switch driven by these outputs. many features are shared with those of the general-purpose tim timers which have the same architecture. the advanced-control timer can therefore work together with the tim timers via the timer link feature for synchronization or event chaining. general-purpose timers (timx) there are up to three synchronizable general-purpose timers embedded in the stm32f103xx performance line devices. these timers are based on a 16-bit auto-reload up/down counter, a 16-bit prescaler and feature 4 independent channels each for input capture/output compare, pwm or one-pulse mode output. this gives up to 12 input captures/output compares/pwms on the largest packages. the general-purpose timers can work together with the advanced-control timer via the timer link feature for synchronization or event chaining. their counter can be frozen in debug mode. any of the general-purpose timers can be used to generate pwm outputs. they all have independent dma request generation. these timers are capable of handling quadrature (incremental) encoder signals and the digital outputs from 1 to 3 hall-effect sensors. independent watchdog the independent watchdog is based on a 12-bit downcounter and 8-bit prescaler. it is clocked from an independent 40 khz internal rc and as it operates independently of the main clock, it can operate in stop and standby modes. it can be used either as a watchdog to reset the device when a problem occurs, or as a free-running timer for application timeout management. it is hardware- or software-configurable through the option bytes. the counter can be frozen in debug mode. window watchdog the window watchdog is based on a 7-bit downc ounter that can be set as free-running. it can be used as a watchdog to reset the device when a problem occurs. it is clocked from the main clock. it has an early warning interrup t capability and the counter can be frozen in debug mode. stm32f103x8, stm32f103xb description doc id 13587 rev 15 19/105 systick timer this timer is dedicated for os, but could al so be used as a standard downcounter. it features: a 24-bit downcounter autoreload capability maskable system interrupt generation when the counter reaches 0 programmable clock source 2.3.16 i2c bus up to two i2c bus interfaces can operate in multimaster and slave modes. they can support standard and fast modes. they support dual slave addressing (7-bit only) and both 7/10-bit addressing in master mode. a hardware crc generation/verification is embedded. they can be served by dma and they support sm bus 2.0/pm bus. 2.3.17 universal sy nchronous/asynchronous receiver transmitter (usart) one of the usart interfaces is able to communicate at speeds of up to 4.5 mbit/s. the other available interfaces communicate at up to 2.25 mbit/s. they provide hardware management of the cts and rts signals, irda sir endec support, are iso 7816 compliant and have lin master/slave capability. all usart interfaces can be served by the dma controller. 2.3.18 serial perip heral interface (spi) up to two spis are able to communicate up to 18 mbits/s in slave and master modes in full- duplex and simplex communication modes. the 3-bit prescaler gives 8 master mode frequencies and the frame is configurable to 8 bits or 16 bits. the hardware crc generation/verification supports basic sd card/mmc modes. both spis can be served by the dma controller. 2.3.19 controller area network (can) the can is compliant with specifications 2.0a and b (active) with a bit rate up to 1 mbit/s. it can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers. it has three transmit mailboxes, two receive fifos with 3 stages and 14 scalable filter banks. 2.3.20 universal serial bus (usb) the stm32f103xx performance line embeds a usb device peripheral compatible with the usb full-speed 12 mbs. the usb interface implements a full-speed (12 mbit/s) function interface. it has software-configurable endpoint setting and suspend/resume support. the dedicated 48 mhz clock is generated from the internal main pll (the clock source must use a hse crystal oscillator). description stm32f103x8, stm32f103xb 20/105 doc id 13587 rev 15 2.3.21 gpios (genera l-purpose inputs/outputs) each of the gpio pins can be configured by software as output (push-pull or open-drain), as input (with or without pull-up or pull-down) or as peripheral alternate function. most of the gpio pins are shared with digital or analog alternate functions. all gpios are high current- capable. the i/os alternate function configuration can be locked if needed following a specific sequence in order to avoid spurious writing to the i/os registers. i/os on apb2 with up to 18 mhz toggling speed. 2.3.22 adc (analog-to -digital converter) two 12-bit analog-to-digital converters are embedded into stm32f103xx performance line devices and each adc shares up to 16 external channels, performing conversions in single- shot or scan modes. in scan mode, automatic conversion is performed on a selected group of analog inputs. additional logic functions embedded in the adc interface allow: simultaneous sample and hold interleaved sample and hold single shunt the adc can be served by the dma controller. an analog watchdog feature allows very precise monitoring of the converted voltage of one, some or all selected channels. an interrupt is generated when the converted voltage is outside the programmed thresholds. the events generated by the general-purpose timers (timx) and the advanced-control timer (tim1) can be internally connected to the adc start trigger, injection trigger, and dma trigger respectively, to allow the application to synchronize a/d conversion and timers. 2.3.23 temperature sensor the temperature sensor has to generate a voltage that varies linearly with temperature. the conversion range is between 2 v < v dda < 3.6 v. the temperature sensor is internally connected to the adc12_in16 input channel which is used to convert the sensor output voltage into a digital value. 2.3.24 serial wire jtag debug port (swj-dp) the arm swj-dp interface is embedded. and is a combined jtag and serial wire debug port that enables either a serial wire debug or a jtag probe to be connected to the target. the jtag tms and tck pins are shared with swdio and swclk, respectively, and a specific sequence on the tms pin is used to switch between jtag-dp and sw-dp. stm32f103x8, stm32f103xb pinouts and pin description doc id 13587 rev 15 21/105 3 pinouts and pin description figure 3. stm32f103xx performance line lfbga100 ballout ai16001c pe10 pc14- osc32_in pc5 pa5 pc3 pb4 pe15 pb2 pc4 pa4 h pe14 pe11 pe7 d pd4 pd3 pb8 pe3 c pd0 pc12 pe5 pb5 pc0 pe2 b pc11 pd2 pc15- osc32_out pb7 pb6 a 8 7 6 5 4 3 2 1 v ss_5 osc_in osc_out v dd_5 g f e pc1 v ref? pc13- tamper-rtc pb9 pa15 pb3 pe4 pe1 pe0 v ss_1 pd1 pe6 nrst pc2 v ss_3 v ss_4 nc v dd_3 v dd_4 pb15 v bat pd5 pd6 boot0 pd7 v ss_2 v ssa pa1 v dd_2 v dd_1 pb14 pa0-wkup 10 9 k j pd10 pd11 pa8 pa9 pa10 pa11 pa12 pc10 pa13 pa14 pc9 pc7 pc6 pd15 pc8 pd14 pe12 pb1 pa7 pb11 pe8 pb0 pa6 pb10 pe13 pe9 v dda pb13 v ref+ pa3 pb12 pa2 pd8 pd9 pd13 pd12 pinouts and pin description stm32f103x8, stm32f103xb 22/105 doc id 13587 rev 15 figure 4. stm32f103xx performance line lqfp100 pinout 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 vdd_2 vss_2 nc pa 1 3 pa 1 2 pa 1 1 pa 1 0 pa 9 pa 8 pc9 pc8 pc7 pc6 pd15 pd14 pd13 pd12 pd11 pd10 pd9 pd8 pb15 pb14 pb13 pb12 pa 3 vss_4 vdd_4 pa 4 pa 5 pa 6 pa 7 pc4 pc5 pb0 pb1 pb2 pe7 pe8 pe9 pe10 pe11 pe12 pe13 pe14 pe15 pb10 pb11 vss_1 vdd_1 vdd_3 vss_3 pe1 pe0 pb9 pb8 boot0 pb7 pb6 pb5 pb4 pb3 pd7 pd6 pd5 pd4 pd3 pd2 pd1 pd0 pc12 pc11 pc10 pa15 pa14 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 pe2 pe3 pe4 pe5 pe6 vbat pc13-tamper-rtc pc14-osc32_in pc15-osc32_out vss_5 vdd_5 osc_in osc_out nrst pc0 pc1 pc2 pc3 vssa vref- vref+ vdda pa 0 - w k u p pa 1 pa 2 ai14391 lqfp100 stm32f103x8, stm32f103xb pinouts and pin description doc id 13587 rev 15 23/105 figure 5. stm32f103xx performance line ufbga100 pinout ms30481v1 a b e d c f g h j k l m pe3 osc_in pc15 osc32_out pc14 rtc_tamper pe4 osc_out pc0 vssa vref- vref+ vdda pe1 pe5 pe2 pe6 vbat vss_5 vdd_5 nrst pc1 pc3 pa0 wkup1 pa1 pb8 pe0 pb9 vss_3 vss_4 vdd_4 pc2 pa2 pa3 pa4 boot0 pb7 vdd_3 pa5 pa6 pa7 pd7 pb6 pb5 pc4 pc5 pb0 pd5 pd6 pb2 pb1 pb4 pd4 pe8 pe7 pb3 pd3 pd2 pd9 pe10 pe9 pa15 pd1 pd0 pd8 pe12 pe11 pa14 pc12 pc11 pc8 pa9 pd15 pd12 pb15 pb10 pe13 pa13 pc10 nc pa8 pc7 pd14 pd11 pb14 pb11 pe14 vss_2 vdd_2 pa12 pa11 pa10 pc9 pc6 pd13 pd10 pb13 pb12 pe15 vss_1 vdd_1 pc13 osc32_in pinouts and pin description stm32f103x8, stm32f103xb 24/105 doc id 13587 rev 15 figure 6. stm32f103xx performance line lqfp64 pinout 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 17 18 19 20 21 22 23 24 29 30 31 32 25 26 27 28 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 vbat pc13-tamper-rtc pc14-osc32_in pc15-osc32_out pd0 osc_in pd1 osc_out nrst pc0 pc1 pc2 pc3 vssa vdda pa 0 - w k u p pa 1 pa 2 vdd_3 vss_3 pb9 pb8 boot0 pb7 pb6 pb5 pb4 pb3 pd2 pc12 pc11 pc10 pa 1 5 pa 1 4 vdd_2 vss_2 pa 1 3 pa 1 2 pa 1 1 pa 1 0 pa 9 pa 8 pc9 pc8 pc7 pc6 pb15 pb14 pb13 pb12 pa 3 vss_4 vdd_4 pa 4 pa 5 pa 6 pa 7 pc4 pc5 pb0 pb1 pb2 pb10 pb11 vss_1 vdd_1 lqfp64 ai14392 stm32f103x8, stm32f103xb pinouts and pin description doc id 13587 rev 15 25/105 figure 7. stm32f103xx performance line tfbga64 ballout ai15494 pb2 pc14- osc32_in pa7 pa4 pa2 pa15 pb11 pb1 pa6 pa3 h pb10 pc5 pc4 d pa8 pa9 boot0 pb8 c pc9 pa11 pb6 pc12 v dda pb9 b pa12 pc10 pc15- osc32_out pb3 pd2 a 8 7 6 5 4 3 2 1 v ss_4 osc_in osc_out v dd_4 g f e pc2 v ref+ pc13- tamper-rtc pb4 pa13 pa14 pb7 pb5 v ss_3 pc7 pc8 pc0 nrst pc1 pb0 pa5 pb14 v dd_2 v dd_3 pb13 v bat pc11 pa10 v ss_2 v ss_1 pc6 v ssa pa1 v dd_1 pb15 pb12 pa0-wkup pinouts and pin description stm32f103x8, stm32f103xb 26/105 doc id 13587 rev 15 figure 8. stm32f103xx performance line lqfp48 pinout figure 9. stm32f103xx performance line ufqfpn48 pinout 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 12 13 14 15 16 17 18 19 20 21 22 1 2 3 4 5 6 7 8 9 10 11 48 47 46 45 pa 3 pa 4 pa 5 pa 6 pa 7 pb0 pb1 pb2 pb10 pb11 vss_1 vdd_1 vdd_2 vss_2 pa 1 3 pa 1 2 pa 1 1 pa 1 0 pa 9 pa 8 pb15 pb14 pb13 pb12 vbat pc13-tamper-rtc pc14-osc32_in pc15-osc32_out pd0-osc_in pd1-osc_out nrst vssa vdda pa 0 - w k u p pa 1 pa 2 vdd_3 vss_3 pb9 pb8 boot0 pb7 pb6 pb5 pb4 pb3 pa 1 5 pa 1 4 lqfp48 ai14393b - 3 6 6 $ $ ? 6 3 3 ? 0 " 0 " " / / 4 0 " 0 " 0 " 0 " 0 " 0 ! 0 ! 0 ! 0 ! 0 ! 0 ! 0 ! 0 " 0 " 0 " 0 " 0 " 6 3 3 ? 6 $ $ ? 6 " ! 4 0 # 4 ! - 0 % 2 2 4 # 0 # / 3 # ? ) . 0 # / 3 # ? / 5 4 0 $ / 3 # ? ) . 0 $ / 3 # ? / 5 4 . 2 3 4 6 3 3 ! 6 $ $ ! 0 ! 7 + 5 0 0 ! 0 ! 6 $ $ ? 6 3 3 ? 0 ! 0 ! 0 ! 0 ! 0 ! 0 ! 0 " 0 " 0 " 0 " 1 & |