MSP学习笔记初识开发板和IDE
- 格式:docx
- 大小:51.30 KB
- 文档页数:4
STM32F20xxx_21xxx单⽚机硬件开发⼊门笔记AN3320Application noteGetting started with STM32F20xxx/21xxx MCUhardware developmentIntroductionThis application note is intended for system designers who require a hardwareimplementation overview of the development board features such as the power supply, theclock management, the reset control, the boot mode settings and the debug management. It shows how to use the high-density performance line STM32F20xxx/21xxx product familiesand describes the minimum hardware resources required to develop anSTM32F20xxx/21xxx application.Detailed reference design schematics are also contained in this document with descriptionsof the main components, interfaces and modes.August 2011Doc ID 18267 Rev 21/29/doc/20ec15b314791711cd7917a6.htmlContents AN3320Contents1Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.1Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.1.1Independent A/D converter supply and reference voltage . . . . . . . . . . . . 71.1.2Battery backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.1.3Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2Power supply schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.3Reset & power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.3.1Power on reset (POR) / power down reset (PDR) . . . . . . . . . . . . . . . . . . 91.3.2Programmable voltage detector (PVD) . . . . . . . . . . . . . . . . . . . . . . . . . 101.3.3System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.1HSE OSC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.1.1External source (HSE bypass) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.1.2External crystal/ceramic resonator (HSE crystal) . . . . . . . . . . . . . . . . . 132.2LSE OSC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2.1External source (LSE bypass) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.2.2External crystal/ceramic resonator (LSE crystal) . . . . . . . . . . . . . . . . . . 142.3Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.1Boot mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.2Boot pin connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.3Embedded boot loader mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174Debug management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.1Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.2SWJ debug port (serial wire and JTAG) . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3Pinout and debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3.1SWJ debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184.3.2Flexible SWJ-DP pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.3.3Internal pull-up and pull-down resistors on JT AG pins . . . . . . . . . . . . . . 194.3.4SWJ debug port connection with standard JTAG connector . . . . . . . . . 20 2/29 Doc ID 18267 Rev 2AN3320Contents5Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.1Printed circuit board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.2Component position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.3Ground and power supply (V SS, V DD) . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.4Decoupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215.5Other signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225.6Unused I/Os and features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226Reference design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.1Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.1.1Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.1.2Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.1.3Boot mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.1.4SWJ interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.1.5Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236.2Component references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 7Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Doc ID 18267 Rev 23/29List of tables AN3320 List of tablesTable 1.Boot modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Table 2.Debug port pin assignment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Table 3.SWJ I/O pin availability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Table 4.Mandatory components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Table 5.Optional components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Table 6.Reference connection for all packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Table 7.Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4/29 Doc ID 18267 Rev 2AN3320List of figures List of figuresFigure 1.Power supply overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Figure 2.Power supply scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Figure 3.Power-on reset/power-down reset waveform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Figure 4.PVD thresholds. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Figure 5.Reset circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Figure 6.HSE external clock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Figure 7.HSE crystal/ceramic resonators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Figure 8.LSE external clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 9.LSE crystal/ceramic resonators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 10.Boot mode selection implementation example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Figure 11.Host-to-board connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Figure 12.JTAG connector implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Figure 13.Typical layout for V DD/V SS pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Figure 14.STM32F207IG(H6) microcontroller reference schematic. . . . . . . . . . . . . . . . . . . . . . . . . . 25Doc ID 18267 Rev 25/29Power supplies AN33206/29 Doc ID 18267 Rev 21 Power supplies1.1 IntroductionThe device requires a 1.8V to 3.6V operating voltage supply (V DD ), excepted the WLCSPpackage witch requires 1.65V to 3.6V. An embedded regulator is used to supply the internal 1.2V 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.1.V DDA and V SSA must be connected to V DD and V SS , respectively.2.The voltage on V REF ranges from 1.65V to V DDA for WLCSP64+2 packages.AN3320Power suppliesDoc ID 18267 Rev 27/291.1.1 Independent A/D converter supply and reference voltageTo 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 pinWhen available (depending on package), V REF– must be tied to V SSA .On 100-pin package and above and on WLCSP64+2To 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 1.8V to V DDA . On WLCSP64+2, the V REF- pin is not available, it is internally connected to the ADC ground (V SSA ).On 64-pin packagesThe 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 backupTo retain the content of the Backup registers when V DD is turned off, the V BAT pin can beconnected 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 regulatorThe voltage regulator is always enabled after reset. It works in three different modesdepending on the application modes.●in Run mode, the regulator supplies full power to the 1.2V domain (core, memories and digital peripherals)●in Stop mode, the regulator supplies low power to the 1.2V domain, preserving the contents of the registers and SRAM●in Standby mode, the regulator is powered down. The contents of the registers and SRAM are lost except for those concerned with the Standby circuitry and the Backup domain.Note:Depending on the selected package, there are specific pins that should be connected either to V SS or V DD to activate or deactivate the voltage regulator. Refer to section "Voltage regulator" in STM32F20xxx/21xxx datasheet for details .Power supplies AN33208/29 Doc ID 18267 Rev 21.2 Power supply schemesThe circuit is powered by a stabilized power supply, V DD .●Caution:–The V DD voltage range is 1.8V to 3.6V (and 1.65V to 3.6V for WLCSP64+2 package)●The V DD pins must be connected to V DD with external decoupling capacitors: one single T antalum or Ceramic capacitor (min. 4.7µF typ.10µF) for the package + one 100nF Ceramic capacitor for each V DD pin.●The V BAT pin can be connected to the external battery (1.65V < V BA T < 3.6V). If no external battery is used, it is recommended to connect this pin to V DD with a 100nF external ceramic decoupling capacitor.●The V DDA pin must be connected to two external decoupling capacitors (100nF 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 100nF and a 1µF capacitors must be connected on this pin. In all cases, V REF+ must be kept between 1.65V 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Ω).●For the voltage regulator configuration, there are specific pins (REGOFF and IRROFF depending on the package) that should be connected either to VSS or VDD to activate or deactivate the voltage regulator specific. Refer to section "Voltage regulator" in STM32F20xxx/21xxx datasheet for details .●When the voltage regulator is enabled, V CAP1 and V CAP2 pins must be connected to 2*2.2µF Ceramic capacitor.AN3320Power suppliesDoc ID 18267 Rev 29/291.Optional. If a separate, external reference voltage is connected on V REF+, the two capacitors (100 nF and1µF) must be connected.2.V REF + is either connected to V REF or to V DDA .3.N is the number of V DD and V SS inputs.4.Refer to section "Voltage regulator" in STM32F20xxx/21xxx datasheet to connect REGOFF and IRROFFpins.1.3Reset & power supply supervisor1.3.1Power on reset (POR) / power down reset (PDR)The device has an integrated POR/PDR circuitry that allows proper operation starting from 1.8V .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 STM32F20xxx/21xxx datasheets.On WLCSP66 package if IRROFF pin is set to V DD (in that case REGOFF pin must not be activated, refer to section "Voltage regulator" in STM32F20xxx/21xxx datasheet for details ), the PDR is not functional. Then the V DD can lower below 1.8V , but the external circuitry must ensure that reset pin is activated when V DD /V DDA becomes below 1.65V .Power suppliesAN332010/29 Doc ID 18267 Rev 21.t RSTTEMPO is approximately2.6ms. V POR/PDR rising edge is 1.74V (typ.) and V POR/PDR falling edge is1.70V (typ.). Refer to STM32F20xxx/21xxx datasheets for actual value.1.3.2 Programmable voltage detector (PVD)Y ou can use the PVD to monitor the V DD power supply by comparing it to a thresholdselected 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 indicatewhether V DD is higher or lower than the PVD threshold. This event is internally connected to EXTI Line16 and can generatean 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 VDD rises above the PVD threshold depending on the EXTI Line16 rising/falling edge configuration. As an example the service routine can perform emergency shutdown tasks.AN3320Power suppliesDoc ID 18267 Rev 211/291.3.3 System resetA system reset sets all registers to their reset values except for the reset flags in the clockcontroller 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 resetThe reset source can be identified by checking the reset flags in the Control/Status register, RCC_CSR.The STM32F20xxx/21xxx does not require an external reset 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 (100nF) can be reduced to 10nF to limit this power consumption;Clocks AN332012/29 Doc ID 18267 Rev 22 ClocksThree different clock sources can be used to drive the system clock (SYSCLK):●HSI oscillator clock (high-speed internal clock signal)●HSE oscillator clock (high-speed external clock signal)●PLL clockThe devices have two secondary clock sources:●32kHz low-speed internal RC (LSI RC) that drives the independent watchdog and, optionally, the RTC used for Auto-wakeup from the Stop/Standby modes.●32.768kHz low-speed external crystal (LSE crystal) that optionally drives the real-time clock (RTCCLK)Each clock source can be switched on or off independently when it is not used, to optimize the power consumption.Refer to the STM32F20xxx/21xxx reference manual RM0033 for the description of the clock tree.2.1 HSE OSC clockThe high-speed external clock signal (HSE) can be generated from two possible clock sources:●HSE external crystal/ceramic resonator (see Figure 7)●HSE user external clock (see Figure 6)1.The value of R EXT depends on the crystal characteristics. Typical value is in the range of 5 to 6 R S(resonator series resistance).2.Load capacitance C L has the following formula: C L = C L1 x C L2 / (C L1 + C L2) + C stray where: C stray is the pincapacitance and board or trace PCB-related capacitance. Typically, it is between 2pF and 7pF. Please refer to Section 5: Recommendations on page 21 to minimize its value.Figure 6.HSE external clockFigure 7.HSE crystal/ceramicAN3320ClocksDoc ID 18267 Rev 213/292.1.1 External source (HSE bypass)In this mode, an external clock source must be provided. It can have a frequency from 1 to 16MHz (refer toSTM32F20xxx/21xxx datasheets for actual max value).The external clock signal (square, sine or triangle) with a duty cycle of about 50%, has to drive the OSC_IN pin while the OSC_OUT pin must be left in the high impedance state (see Figure 7 and Figure 6).2.1.2 External crystal/ceramic resonator (HSE crystal)The external oscillator frequency ranges from 4 to 26MHz.The external oscillator has the advantage of producing a very accurate rate on the mainclock. The associated hardware configuration is shown in Figure 7. Using a 25MHz oscillator frequency is a good choice to get accurate Ethernet, USB OTG high-speed peripheral, and I 2S.The resonator and the load capacitors have to be connected as close as possible to the oscillator pins in order to minimize output distortion and startup stabilization time. The load capacitance values must be adjusted according to the selected oscillator.For C L1 and C L2 it is recommended to use high-quality ceramic capacitors in the 5pF-to-25pF range (typ.), designed for high-frequency applications and selected to meet the requirements of the crystal or resonator. C L1 and C L2, are usually the same value. Thecrystal manufacturer typically specifies a load capacitance that is the series combination of C L1 and C L2. The PCB andMCU pin capacitances must be included when sizing C L1 and C L2 (10 pF can be used as a rough estimate of the combined pin and board capacitance).Refer to the electrical characteristics sections in the datasheet of your product for more details.Clocks AN332014/29 Doc ID 18267 Rev 22.2 LSE OSC clockThe low-speed external clock signal (LSE) can be generated from two possible clocksources:●LSE external crystal/ceramic resonator (see Figure 9)●LSE user external clock (see Figure 8)1.“LSE crystal/ceramic resonators” figure:To avoid exceeding the maximum value of C L1 and C L2 (15pF) it is strongly recommended to use a resonator with a load capacitance C L ≤7pF. Never use a resonator with a load capacitance of 12.5pF.2.“LSE external clock” and “LSEcrystal/ceramic resonators” figures:OSC32_IN and OSC32_OUT pins can be used also as GPIO, but it is recommended not to use them as both RTC and GPIO pins in the same application.3.“LSE crystal/ceramic resonators” figure:The value of R EXT depends on the crystal characteristics. A 0Ω resistor would work but would not be optimal. To fine tube R S value, refer to AN2867 - Oscillator design guide for ST microcontrollers.2.2.1 External source (LSE bypass)In this mode, an external clock source must be provided. It can have a frequency of up to 1MHz. The external clock signal (square, sine or triangle) with a duty cycle of about 50% has to drive the OSC32_IN pin while the OSC32_OUT pin must be left high impedance (see Figure 8).2.2.2 External crystal/ceramic resonator (LSE crystal)The LSE crystal is a 32.768kHz low-speed external crystal or ceramic resonator. It has theadvantage of providing a low-power, but highly accurate clock source to the real-time clock peripheral (RTC) forclock/calendar or other timing functions.The resonator and the load capacitors have to be connected as close as possible to the oscillator pins in order to minimize output distortion and startup stabilization time. The load capacitance values must be adjusted according to the selected oscillator.Figure 8.LSE external clockFigure 9.LSE crystal/ceramicAN3320ClocksDoc ID 18267 Rev 215/292.3 Clock security system (CSS)The clock security system can be activated by software. In this case, the clock detector is enabled after the HSE oscillator startup delay, and disabled when this oscillator is stopped.●If a failure is detected on the HSE oscillator clock, the oscillator is automaticallydisabled. A clock failure event is sent to the break input of the TIM1 advanced control timer and an interrupt is generated to inform the software about the failure (clocksecurity system interrupt CSSI), allowing the MCU to perform rescue operations. The CSSI is linked to the Cortex?-M3 NMI (non-maskable interrupt) exception vector.●If the HSE oscillator is used directly or indirectly as the system clock (indirectly means that it is used as the PLL input clock, and the PLL clock is used as the system clock), a detected failure causes a switch of the system clock to the HSI oscillator and thedisabling of the external HSE oscillator. If the HSE oscillator clock (divided or not) is the clock entry of the PLL used as system clock when the failure occurs, the PLL is disabled too.For details, see the STM32F20xxx/21xxx (RM0033) reference manuals available from the STMicroelectronics website /doc/20ec15b314791711cd7917a6.html .Boot configuration AN332016/29 Doc ID 18267 Rev 23 Boot configuration3.1 Boot mode selectionIn the STM32F20xxx/21xxx, three different boot modes can be selected by means of theBOOT[1:0] pins as shown in Table 1.The values on the BOOT pins are latched on the 4th rising edge of SYSCLK after a reset. It is up to the user to set the BOOT1 and BOOT0 pins after reset to select the required boot mode.The BOOT pins are also resampled when exiting the Standby mode. Consequently, they must be kept in the required Boot mode configuration in the Standby mode. After this startup delay has elapsed, the CPU fetches the top-of-stack value from address 0x0000 0000, and starts code execution from the boot memory starting from 0x0000 0004.3.2 Boot pin connectionFigure 10 shows the external connection required to select the boot memory of the STM32F20xxx/21xxx.1.Resistor values are given only as a typical example.Table 1.Boot modesBOOT mode selection pinsBoot mode AliasingBOOT1BOOT0x 0Main Flash memory Main Flash memory is selected as boot space01System memory System memory is selected as boot space11Embedded SRAMEmbedded SRAM is selected as boot spaceAN3320Boot configuration3.3 Embedded boot loader modeThe Embedded boot loader mode is used to reprogram the Flash memory using one of theavailable serial USART1(PA9/PA10), USART3(PB10/11 & PC10/11), CAN2(PB5/13) or USBOTG FS(PA11/12) in Device mode (DFU: device firmware upgrade).The USART peripheral operates with the internal 16MHz oscillator (HSI). The CAN andUSB OTG FS, however, can only function if an external clock (HSE) multiple of 1 MHz(between 4 and 26 MHz)is present.This embedded boot loader is located in the System memory and is programmed by STduring production.For additional information, refer to AN2606.Doc ID 18267 Rev 217/29Debug management AN332018/29 Doc ID 18267 Rev 24 Debug management4.1 IntroductionThe Host/Target interface is the hardware equipment that connects the host to theapplication board. This interface is made of three components: a hardware debug tool, a JTAG or SW connector and a cable connecting the host to the debug tool.Figure 11 shows the connection of the host to the evaluation board STM3220G-EVAL.Figure 11.Host-to-board connection 4.2 SWJ debug port (serial wire and JTAG)The STM32F20xxx/21xxx core integrates the serial wire / JT AG debug port (SWJ-DP). It is an ARM? standard CoreSight? debug port that combines a JTAG-DP (5-pin) interface and a SW-DP (2-pin) interface.●The JTAG debug port (JTAG-DP) provides a 5-pin standard JTAG interface to the AHP-AP port●The serial wire debug port (SW-DP) provides a 2-pin (clock + data) interface to the AHP-AP portIn the SWJ-DP , the two JTAG pins of the SW-DP are multiplexed with some of the five JTAG pins of the JTAG-DP .4.3 Pinout and debug port pinsThe STM32F20xxx/21xxx MCU is offered in various packages with different numbers of available pins. As a result, some functionality related to the pin availability may differ from one package to another.4.3.1 SWJ debug port pinsFive pins are used as outputs for the SWJ-DP as alternate functions of general-purpose I/Os (GPIOs). These pins, shown in Table 2, are available on all packages.%VALUATION BOARD(OST 0#0OWER SUPPLY*4!' 37 CONNECTOR$EBUG TOOLAI BAN3320Debug managementDoc ID 18267 Rev 219/294.3.2 Flexible SWJ-DP pin assignmentAfter reset (SYSRESETn or PORESETn), all five pins used for the SWJ-DP are assigned as dedicated pins immediately usable by the debugger host (note that the trace outputs are not assigned except if explicitly programmed by the debugger host).However, some of the JTAG pins shown in Table 3 can be configured to an alternate function through the GPIOx_AFRx registers.Table 3 shows the different possibilities to release some pins.For more details, see the STM32F20xxx/21xxx (RM0033) reference manual, available from the STMicroelectronics website /doc/20ec15b314791711cd7917a6.html .4.3.3 Internal pull-up and pull-down resistors on JTAG pinsThe JTAG input pins must not be floating since they are directly connected to flip-flops to control the debug mode features. Special care must be taken with the SWCLK/TCK pin that is directly connected to the clock of some of these flip-flops. Table 2.Debug port pin assignmentSWJ-DP pin nameJTAG debug portSW debug portPinassignment TypeDescription Type Debug assignment JTMS/SWDIO I JTAG test mode selection I/O Serial wire data input/output PA13JTCK/SWCLK I JTAG test clock I Serial wire clock P A14JTDII JTAG test data input --P A15JTDO/TRACESWO O JTAG test data output -TRACESWO if async traceis enabled PB3JNTRSTIJTAG test nReset。
st cubeide flash烧写算法随着嵌入式系统的不断发展,对于Flash烧写算法的需求也越来越大。
作为一种重要的存储介质,Flash在嵌入式系统中扮演着至关重要的角色。
而st cubeide作为一款嵌入式开发工具,其Flash烧写算法更是备受关注。
本文将就st cubeide Flash烧写算法展开详细的介绍和分析。
一、st cubeide概述st cubeide是由意法半导体公司(STMicroelectronics)推出的集成开发环境(IDE),主要用于开发和调试ST的STM32系列单片机。
st cubeide具有强大的功能和丰富的工具链,对于嵌入式系统的开发十分便捷高效。
二、Flash烧写算法的重要性Flash烧写算法是指将程序或数据写入Flash中的一种算法,它直接关系到嵌入式系统的可靠性和稳定性。
在嵌入式系统中,Flash烧写算法的良好性能对于产品的质量和稳定性具有至关重要的作用。
Flash烧写算法的设计和实现是开发工程师们需要重点关注和深入研究的技术方向之一。
三、st cubeide Flash烧写算法的实现st cubeide针对不同的STM32系列单片机,为开发者提供了灵活多样的Flash烧写算法实现方式。
在st cubeide中,通过设置Flash烧写算法的参数、选择合适的算法模块等操作,即可轻松实现对Flash的烧写和擦除。
st cubeide灵活丰富的Flash烧写算法接口,使得开发者能够便捷快速地完成对Flash的操作,大大提高了开发效率。
四、st cubeide Flash烧写算法的优势相比于其他开发工具,st cubeide具有独特的优势和特点,使得其在Flash烧写算法的实现上具有明显的优势。
st cubeide提供了丰富的示例代码和文档,方便开发者学习和使用。
st cubeide具有友好的用户界面和强大的调试功能,能够帮助开发者快速定位和解决问题。
再次,st cubeide支持多种连接方式,包括仿真器、调试器等,满足不同场景下的需求。
Open429Z-D User ManualContents1. Hardware introduction (2)1.1. What’s on board (2)2. Demo (4)2.1. ADC+DMA (4)2.2. CAN1 TO CAN2-Normal (5)2.3. DAC (5)2.4. DS18B20 (6)2.5. OV2640 (6)2.6. GPIO_Key (7)2.7. I2C (7)2.8. I2S_UDA1380 (8)2.9. NandFlash_SCB0 (8)2.10. SAI (9)2.11. SD_FatFS (9)2.12. SDIO (9)2.13. SPI (10)2.14. USART (11)3. Version update records (11)1. Hardware introduction 1.1. What’s on board[ Core interface ]1. STM32F429I-DISCO socketfor easily connecting the STM32F429I-DISCO 2. MCU pins connectorall the MCU I/O ports are accessible onexpansion connectors for further expansion 3. USB connectorUSB to UART via PL2303 USB TO UART board onboard MCU4. I2C1 / I2C2interface[ Other interfaces ]16. 5V DC jack17. 5V/3.3 V power input/outputusually used as power output, alsocommon-grounding with other user board 18. JTAG/SWD interfacefor debugging/programming[ Jumper ]easily connects to I2C peripherals such as I/O expander (PCF8574), FRAM (FM24CLXX), etc. 5. I2S2 / I2S3 / I2C1 interfacefor connecting I2S peripherals, such as Audio module.6. DCMI interfacefor connecting camera module 7. SDIO interfacefor connecting Micro SD module, features much faster access speed rather than SPI 8. CAN1 interfacecommunicates with accessory boards which feature the CAN device conveniently 9. CAN2 interfacecommunicates with accessory boards which feature the CAN device conveniently 10. UART3 interfaceeasily connects to RS232, RS485, USB TO 232, etc11. SPI1/SPI4 + AD/DA interfaceeasily connects to SPI peripherals such as DataFlash (AT45DBxx), SD card, MP3 module, etc MP3SPI1 features AD/DA alternative function, supports connecting AD/DA module as well 12. UART2 interfaceeasily connects to RS232, RS485, USB TO 232, etc13. 8-bit FSMC interfaceeasily connects to peripherals such as NandFlash, Ethernet, etc 14. SAI1 interfacefor connecting Audio peripherals, such as UDA1380 etc15. One-WIRE interfaceeasily connects to ONE-WIRE devices (TO-92 package), such as temperature sensor (DS18B20), electronic registration number (DS2401), etc.16. Joystick jumpershort the jumper to connect the joystick to default I/Os used in example code;open the jumper to connect the joystick to custom I/Os via jumper wires. 17. BOOT mode switchfor configuring BOOT0 pin 18. USB TO UART jumper[ Components ] 16. AMS1117-3.33.3V voltage regulator 17. PL2303USB to UART MCU 18. 5V DC jack 19. Power LED20. UART1 indicator LED 21. Joystickfive positions2. DemoKEIL MDK Version :4.7Programmer/Debugger: STM32F429I-DISCO onboard ST-LINK V2 Programming/Debugging interface: SWDConnect PC to the onboard USB TO UART connector via USB wireSerial port settings:2.1. ADC+DMA◆ OverviewAD acquisition demo◆ Hardware connectionConnect Analog Test Boardto SPI1(ADC+DAC )connector◆ Operation and resultRotate the onboard potentiometer, the below message will be printed on the serial debugging assistant:Select a proper COM port Baud rate115200Data bits 8Stop bits 1 Parity bits None Flow controlNone2.2. CAN1 TO CAN2-Normal◆ OverviewCAN demo◆ Hardware connection◆ Hardware connectionConnect the two CAN modules to theonboard CAN interfaces◆ Operation and resultYou may see the below result on the serial debugging assistant:2.3. DAC◆ OverviewDAC demo◆ Hardware connectionConnect the Analog Test Board to the SPI1(ADC+DAC )connectorConnect the Analog Test Board onboard 5Vinterface to the board onboard 5V interface viajumper wire.◆ Operation and resultYou may hear sound from the Analog Test Board2.4. DS18B20◆ OverviewDS18B20 demo◆ Hardware connectionConnect the DS18B20 module to the one-wire connector ◆ Operation and resultThe below information will be printed on the serial debugging assistant2.5. OV2640◆ OverviewCamera OV2640 demo ◆ Hardware connectionConnect the OV2640 Camera Board tothe onboard DCMMI connectorLaunch the serial debugging assistant, configuring the data as below: COM: COM3Baud rate: 115200 Data bits: 8 Parity bits: NO Stop bits: 1◆ Operation and result:Press “user” key, the captured image displayed on the serial debugging assistant:2.6. GPIO_Key◆ Overviewjoystick demo◆ Hardware connectionShort the JOYSTICK JMP on board ◆ Operation and resultPress the joystick, message will be printed on the serial debugging assistant accordingly.2.7. I2C◆ OverviewI2C EEPROM demo ◆ Hardware connectionConnect the AT24/FM24 Board to the board viaI2C connector (I2C1 or I2C2, depending on the software configuration).◆ Software configurationThe module connect to I2C1 connectorThe module connect to I2C2 connector #define Open_I2C1 //#define Open_I2C2//#define Open_I2C1 #define Open_I2C2◆ Operation and resultThe below information will be printed on the serial debugging assistant:2.8. I2S_UDA1380◆ OverviewI2S_UDA1380 demo ◆ Hardware connectionConnect the UDA1380 Board to the board via I2Sconnector.Connect the earphone to the UDA1380 Board viaLINEOUT connector◆ Operation and resultYou should hear music when press the RESET key2.9. NandFlash_SCB0◆ OverviewNandFlash demo ◆ Hardware connectionConnect the NandFlash Board to theboard via I2C2 connector.◆ Operation and resultThe below information will be printed on the serial debugging assistant:2.10. SAI◆ OverviewSAI demo◆ Hardware connectionConnect UDA1380 Board to the board via SAI1connector.Connect the earphone to the UDA1380 Board viaLINEOUT connector.◆ Operation and resultYou should hear music when press the RESET key.2.11. SD_FatFS◆ OverviewSD_FatFS demo ◆ Hardware connectionConnect the Micro SD Storage Board to theboard via SDIO connector.Insert the SD card to the Micro SD Storage Board socket.◆ Operation and resultMessage will be printed on the serial debugging assistant.2.12. SDIO◆ OverviewSDIO demo◆Hardware connectionConnect the Micro SD Storage Board to theboard via SDIO connector.Insert the SD card to the Micro SD Storage Board socket.◆ Operation and resultMessage will be printed on the serial debugging assistant.2.13. SPI◆ OverviewSPI demo◆ Hardware connectionConnect the AT45DBXX DataFlash Board via SPIconnector. (SPI1 or SPI4, depending on the software configuration◆ Software connectionModule connect to SPI1 connectorModule connect toSPI4 connector #define Open_SPI1 //#define Open_SPI4//#define Open_SPI1 #define Open_SPI4◆ Operation and resultInfo/messages printed on the serial debugging assistant:11 2.14. USART◆ OverviewUSART demo◆ Hardware connection◆ Operation and resultInfo/messages printed on the serial debugging assistant:3. Version update records VersionModification Date Author V1.0Initial Release 2014/05/17 Waveshare team。
cubeide使用技巧【最新版3篇】篇1 目录1.概述 CubeIDE2.CubeIDE 的基本功能3.CubeIDE 的安装与配置4.CubeIDE 的使用技巧5.CubeIDE 的优点与不足篇1正文CubeIDE 是一款功能强大的集成开发环境 (IDE),可以帮助开发人员快速、高效地开发各种应用程序。
本文将介绍 CubeIDE 的使用技巧,帮助读者更好地利用这个工具进行开发。
1.概述 CubeIDECubeIDE 是一款跨平台的集成开发环境,支持多种编程语言,例如Java、C++、Python 等。
它还提供了许多功能,例如代码编辑、调试、测试和构建等,让开发人员可以一站式完成应用程序的开发和部署。
2.CubeIDE 的基本功能CubeIDE 具有许多基本功能,例如代码编辑、调试、测试和构建等。
其中,代码编辑功能包括语法高亮、自动补全、代码折叠等,可以帮助开发人员更快速、更高效地编写代码。
调试功能可以让开发人员在开发过程中及时发现和解决问题。
测试功能可以让开发人员在开发过程中对代码进行单元测试,以确保代码的质量。
构建功能可以让开发人员轻松地将应用程序部署到目标平台上。
3.CubeIDE 的安装与配置安装 CubeIDE 非常简单,只需要下载官方网站上的安装程序并按照提示进行安装即可。
安装完成后,需要对 CubeIDE 进行配置,例如设置编译器、调试器和构建工具等。
配置完成后,就可以开始使用 CubeIDE 进行开发了。
4.CubeIDE 的使用技巧CubeIDE 提供了许多使用技巧,例如快捷键、模板和宏等,可以帮助开发人员更快速、更高效地开发应用程序。
下面是一些常用的使用技巧: - 快捷键:CubeIDE 提供了许多快捷键,例如 Ctrl+C 复制、Ctrl+V 粘贴、Ctrl+Z 撤销等,可以让开发人员更快速地操作。
- 模板:CubeIDE 提供了许多模板,例如 Java 类模板、C++类模板等,可以让开发人员更快速地创建代码文件。
Arduino学习笔记arduino学习笔记1 - 什么是arduino?要了解arduino就先要了解什么是单片机,arduino平台的基础就是AVR指令集的单片机。
1、什么是单片机?它与个人计算机有什么不同?一台能够工作的计算机要有这样几个部份构成:中央处理单元CPU(进行运算、控制)、随机存储器RAM(数据存储)、存储器ROM(程序存储)、输入/输出设备I/O(串行口、并行输出口等)。
在个人计算机(PC)上这些部份被分成若干块芯片,安装在一个被称之为主板的印刷线路板上。
而在单片机中,这些部份全部被做到一块集成电路芯片中了,所以就称为单片(单芯片)机,而且有一些单片机中除了上述部份外,还集成了其它部份如模拟量/数字量转换(A/D)和数字量/模拟量转换(D/A)等。
2、单片机有什么用?实际工作中并不是任何需要计算机的场合都要求计算机有很高的性能,一个控制电冰箱温度的计算机难道要用酷睿处理器吗?应用的关键是看是否够用,是否有很好的性能价格比。
如果一台冰箱都需要用酷睿处理起来进行温度控制,那价格就是天价了。
单片机通常用于工业生产的控制、生活中与程序和控制有关(如:电子琴、冰箱、智能空调等)的场合。
下图就是一个Atmega328P-PU单片机,基于AVR指令集的8位处理器,频率20MHz,存储器空间32KB。
什么是Arduino?Arduino是一个能够用来感应和控制现实物理世界的一套工具。
它由一个基于单片机并且开放源码的硬件平台,和一套为Arduino板编写程序的开发环境组成。
Arduino可以用来开发交互产品,比如它可以读取大量的开关和传感器信号,并且可以控制各式各样的电灯、电机和其他物理设备。
Arduino项目可以是单独的,也可以在运行时和你电脑中运行的程序(例如:Flash,Processing,MaxMSP)进行通讯。
Arduino板你可以选择自己去手动组装或是购买已经组装好的;Arduino开源的IDE可以免费下载得到。
IDE知识点大全IDE(集成开发环境)是软件开发中常用的工具,为开发者提供了一站式的开发环境,包括代码编辑、编译、调试等多个功能。
本文将介绍IDE的基本概念和常见功能,以及如何选择适合自己的IDE。
1.IDE的概念 IDE是一种软件工具,它集成了多种开发工具和环境,方便开发者进行软件开发。
它通常包括代码编辑器、编译器、调试器、版本控制等功能。
2.常见IDE 目前市面上有许多常见的IDE可供选择,其中一些最受开发者欢迎的包括:–Eclipse:开源的Java IDE,支持多种编程语言,拥有丰富的插件生态系统。
–Visual Studio:微软的集成开发环境,支持多种编程语言,尤其适用于Windows平台开发。
–IntelliJ IDEA:Java开发的IDE,被认为是最好的Java IDE之一,功能强大且易于使用。
–Xcode:苹果公司的开发工具,适用于iOS和Mac应用程序开发。
–Android Studio:谷歌官方推出的Android应用开发工具,集成了Android SDK和各种开发工具。
3.IDE的基本功能 IDE提供了许多基本功能,使得开发变得更加高效和便捷。
–代码编辑器:IDE提供了专门的代码编辑器,支持语法高亮、自动补全、代码重构等功能,提高了编写代码的效率。
–编译器:IDE可以将源代码编译成可执行文件或库文件,让开发者可以直接运行和测试代码。
–调试器:IDE内置了调试器,可以帮助开发者进行代码调试,查找和修复bug。
–版本控制:许多IDE支持版本控制系统(如Git),方便团队协作和代码管理。
–构建工具:IDE通常集成了构建工具(如Maven、Gradle),可以自动化构建和管理项目。
4.如何选择合适的IDE 选择合适的IDE取决于多个因素,包括编程语言、项目需求和个人偏好。
–编程语言:不同的IDE对不同的编程语言支持不同程度,需要选择适合编程语言的IDE。
–项目需求:一些IDE专注于特定类型的项目开发,如移动应用开发、Web开发等,需要根据项目需求选择合适的IDE。
Arduino开发板入门教程第一章:Arduino简介Arduino是一款开源硬件平台,广泛应用于物联网、机器人和自动化领域。
它由一个简单易用的硬件开发板和一个基于Java的集成开发环境(IDE)组成。
本章将介绍Arduino的基本知识和原理。
1.1 Arduino开发板的组成Arduino开发板包含一个微控制器、一组输入输出引脚和一些其他的电子元件。
常用的Arduino型号有Arduino Uno、Arduino Nano和Arduino Mega等。
1.2 Arduino的特点和应用Arduino具有开源、低成本、易使用和可扩展的特点,使其成为广大电子爱好者和创客的首选。
它可以用于建造简单的电子装置、控制传感器、驱动电机以及与计算机进行通信等。
第二章:Arduino的基本用法本章将详细介绍Arduino的基本用法,包括设置Arduino开发环境、编写代码、上传程序以及与外部电路的连接。
2.1 Arduino开发环境的安装与设置首先,需要从Arduino官方网站上下载并安装Arduino集成开发环境(IDE)。
安装完成后,用户需要选择合适的开发板和端口。
2.2 Arduino编程基础Arduino使用一种类似C语言的编程语言。
本节将介绍Arduino编程的基本结构、语法和常用函数。
同时,还将介绍数字输入/输出、模拟输入/输出和串口通信等常用功能。
2.3 Arduino程序的上传编写好的Arduino程序需要通过USB接口将代码上传到开发板上。
本节将介绍如何将程序上传到Arduino开发板,并进行调试和测试。
2.4 Arduino与外部电路的连接Arduino开发板上有多个数字引脚和模拟引脚,可以与外部电路进行连接。
本节将介绍如何使用面包板和杜邦线将Arduino与LED、电位器、温度传感器等外部元件进行连接,并通过编写程序进行控制和读取。
第三章:Arduino的高级用法在本章中,将介绍一些Arduino的高级应用,包括使用库函数、扩展Arduino功能以及与其他设备的通信等。
提纲:一.MSP-EXP430G2套件介绍1.包装清单unchPad简介(430文件夹_用户指南)(一)LaunchPad片上资源(1)开发板硬件简介(2)主要功能模块(二)LaunchPad特性(三)LaunchPad电路图(主要参考【LaunchPad】开发板介绍.pdf)3.MSP430G2553数据资料(技术资料汇总_G2553中文资料.pdf)4.安装MSP-EXP430G2 LaunchPad二.编译部分1.编译工具的选择2.编译工具的安装(根据安装提示便可)3.程序编译、烧录流程4.编程规则(MSP430 编程规则.pdf)三.基础程序部分1.功能模块程序(MSP430G2xx3 Code Examples文件夹)2.基础应用程序(例程代码)四.应用举例——MSP430G2452内置温度传感器温度检测五.LaunchPad扩展部分1.eZ430连接、编程要点2.与卫星板的连接3.与LaunchPad兼容的MSP430器件一.MSP-EXP430G2套件介绍1.包装清单:⏹LaunchPad目标板(附一个烧好测温实验例程的MPS430G2553)⏹MPS4302452一个——具有8通道10位ADC、片上比较器、触控式I/O、通用串行接口、8Kb闪存、256字节SRAM的低功耗16位MSP430微控制器⏹32.768KHz时钟晶振⏹0.5m长的USB-B线缆⏹插座式10引脚印刷板连接线两个⏹LaunchPad贴签两个⏹快速启动指南unchPad简介(一)LaunchPad片上资源(1)开发板硬件介绍:板上材料清单开发板指示图(2)主要功能模块:⏹复位模块⏹时钟模块⏹I/O端口模块;⏹WDT看门狗模块;⏹Timer A定时器模块⏹比较器A模块⏹ADC10数模转换模块⏹USART串行异步通讯模块⏹CPU模块(二)LaunchPad特性⏹实验班成本低、低功耗⏹USB调试与编程接口无需驱动即可安装使用,且具备高达9600波特的UART串行通信速度⏹支持所有采用PDIP14或PDIP20封装的MSP430G2XX和MSP430F20XX器件⏹分别连接至绿光和红光LED的两个通用数字I/O口引脚可提供视觉反馈⏹两个按钮可实现用户反馈和芯片复位⏹器件引脚可通过插座引出,既可以方便的用于调试,也可用来添加定制的扩展板⏹高质量的20引脚DIP插座,可轻松简便地插入目标器件或将其移除(三)LaunchPad电路图LaunchPad原理图见“【LaunchPad】开发板介绍.pdf”。
幵箱时里面的介绍: 整体布局介绍:
英文版:
翻译版:
MSP432P401:
板子上面为仿真电路和功耗测量电路,下面为432主控芯片和外围器件
的开发环境是他的版本号是Product Info (overview)
MSP432处理器也可以用库函数和寄存器两种方式来编写程序的,库函数是用的最多的方式,我也用库函数的方式来编写MSP432 的程序。
MSP432P401R LaunchPad 包含48MHz ARM CortexM4F 内核,
95uA/MHz 工作功耗和850nA RTC 操作,14位1MPS差动SAR ADC和AES256加速器。
评估板包含带有En ergyTrace+ 技术的板载仿真器,无需其他工具即可进行项目编程和调试,同时还可以测量系统总能耗。
P432P401R 处理器特性
低功耗、高性能MSP432P401R MCU
带浮点单元和DSP加速功能的48MHz 32 位ARM Cortex M4F
功耗:95uA/MHz 工作功耗和850nA RTC 待机操作功耗
模拟:24通道14位差动1MSPS SAR ADC,两个比较器
数字:高级加密标准(AES256)加速器、CRC、DMA、32位硬件乘法器
存储器:256KB闪存、64KB RAM
计时器:4个16位、2个32位
通信:多达4个I2C、8个SPI、4个UART
40引脚BoosterPack 连接器,支持20引脚BoosterPack
采用EnergyTrace+ 技术的板载XDS-110ET仿真器
2个按钮和2个LCD,便于用户交互
更多关于 MSP432的资料:
MSP432处理器可以使用 CCS 、IAR 和keil uVision IDE 来开发
整块电路板的框图:
以电路板上中间的虚线划分为上下两部分,介绍一下上面部分,
上面部分是 XDS110七T 仿真器,
MSP432P401R 与 XDS110ET 勺连接可以断开, MSP432P401R 与XDS110七T 除仿真信
号之外没有其他通讯连接, 仿真信号包括XDS110七T 串行调试信号、应用UART 言
号和、5V 电源。
F 面的图表很清楚的描述了两个区域的连接情况:
信号
连接方式 描述
5V 跳线 USB 过来的5V 电源
3V3 跳线 从XDS110-ET 过来的
RTS 跳线 UART 通道 CTS 跳线 UART 通道
RXD 跳线 接收数据 TXD 跳线 发送数据 RST
按键
复位MCU
TCK-SWCLK 拨动开关 串行输入/JTAG 输出
注:和为串口通讯时的半双工通信
评估板也可以外接仿真器,
是用外部仿真器
来选择板载XDS110仿真器还。