![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
november 2011 doc id 13675 rev 7 1/28 AN2586 application note getting started with stm32f 10xxx hardware development introduction this application note is intended for system designers who require a hardware implementation overview of the development board features such as the power supply, the clock management, the reset control, the boot mode settings and the debug management. it shows how to use the low-density value line, low-density, medium-density value line, medium-density, high-density, xl-density and connectivity line stm32f10xxx product families and describes the minimum hardwar e resources required to develop an stm32f10xxx application. detailed reference design schematics are also contained in this document with descriptions of the main components, interfaces and modes. glossary low-density value line devices are stm32f100xx microcontrollers where the flash memory density ranges between 16 and 32 kbytes. low-density devices are stm32f101xx, stm32f102xx and stm32f103xx microcontrollers where the flash memory density ranges between 16 and 32 kbytes. medium-density value line devices are stm32f100xx microcontrollers where the flash memory density ranges between 64 and 128 kbytes. medium-density devices are stm32f100xx, stm32f101xx, stm32f102xx and stm32f103xx microcontrollers where the flash memory density ranges between 64 and 128 kbytes. high-density value line devices are stm32f100xx microcontrollers where the flash memory density ranges between 256 and 512 kbytes. high-density devices are stm32f101xx and stm32f103xx microcontrollers where the flash memory density ranges between 256 and 512 kbytes. xl-density devices are stm32f101xx and stm32f103xx microcontrollers where the flash memory density ranges between 768 kbytes and 1 mbyte. connectivity line devices are stm32f105xx and stm32f107xx microcontrollers. www.st.com
contents AN2586 2/28 doc id 13675 rev 7 contents 1 power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.1.1 independent a/d converter supply and reference voltage . . . . . . . . . . . . 6 1.1.2 battery backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.1.3 voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.2 power supply schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 reset and power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3.1 power on reset (por) / power down reset (pdr) . . . . . . . . . . . . . . . . . . 8 1.3.2 programmable voltage detector (pvd) . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.3.3 system reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2 clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1 hse osc clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.1.1 external source (hse bypass) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.1.2 external crystal/ceramic resonator (hse crystal) . . . . . . . . . . . . . . . . . 12 2.2 lse osc clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.1 external source (lse bypass) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.2 external crystal/ceramic resonator (lse crystal) . . . . . . . . . . . . . . . . . . 13 2.3 clock security system (css) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3 boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1 boot mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 boot pin connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.3 embedded boot loader mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4 debug management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.2 swj debug port (serial wire and jtag) . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.3 pinout and debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.3.1 swj debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.3.2 flexible swj-dp pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.3.3 internal pull-up and pull-down resistors on jtag pins . . . . . . . . . . . . . . 19 4.3.4 swj debug port connection with standard jtag connector . . . . . . . . . 19 AN2586 contents doc id 13675 rev 7 3/28 5 recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.1 printed circuit board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.2 component position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.3 ground and power supply (v ss , v dd ) . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.4 decoupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.5 other signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.6 unused i/os and features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 6 reference design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.1 description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.1.1 clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.1.2 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.1.3 boot mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.1.4 swj interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.1.5 power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 6.2 component references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 7 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 list of tables AN2586 4/28 doc id 13675 rev 7 list of tables table 1. boot modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 table 2. debug port pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 table 3. swj i/o pin availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 table 4. mandatory components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 table 5. optional components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 table 6. reference connection for all packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 table 7. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 AN2586 list of figures doc id 13675 rev 7 5/28 list of figures figure 1. power supply overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 figure 2. power supply scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 figure 3. power on reset/power down reset waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 figure 4. pvd thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 figure 5. reset circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 6. external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 figure 7. crystal/ceramic resonators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 figure 8. external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 figure 9. crystal/ceramic resonators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 figure 10. boot mode selection implementation example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 figure 11. host-to-board connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 figure 12. jtag connector implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 figure 13. typical layout for v dd /v ss pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 14. stm32f103ze(t6) microcontroller reference schematic . . . . . . . . . . . . . . . . . . . . . . . . . . 24 power supplies AN2586 6/28 doc id 13675 rev 7 1 power supplies 1.1 introduction the device requires a 2.0 v to 3.6 v operating voltage supply (v dd ). an embedded regulator is used to supply the internal 1.8 v digital power. the real-time clock (rtc) and backup registers can be powered from the v bat voltage when the main v dd supply is powered off. figure 1. power supply overview note: v dda and v ssa must be connected to v dd and v ss , respectively. 1.1.1 independent a/d converter supply and reference voltage to improve conversion accuracy, the adc has an independent power supply that can be filtered separately, and shielded from noise on the pcb. the adc voltage supply input is available on a separate v dda pin an isolated supply ground connection is provided on the v ssa pin when available (depending on package), v ref? must be tied to v ssa . on 100-pin and 144-pin packages to ensure a better accuracy on low-voltage inputs, the user can connect a separate external reference voltage adc input on v ref+ . the voltage on v ref+ may range from 2.4 v to v dda . a/d converter v dd v ss i/o ring bkp registers temp. sensor reset block standby circuitry pll (wakeup logic, iwdg) rtc voltage regulator core memories' digital peripherals low voltage detector (v ssa ) v ref? v dda domain v dd domain 1.8 v domain backup domain lse crystal 32 khz oscillator rcc bdcr register ai14863 (from 2.4 v up to v dda ) v ref+ (v dd ) v dda (v ss ) v ssa (v dd ) v bat AN2586 power supplies doc id 13675 rev 7 7/28 on packages with 64 pins or less the v ref+ and v ref- pins are not available, they are internally connected to the adc voltage supply (v dda ) and ground (v ssa ). 1.1.2 battery backup to retain the content of the backup registers when v dd is turned off, the v bat pin can be connected to an optional standby voltage supplied by a battery or another source. the v bat pin also powers the rtc unit, allowing the rtc to operate even when the main digital supply (v dd ) is turned off. the switch to the v bat supply is controlled by the power down reset (pdr) circuitry embedded in the reset block. if no external battery is used in the application, it is highly recommended to connect v bat externally to v dd . 1.1.3 voltage regulator the voltage regulator is always enabled after reset. it works in three different modes depending on the application modes. in run mode, the regulator supplies full power to the 1.8 v domain (core, memories and digital peripherals) in stop mode, the regulator supplies low power to the 1.8 v domain, preserving the contents of the registers and sram in standby mode, the regulator is powered off. the contents of the registers and sram are lost except for those concerned with th e standby circuitry and the backup domain. 1.2 power supply schemes the circuit is powered by a stabilized power supply, v dd . caution: ? if the adc is used, the v dd range is limited to 2.4 v to 3.6 v ? if the adc is not used, the v dd range is 2.0 v to 3.6 v the v dd pins must be connected to v dd with external decoupling capacitors (one 100 nf ceramic capacitor for each v dd pin + one tantalum or ceramic capacitor (min. 4.7 f typ.10 f). the v bat pin can be connected to the external battery (1.8 v < v bat < 3.6 v). if no external battery is used, it is recommended to connect this pin to v dd with a 100 nf external ceramic de coupling capacitor. the v dda pin must be connected to two external decoupling capacitors (100 nf ceramic + 1 f tantalum or ceramic). the v ref+ pin can be connected to the v dda external power supply. if a separate, external reference voltage is applied on v ref+ , a 100 nf and a 1 f capacitors must be connected on this pin. in all cases, v ref+ must be kept between 2.4 v and v dda . additional precautions can be taken to filter analog noise: ?v dda can be connected to v dd through a ferrite bead. ?the v ref+ pin can be connected to v dda through a resistor (typ. 47 ). power supplies AN2586 8/28 doc id 13675 rev 7 figure 2. power supply scheme 1. optional. if a separate, external reference voltage is connected on v ref+ , the two capacitors (100 nf and 1 f) must be connected. 2. v ref + is either connected to v dda or to v ref . 3. n is the number of v dd and v ss inputs. 1.3 reset and power supply supervisor 1.3.1 power on reset (por) / power down reset (pdr) the device has an integrated por/pdr circuitry that allows proper operation starting from 2v. the device remains in the reset mode as long as v dd is below a specified threshold, v por/pdr , without the need for an external reset circuit. for more details concerning the power on/power down reset threshold, refer to the electrical characteristics in the low- density, medium-density, high-density, xl-d ensity, and connectivity line stm32f10xxx datasheets. figure 3. power on reset/power down reset waveform v bat stm32f10xxx n 100 nf v dd + 1 10 f 100 nf + 1 f 100 nf + 1 f (note 1) battery v bat v ref+ v dda v ssa v ref? v dd 1/2/3/.../n v ss 1/2/3/.../n v ref v dd ai14865b v dd por pdr 40 mv hysteresis temporization t rsttempo reset ai14364 AN2586 power supplies doc id 13675 rev 7 9/28 1.3.2 programmable vo ltage detector (pvd) you can use the pvd to monitor the v dd power supply by comparing it to a threshold selected by the pls[2:0] bits in the power control register (pwr_cr). the pvd is enabled by setting the pvde bit. a pvdo flag is available, in the power control/status register (pwr_csr), to indicate whether v dd is higher or lower than the pvd threshold. this event is internally connected to exti line16 and can generate an interrupt if enabled through the exti registers. the pvd output interrupt can be generated when v dd drops below the pvd threshold and/or when v dd rises above the pvd threshold dependi ng on the exti line16 rising/falling edge configuration. as an example the service routine can perform emergency shutdown tasks. figure 4. pvd thresholds 1.3.3 system reset a system reset sets all register s to their reset values except for the reset flags in the clock controller csr register and the registers in the backup domain (see figure 1 ). a system reset is generated when one of the following events occurs: 1. a low level on the nrst pin (external reset) 2. window watchdog end-of-count condition (wwdg reset) 3. independent watchdog end-of-count condition (iwdg reset) 4. a software reset (sw reset) 5. low-power management reset the reset source can be identified by checking the reset flags in the control/status register, rcc_csr. v dd 100 mv hysteresis pvd threshold pvd output ai14365 power supplies AN2586 10/28 doc id 13675 rev 7 the stm32f1xx does not require an external rese t circuit to power-up correctly. only a pull- down capacitor is recommended to improve ems performance by protecting the device against parasitic resets. see figure 5 . charging and discharging a pull-down capacitor through an internal resistor increases the device power consumption. the capacitor recommended value (100 nf) can be reduced to 10 nf to limit this power consumption; figure 5. reset circuit 2 0 5 6 $ $ 6 $ $ ! 7 7 $ ' r e s e t ) 7 $ ' r e s e t 0 u l s e g e n e r a t o r 0 o w e r r e s e t m i n ? s 3 y s t e m r e s e t & |