当前位置:文档之家› stm32f105

stm32f105

stm32f105
stm32f105

September 2009Doc ID 15274 Rev 41/95

STM32F105xx STM32F107xx

Connectivity line, ARM-based 32-bit MCU with 64/256 KB Flash, USB OTG, Ethernet, 10 timers, 2 CANs, 2 ADCs, 14 communication interfaces

Features

I

Core: ARM 32-bit Cortex?-M3 CPU –72 MHz maximum frequency,

1.25DMIPS/MHz (Dhrystone

2.1) performance at 0 wait state memory access

–Single-cycle multiplication and hardware division I

Memories

–64 to 256 Kbytes of Flash memory

–up to 64 Kbytes of general-purpose SRAM I

Clock, reset and supply management

– 2.0 to 3.6V application supply and I/Os –POR, PDR, and programmable voltage detector (PVD)

–3-to-25 MHz crystal oscillator

–Internal 8 MHz factory-trimmed RC –Internal 40 kHz RC with calibration

–32 kHz oscillator for RTC with calibration I

Low power

–Sleep, Stop and Standby modes

–V BAT supply for RTC and backup registers I

2 × 12-bit, 1 μs A/D converters (16 channels)–Conversion range: 0 to 3.6 V –Sample and hold capability –Temperature sensor

–up to 2 MSPS in interleaved mode I 2 × 12-bit D/A converters

I

DMA: 12-channel DMA controller

–Supported peripherals: timers, ADCs, DAC, I 2Ss, SPIs, I 2Cs and USARTs I

Debug mode

–Serial wire debug (SWD) & JTAG interfaces –Cortex-M3 Embedded T race Macrocell?I

Up to 80 fast I/O ports

–51/80 I/Os, all mappable on 16 external interrupt vectors and almost all 5V-tolerant I

CRC calculation unit, 96-bit unique ID

I

Up to 10 timers with pinout remap capability –Up to four 16-bit timers, each with up to 4 IC/OC/PWM or pulse counter and

quadrature (incremental) encoder input – 1 × 16-bit motor control PWM timer with dead-time generation and emergency stop – 2 × watchdog timers (Independent and Window)

–SysTick timer: a 24-bit downcounter – 2 × 16-bit basic timers to drive the DAC I

Up to 14 communication interfaces with pinout remap capability

–Up to 2 × I 2C interfaces (SMBus/PMBus)–Up to 5 USARTs (ISO 7816 interface, LIN, IrDA capability, modem control)–Up to 3 SPIs (18 Mbit/s), 2 with a

multiplexed I 2S interface that offers audio class accuracy via advanced PLL schemes – 2 × CAN interfaces (2.0B Active) with 512bytes of dedicated SRAM

–USB 2.0 full-speed device/host/OTG

controller with on-chip PHY that supports HNP/SRP/ID with 1.25 Kbytes of dedicated SRAM

–10/100 Ethernet MAC with dedicated DMA and SRAM (4 Kbytes): IEEE1588 hardware support, MII/RMII available on all packages

Table 1.

Device summary

Reference Part number

STM32F105xx

STM32F105R8, STM32F105V8 STM32F105RB, STM32F105VB STM32F105RC, STM32F105VC STM32F107xx

STM32F107RB, STM32F107VB STM32F107RC, STM32F107VC

https://www.doczj.com/doc/b34690424.html,

Contents STM32F105xx, STM32F107xx

Contents

1Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.1Device overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.2Full compatibility throughout the family . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.3Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.3.1ARM? Cortex?-M3 core with embedded Flash and SRAM . . . . . . . . . 13

2.3.2Embedded Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.3.3CRC (cyclic redundancy check) calculation unit . . . . . . . . . . . . . . . . . . 13

2.3.4Embedded SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.3.5Nested vectored interrupt controller (NVIC) . . . . . . . . . . . . . . . . . . . . . . 13

2.3.6External interrupt/event controller (EXTI) . . . . . . . . . . . . . . . . . . . . . . . 14

2.3.7Clocks and startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.3.8Boot modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.3.9Power supply schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3.10Power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3.11Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3.12Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3.13DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

2.3.14RTC (real-time clock) and backup registers . . . . . . . . . . . . . . . . . . . . . . 16

2.3.15Timers and watchdogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.3.16I2C bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.3.17Universal synchronous/asynchronous receiver transmitters (USARTs) 18

2.3.18Serial peripheral interface (SPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.3.19Inter-integrated sound (I2S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.3.20Ethernet MAC interface with dedicated DMA and IEEE 1588 support . 19

2.3.21Controller area network (CAN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

2.3.22Universal serial bus on-the-go full-speed (USB OTG FS) . . . . . . . . . . . 20

2.3.23GPIOs (general-purpose inputs/outputs) . . . . . . . . . . . . . . . . . . . . . . . . 20

2.3.24Remap capability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.3.25ADCs (analog-to-digital converters) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.3.26DAC (digital-to-analog converter) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

2.3.27Temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.3.28Serial wire JT AG debug port (SWJ-DP) . . . . . . . . . . . . . . . . . . . . . . . . . 22 2/95 Doc ID 15274 Rev 4

STM32F105xx, STM32F107xx Contents

2.3.29Embedded Trace Macrocell? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3Pinouts and pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4Memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.1Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.2Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.3Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.4Loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.5Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.1.6Power supply scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.1.7Current consumption measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.2Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.3Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5.3.1General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

5.3.2Operating conditions at power-up / power-down . . . . . . . . . . . . . . . . . . 35

5.3.3Embedded reset and power control block characteristics . . . . . . . . . . . 35

5.3.4Embedded reference voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.3.5Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.3.6External clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.3.7Internal clock source characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

5.3.8PLL, PLL2 and PLL3 characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5.3.9Memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.3.10EMC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.3.11Absolute maximum ratings (electrical sensitivity) . . . . . . . . . . . . . . . . . 52

5.3.12I/O port characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.3.13NRST pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.3.14TIM timer characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.3.15Communications interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.3.1612-bit ADC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

5.3.17DAC electrical specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

5.3.18Temperature sensor characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 6Package characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

Doc ID 15274 Rev 43/95

Contents STM32F105xx, STM32F107xx

6.1Package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

6.2Thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

6.2.1Reference document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

6.2.2Selecting the product temperature range . . . . . . . . . . . . . . . . . . . . . . . . 80

7Part numbering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

Appendix A Applicative block diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

A.1USB OTG FS interface solutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

A.2Ethernet interface solutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

A.3Complete audio player solutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

A.4USB OTG FS interface + Ethernet/I2S interface solutions . . . . . . . . . . . . 89 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

4/95 Doc ID 15274 Rev 4

STM32F105xx, STM32F107xx List of tables List of tables

Table 1.Device summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Table 2.STM32F105xx and STM32F107xx features and peripheral counts . . . . . . . . . . . . . . . . . . 10 Table 3.STM32F105xx and STM32F107xx family versus STM32F103xx family . . . . . . . . . . . . . . 11 Table 4.Timer feature comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Table 5.Pin definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Table 6.Voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Table 7.Current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Table 8.Thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Table 9.General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Table 10.Operating conditions at power-up / power-down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Table 11.Embedded reset and power control block characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . 35 Table 12.Embedded internal reference voltage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Table 13.Maximum current consumption in Run mode, code with data processing

running from Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Table 14.Maximum current consumption in Run mode, code with data processing

running from RAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Table 15.Maximum current consumption in Sleep mode, code running from Flash or RAM. . . . . . . 38 Table 16.Typical and maximum current consumptions in Stop and Standby modes . . . . . . . . . . . . 38 Table 17.Typical current consumption in Run mode, code with data processing

running from Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Table 18.Typical current consumption in Sleep mode, code running from Flash or

RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Table 19.Peripheral current consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Table 20.High-speed external user clock characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Table 21.Low-speed external user clock characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Table 22.HSE 3-25 MHz oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Table 23.LSE oscillator characteristics (f LSE = 32.768 kHz) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Table 24.HSI oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Table 25.LSI oscillator characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Table 26.Low-power mode wakeup timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Table 27.PLL characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Table 28.PLL2 and PLL3 characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Table 29.Flash memory characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Table 30.Flash memory endurance and data retention. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Table 31.EMS characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Table 32.EMI characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Table 33.ESD absolute maximum ratings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Table 34.Electrical sensitivities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Table 35.I/O static characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Table 36.Output voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Table 37.I/O AC characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Table 38.NRST pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Table 39.TIMx characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Table 40.I2C characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Table 41.SCL frequency (f PCLK1= 36 MHz.,V DD = 3.3 V) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Table 42.SPI characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Table 43.I2S characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Table https://www.doczj.com/doc/b34690424.html,B OTG FS startup time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

Doc ID 15274 Rev 45/95

List of tables STM32F105xx, STM32F107xx Table https://www.doczj.com/doc/b34690424.html,B OTG FS DC electrical characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Table https://www.doczj.com/doc/b34690424.html,B OTG FS electrical characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Table 47.Ethernet DC electrical characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Table 48.Dynamics characteristics: Ethernet MAC signals for SMI. . . . . . . . . . . . . . . . . . . . . . . . . . 66 Table 49.Dynamics characteristics: Ethernet MAC signals for RMII . . . . . . . . . . . . . . . . . . . . . . . . . 67 Table 50.Dynamics characteristics: Ethernet MAC signals for MII . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Table 51.ADC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Table 52.R AIN max for f ADC = 14 MHz. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Table 53.ADC accuracy - limited test conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Table 54.ADC accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Table 55.DAC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Table 56.TS characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Table 57.LQPF100 – 100-pin low-profile quad flat package mechanical data . . . . . . . . . . . . . . . . . 77 Table 58.LQFP64 – 64 pin low-profile quad flat package mechanical data. . . . . . . . . . . . . . . . . . . . 78 Table 59.Package thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Table 60.Ordering information scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Table 61.PLL configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Table 62.Applicative current consumption in Run mode, code with data

processing running from Flash. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Table 63.Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 6/95 Doc ID 15274 Rev 4

STM32F105xx, STM32F107xx List of figures List of figures

Figure 1.STM32F105xx and STM32F107xx connectivity line block diagram . . . . . . . . . . . . . . . . . 12 Figure 2.STM32F105xxx and STM32F107xxx connectivity line LQFP100 pinout . . . . . . . . . . . . . . 23 Figure 3.STM32F105xxx and STM32F107xxx connectivity line LQFP64 pinout . . . . . . . . . . . . . . . 24 Figure 4.Memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Figure 5.Pin loading conditions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Figure 6.Pin input voltage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Figure 7.Power supply scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Figure 8.Current consumption measurement scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Figure 9.Typical current consumption on V BAT with RTC on vs. temperature at

different V BAT values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Figure 10.Typical current consumption in Stop mode with regulator in Run mode

versus temperature at different V DD values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Figure 11.Typical current consumption in Stop mode with regulator in Low-power

mode versus temperature at different V DD values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Figure 12.Typical current consumption in Standby mode versus temperature at

different V DD values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Figure 13.High-speed external clock source AC timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Figure 14.Low-speed external clock source AC timing diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Figure 15.Typical application with an 8 MHz crystal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Figure 16.Typical application with a 32.768 kHz crystal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Figure 17.I/O AC characteristics definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Figure 18.Recommended NRST pin protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Figure 19.I2C bus AC waveforms and measurement circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Figure 20.SPI timing diagram - slave mode and CPHA = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Figure 21.SPI timing diagram - slave mode and CPHA = 1(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Figure 22.SPI timing diagram - master mode(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Figure 23.I2S slave timing diagram (Philips protocol)(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Figure 24.I2S master timing diagram (Philips protocol)(1). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Figure https://www.doczj.com/doc/b34690424.html,B OTG FS timings: definition of data signal rise and fall time . . . . . . . . . . . . . . . . . . . . 65 Figure 26.Ethernet SMI timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Figure 27.Ethernet RMII timing diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Figure 28.Ethernet MII timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Figure 29.ADC accuracy characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Figure 30.Typical connection diagram using the ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Figure 31.Power supply and reference decoupling (V REF+ not connected to V DDA). . . . . . . . . . . . . . 72 Figure 32.Power supply and reference decoupling (V REF+ connected to V DDA). . . . . . . . . . . . . . . . . 72 Figure 33.12-bit buffered /non-buffered DAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Figure 34.LQFP100, 100-pin low-profile quad flat package outline . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Figure 35.Recommended footprint(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Figure 36.LQFP64 – 64 pin low-profile quad flat package outline . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Figure 37.Recommended footprint(1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Figure 38.LQFP100 P D max vs. T A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Figure https://www.doczj.com/doc/b34690424.html,B OTG FS device mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Figure 40.Host connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Figure 41.OTG connection (any protocol). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Figure 42.MII mode using a 25 MHz crystal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Figure 43.RMII with a 50 MHz oscillator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Figure 44.RMII with a 25 MHz crystal and PHY with PLL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

Doc ID 15274 Rev 47/95

List of figures STM32F105xx, STM32F107xx Figure 45.RMII with a 25 MHz crystal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 Figure https://www.doczj.com/doc/b34690424.html,plete audio player solution 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Figure https://www.doczj.com/doc/b34690424.html,plete audio player solution 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Figure https://www.doczj.com/doc/b34690424.html,B OTG FS + Ethernet solution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Figure https://www.doczj.com/doc/b34690424.html,B OTG FS + I2S (Audio) solution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

8/95 Doc ID 15274 Rev 4

STM32F105xx, STM32F107xx Introduction

Doc ID 15274 Rev 49/95

1 In t roduc t

ion

This datasheet provides the description of the STM32F105xx and STM32F107xx connectivity line microcontrollers. For more details on the whole STMicroelectronics

STM32F10xxx family, please refer to Section 2.2: Full compatibility throughout the family .The STM32F105xx and STM32F107xx datasheet should be read in conjunction with the STM32F10xxx reference manual.

For information on programming, erasing and protection of the internal Flash memory please refer to the STM32F10xxx Flash programming manual.

The reference and Flash programming manuals are both available from the STMicroelectronics website https://www.doczj.com/doc/b34690424.html,.

For information on the Cortex?-M3 core please refer to the Cortex?-M3 Technical Reference Manual, available from the https://www.doczj.com/doc/b34690424.html, website at the following address: https://www.doczj.com/doc/b34690424.html,/help/index.jsp?topic=/com.arm.doc.ddi0337e/.

2 Descrip t

ion

The STM32F105xx and STM32F107xx connectivity line family incorporates the high-performance ARM ? Cortex?-M3 32-bit RISC core operating at a 72MHz frequency, high-speed embedded memories (Flash memory up to 256 Kbytes and SRAM up to 64 Kbytes), and an extensive range of enhanced I/Os and peripherals connected to two APB buses. All devices offer two 12-bit ADCs, four general-purpose 16-bit timers plus a PWM timer, as well as standard and advanced communication interfaces: up to two I 2Cs, three SPIs, two I2Ss, five USARTs, an USB OTG FS and two CANs. Ethernet is available on the STM32F107xx only.

The STM32F105xx and STM32F107xx connectivity line family operates in the –40 to +105°C temperature range, from a 2.0 to 3.6V power supply. A comprehensive set of power-saving mode allows the design of low-power applications.

The STM32F105xx and STM32F107xx connectivity line family offers devices in two different package types: from 64 pins to 100 pins. Depending 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.

Description STM32F105xx, STM32F107xx

10/95 Doc ID 15274 Rev 4

These features make the STM32F105xx and STM32F107xx connectivity line microcontroller family suitable for a wide range of applications:

G Motor drive and application control G Medical and handheld equipment

G Industrial applications: PLC, inverters, printers, and scanners G Alarm systems, Video intercom, and HVAC G

Home audio equipment

Figure 1 shows the general block diagram of the device family.

2.1 Device overview

Table 2.

STM32F105xx and STM32F107xx features and peripheral counts

Peripherals (1)

STM32F105Rx STM32F107Rx STM32F105Vx STM32F107Vx Flash memory in Kbytes 6412825612825664128256128256SRAM in Kbytes 20

3264

48

64

20

3264

48

64

Ethernet

No

Y es

No

Y es

Timers

General-purpose

4Advanced-control 1Basic 2

Communication

interfaces

SPI(I 2S)(2)3(2)3(2)3(2)3(2)I 2C

2

1

2

1

USART

5USB OTG FS

Y es CAN

2

GPIOs

51

80

12-bit ADC

Number of channels 21612-bit DAC

Number of channels 22CPU frequency 72 MHz Operating voltage 2.0 to 3.6 V

Operating temperatures Ambient temperatures: –40 to +85 °C /–40 to +105 °C

Junction temperature: –40 to + 125 °C Package

LQFP64

LQFP100

1.Please refer to Table 5: Pin definitions for peripheral availability when the I/O pins are shared by the peripherals required

by the application.2.The SPI2 and SPI3 interfaces give the flexibility to work in either the SPI mode or the I 2S audio mode.

STM32F105xx, STM32F107xx Description

Doc ID 15274 Rev 411/95

2.2 Full compa t ibili t

y throughout the family

The STM32F105xx and STM32F107xx constitute the connectivity line family whose

members are fully pin-to-pin, software and feature compatible.

The STM32F105xx and STM32F107xx are a drop-in replacement for the low-density (STM32F103x4/6), medium-density (STM32F103x8/B) and high-density

(STM32F103xC/D/E) performance line devices, allowing the user to try different memory densities and peripherals providing a greater degree of freedom during the development cycle.

Table 3.

STM32F105xx and STM32F107xx family versus STM32F103xx family (1)

STM32 device Low-density

STM32F103xx devices Medium-density STM32F103xx devices High-density STM32F103xx devices STM32F105xx STM32F107xx

Flash size (KB)16

32

32

64

128

256

384

512

64128256128256

RAM size (KB)6101020204864642032644864

144 pins 5 × USARTs 4 × 16-bit timers,2 × basic timers, 3 × SPIs,2 × I 2Ss, 2 × I2Cs, USB, CAN, 2 × PWM timers 3 × ADCs, 2 × DACs,1 × SDIO, FSMC (100- and 144-pin packages (2))100 pins

3 × USARTs

3 × 16-bit timers 2 × SPIs,2 × I 2Cs, USB, CAN,1 × PWM timer

2 × ADCs 5 × USARTs,

4 × 16-bit timers,2 × basic timers,3 × SPIs,

2 × I 2Ss,2 × I2Cs,USB OTG FS,2 × CANs,1 × PWM timer,2 × ADCs,2 × DACs

5 × USARTs,4 × 16-bit timers,2 × basic timers,3 × SPIs,2 × I 2S,1 × I2C,

USB OTG FS,2 × CANs,

1 × PWM timer,

2 × ADCs,2 × DACs,Ethernet

64 pins 2 × USARTs 2 × 16-bit timers 1 × SPI, 1 × I 2

C, USB, CAN,

1 × PWM timer

2 × ADCs 2 × USARTs 2 × 16-bit timers 1 × SPI,1 × I 2C, USB, CAN,1 × PWM timer

2 × ADCs

48 pins 36 pins

1.Please refer to Table 5: Pin definitions for peripheral availability when the I/O pins are shared by the peripherals required

by the application.2.Ports F and G are not available in devices delivered in 100-pin packages.

Description STM32F105xx, STM32F107xx

12/95 Doc ID 15274 Rev 4

2.3 Overview

1.T A = –40 °C to +85 °C (suffix 6, see Table 60) or –40 °C to +105 °C (suffix 7, see Table 60), junction temperature up to

105°C or 125 °C, respectively.

2.AF = alternate function on I/O port pin.

STM32F105xx, STM32F107xx Description

Doc ID 15274 Rev 413/95

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.

With its embedded ARM core, STM32F105xx and STM32F107xx connectivity line family is 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 to 256 Kbytes of embedded Flash is available for storing programs and data.

2.3.3 CRC (cyclic redundancy 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 calculation unit helps compute 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

20 to 64 Kbytes of embedded SRAM accessed (read/write) at CPU clock speed with 0 wait

states.

2.3.5 Nested vectored interrupt controller (NVIC)

The STM32F105xx and STM32F107xx connectivity line embeds a nested vectored interrupt controller able to handle up to 67 maskable interrupt channels (not including the 16 interrupt lines of Cortex?-M3) and 16 priority levels.

G Closely coupled NVIC gives low latency interrupt processing G Interrupt entry vector table address passed directly to the core G Closely coupled NVIC core interface G Allows early processing of interrupts

G Processing of late arriving higher priority interrupts G Support for tail-chaining

G Processor state automatically saved

G

Interrupt entry restored on interrupt exit with no instruction overhead

This hardware block provides flexible interrupt management features with minimal interrupt latency.

Description STM32F105xx, STM32F107xx

14/95 Doc ID 15274 Rev 4

2.3.6 Ex t ernal in t errup t

/event controller (EXTI)

The external interrupt/event controller consists of 20 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 clock period. Up to 80 GPIOs 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 external 3-25 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 oscillator. A software interrupt is generated if enabled. Similarly, full interrupt management of the PLL clock entry is available when necessary (for example with failure of an indirectly used external oscillator).

A single 25 MHz crystal can clock the entire system including the ethernet and US

B OTG FS peripherals. Several prescalers and PLLs allow the configuration of the AHB frequency, 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. Refer to Figure 48: USB OTG FS + Ethernet solution on page 89.

The advanced clock controller clocks the core and all peripherals using a single crystal or oscillator. In order to achieve audio class performance, an audio crystal can be used. In this case, the I 2S master clock can generate all standard sampling frequencies from 8kHz to 96kHz with less than 0.5% accuracy error. Refer to Figure 49: USB OTG FS + I 2S (Audio) solution on page 89.

To configure the PLLs, please refer to T able 61 on page 90, which provides PLL configurations according to the application type.

2.3.8 Boo t modes At startup, boot pins are used to select one of three boot options:

G Boot from User Flash G Boot from System Memory G

Boot from embedded SRAM

The boot loader is located in System Memory. It is used to reprogram the Flash memory by

using USART1, USART2 (remapped), CAN2 (remapped) or USB OTG FS in device mode (DFU: device firmware upgrade). For remapped signals refer to T able 5: Pin definitions .The USART peripheral operates with the internal 8MHz oscillator (HSI), however the CAN and USB OTG FS can only function if an external 8 MHz, 14.7456 MHz or 25 MHz clock (HSE) is present.

For full details about the boot loader, please refer to AN2662.

STM32F105xx, STM32F107xx Description

Doc ID 15274 Rev 415/95

2.3.9 Power supply schemes

G

V DD = 2.0 to 3.6 V: external power supply for I/Os and the internal regulator. Provided externally through V DD pins.

G

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.

G

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.

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 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.

2.3.11 Vol t age regula t or

The regulator has three operation modes: main (MR), low power (LPR) and power down.

G MR is used in the nominal regulation mode (Run) G LPR is used in the Stop modes.

G

Power down is used in Standby mode: the regulator output is in high impedance: the

kernel circuitry is powered down, inducing zero consumption (but the contents of the registers and SRAM are lost)

This regulator is always enabled after reset. It is disabled in Standby mode.

2.3.12 Low-power modes

The STM32F105xx and STM32F107xx connectivity line supports three low-power modes to

achieve the best compromise between low power consumption, short startup time and available wakeup sources:

G

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.

G

Stop mode

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 OTG FS wakeup.

Description STM32F105xx, STM32F107xx

G 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.

2.3.13 DMA

The flexible 12-channel general-purpose DMAs (7 channels for DMA1 and 5 channels for

DMA2) are able to manage memory-to-memory, peripheral-to-memory and memory-to-

peripheral transfers. The two DMA controllers support circular buffer management,

removing the need for user code intervention 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, I2C, USART, general-purpose, basic

and advanced control timers TIMx, DAC, I2S and ADC.

In the STM32F107xx, there is a DMA controller dedicated for use with the Ethernet (see

Section2.3.20: Ethernet MAC interface with dedicated DMA and IEEE 1588 support for

more information).

2.3.14 RTC (real-time clock) 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 forty-two 16-bit

registers used to store 84 bytes of user application data when V DD power is not present.

They are not reset by a system or power reset, and they are not reset when the device

wakes up from the Standby mode.

The real-time clock provides a set of continuously 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 clocked by a 32.768 kHz external crystal, resonator or oscillator, the

internal low power RC oscillator or the high-speed external clock divided by 128. The

internal low-speed RC has a typical frequency of 40 kHz. The RTC can be calibrated using

an external 512 Hz output to compensate for any natural quartz 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.

For more information, please refer to AN2604: “STM32F101xx and STM32F103xx RTC

calibration”, available from https://www.doczj.com/doc/b34690424.html,.

16/95 Doc ID 15274 Rev 4

STM32F105xx, STM32F107xx Description

Doc ID 15274 Rev 417/95

2.3.15 Timers and watchdogs

The STM32F105xx and STM32F107xx devices include an advanced-control timer, four general-purpose timers, two basic timers, two watchdog timers and a SysTick timer.Table 4 compares the features of the general-purpose and basic timers.

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:

G Input capture G Output compare

G PWM generation (edge or center-aligned modes)G

One-pulse mode output

If configured as a standard 16-bit timer, it has the same features as the TIMx timer. If configured as the 16-bit PWM generator, it has full modulation capability (0-100%). The counter can be frozen in debug mode.

Many features are shared with those of the standard 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 4 synchronizable standard timers (TIM2, TIM3, TIM4 and TIM5) embedded in the STM32F105xx and STM32F107xx connectivity 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 16 input captures / output compares / PWMs on the largest packages. They can work together with the Advanced Control timer via the Timer Link feature for synchronization or event chaining.

The counter can be frozen in debug mode.

Table 4.

Timer feature comparison

Timer

Counter resolution Counter type Prescaler factor DMA request generation Capture/compare channels Complementary outputs TIM116-bit

Up, down, up/down Any integer between 1 and 65536Y es

4

Y es

TIMx (TIM2, TIM3, TIM4, TIM5)16-bit Up, down, up/down

Any integer between 1 and 65536Y es 4No

TIM6, TIM7

16-bit Up Any integer between 1 and 65536

Y es 0No

Description STM32F105xx, STM32F107xx

18/95 Doc ID 15274 Rev 4

Any of the standard timers can be used to generate PWM outputs. Each of the timers has independent DMA request generations.

Basic timers TIM6 and TIM7

These timers are mainly used for DAC trigger generation. They can also be used as a generic 16-bit time base.

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 from 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 downcounter 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 interrupt capability and the counter can be frozen in debug mode.

SysTick timer

This timer is dedicated to real-time operating systems, but could also be used as a standard down counter. It features:

G A 24-bit down counter G Autoreload capability

G Maskable system interrupt generation when the counter reaches 0.G

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 7/10-bit addressing mode and 7-bit dual addressing mode (as slave). A hardware CRC generation/verification is embedded.

They can be served by DMA and they support SMBus 2.0/PMBus.

2.3.17 Universal synchronous/asynchronous receiver transmitters (USARTs)

The STM32F105xx and STM32F107xx connectivity line embeds three universal

synchronous/asynchronous receiver transmitters (USART1, USART2 and USART3) and two universal asynchronous receiver transmitters (UART4 and UART5).

These five interfaces provide asynchronous communication, IrDA SIR ENDEC support, multiprocessor communication mode, single-wire half-duplex communication mode and have LIN Master/Slave capability.

The USART1 interface 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.

STM32F105xx, STM32F107xx Description

Doc ID 15274 Rev 419/95

USART1, USART2 and USART3 also provide hardware management of the CTS and RTS signals, Smart Card mode (ISO 7816 compliant) and SPI-like communication capability. All interfaces can be served by the DMA controller except for UART5.

2.3.18 Serial peripheral interface (SPI)

Up to three 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/SDHC (a) modes.All SPIs can be served by the DMA controller.

2.3.19 In t er-in t egra t

ed sound (I 2S)

Two standard I 2S interfaces (multiplexed with SPI2 and SPI3) are available, that can be

operated in master or slave mode. These interfaces can be configured to operate with 16/32 bit resolution, as input or output channels. Audio sampling frequencies from 8 kHz up to 96kHz are supported. When either or both of the I 2S interfaces is/are configured in master mode, the master clock can be output to the external DAC/CODEC at 256 times the sampling frequency with less than 0.5% accuracy error owing to the advanced clock controller (see Section 2.3.7: Clocks and startup ).

Please refer to the “Audio frequency precision” tables provided in the “Serial peripheral interface (SPI)” section of the STM32F10xxx reference manual.

2.3.20 E t herne t

MAC interface with dedicated DMA and IEEE 1588 support

Peripheral not available on STM32F105xx devices.

The STM32F107xx devices provide an IEEE-802.3-2002-compliant media access controller

(MAC) for ethernet LAN communications through an industry-standard media-independent interface (MII) or a reduced media-independent interface (RMII). The STM32F107xx requires an external physical interface device (PHY) to connect to the physical LAN bus (twisted-pair, fiber, etc.). the PHY is connected to the STM32F107xx MII port using as many as 17 signals (MII) or 9 signals (RMII) and can be clocked using the 25MHz (MII) or 50 MHz (RMII) output from the STM32F107xx.

The STM32F107xx includes the following features:

G Supports 10 and 100 Mbit/s rates

G

Dedicated DMA controller allowing high-speed transfers between the dedicated SRAM and the descriptors (see the STM32F105xx/STM32F107xx reference manual for details)

G Tagged MAC frame support (VLAN support)G Half-duplex (CSMA/CD) and full-duplex operation G

MAC control sublayer (control frames) support

a.SDHC = Secure digital high capacity.

Description

STM32F105xx, STM32F107xx

20/95 Doc ID 15274 Rev 4

G 32-bit CRC generation and removal

G

Several address filtering modes for physical and multicast address (multicast and group addresses)

G 32-bit status code for each transmitted or received frame

G

Internal FIFOs to buffer transmit and receive frames. The transmit FIFO and the receive FIFO are both 2 Kbytes, that is 4 Kbytes in total

G

Supports hardware PTP (precision time protocol) in accordance with IEEE 1588 with the timestamp comparator connected to the TIM2 trigger input G

Triggers interrupt when system time becomes greater than target time

2.3.21 Con t

roller area network (CAN)

The two CANs are compliant with the 2.0A and B (active) specifications with a bitrate up to

1Mbit/s. They can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers. Each CAN has three transmit mailboxes, two receive FIFOS with 3 stages and 28 shared scalable filter banks (all of them can be used even if one CAN is used). The 256 bytes of SRAM which are allocated for each CAN (512 bytes in total) are not shared with any other peripheral.

2.3.22 Universal serial bus on-the-go full-speed (USB OTG FS)

The STM32F105xx and STM32F107xx connectivity line devices embed a USB OTG full-speed (12Mb/s) device/host/OTG peripheral with integrated transceivers. The USB OTG FS peripheral is compliant with the USB 2.0 specification and with the OTG 1.0 specification. It has software-configurable endpoint setting and supports suspend/resume. The USB OTG full-speed controller requires a dedicated 48 MHz clock that is generated by a PLL connected to the HSE oscillator. The major features are:

G

1.25 KB of SRAM used exclusively by the endpoints (not shared with any other peripheral)

G 4 bidirectional endpoints

G HNP/SNP/IP inside (no need for any external resistor)

G

for OTG/Host modes, a power switch is needed in case bus-powered devices are connected

G

the SOF output can be used to synchronize the external audio DAC clock in isochronous mode

G

in accordance with the USB 2.0 Specification, the supported transfer speeds are:–in Host mode: full speed and low speed –

in Device mode: full speed

2.3.23 GPIOs (general-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 except for analog inputs.

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

KEIL中如何用虚拟串口调试串口程序

KEIL中如何用虚拟串口调试串口程序 发表于2008/5/7 15:30:22 以前没接触过串口,一直都以为串口很复杂。最近在做一个新项目,用单片机控制GSM模块。单片机和GSM模块接口就是串口。调试完后觉得串口其实很简单。“不过如此”。这可能是工程师做完一个项目后的共同心态吧。下面详细介绍下如何用虚拟串口调试串口发送接收程序。 需要用到三个软件:KEIL,VSPD XP5(virtual serial ports driver xp5.1虚拟串口软件),串口调试助手。 1、首先在KEIL里编译写好的程序。 2、打开VSPD,界面如下图所示: 左边栏最上面的是电脑自带的物理串口。点右边的add pair,可以添加成对的串口。一对串口已经虚拟互联了,如果添加的是COM3、COM4,用COM3发送数据,COM4就可以接收数据,反过来也可以。 3、接下来的一步很关键。把KEIL和虚拟出来的串口绑定。现在把COM3和KEIL 绑定。在KEIL中进入DEBUG模式。在最下面的COMMAND命令行,输入MODE COM3 4800,0,8,1(设置串口3的波特率、奇偶校验位、数据位、停止位,打开COM3串口,注意设置的波特率和程序里设置的波特率应该一样)ASSIGN COM3 SOUT(把单片机的串口和COM3绑定到一起。因为我用的单片机是AT892051,只有一个串口,所以用SIN,SOUT,如果单片机有几个串口,可以选择S0IN,S0OUT,S1IN,S1OUT。)

4、打开串口调试助手 可以看到虚拟出来的串口COM3、COM4,选择COM4,设置为波特率4800,无校验位、8位数据位,1位停止位(和COM3、程序里的设置一样)。打开COM4。 现在就可以开始调试串口发送接收程序了。可以通过KEIL发送数据,在串口调试助手中就可以显示出来。也可以通过串口调试助手发送数据,在KEIL中接收。这种方法的好处是不用硬件就可以调试。这是网上一篇文章介绍的方法,联系我实际的使用做了整理。有用的着的人就不用继续摸索了

STM32利用虚拟串口调试

STM32串口利用虚拟串口调试 解决*** error 30: undefined name of virtual register 问题 以下摘录于网络。 1. 利用VSPD将PC上的两个虚拟串口连接起来。如图我将COM2 和COM3连接起来。点击Addr pair。 2. 可以看到Virtual ports上将两个虚拟串口连接到了一起了。 3.虚拟串口准备就绪了。先将直接输入命令的方式来调试。我们打开KEIL MDK的,设置成仿真的模式。点DEBUG.在COMMAND串口输入: MODE COM2 38400, 0, 8, 1

说明: MODE命令的作用是设置被绑定计算机串口的参数。基本使用方式为:

MODE COMx baudrate, parity, databits, stopbits 其中: COMx(x = 1,2,…)代表计算机的串口号; baudrate代表串口的波特率;parity代表校验方式; databits代表数据位长度; stopbits代表停止位长度。 例如:MODE COM1 9600, n, 8, 1 设置串口1。波特率为9 600,无校验位,8位数据,1位停止位。 MODE COM2 19200, 1, 8, 1 设置串口2。波特率为19 200,奇校验,8位数据,1位停止位。 4、点回车后,再输入ASSIGN COM2 S1OUT 说明: COMx代表计算机的串口,可以是COM1、COM2、COM3或其他; inreg和outreg代表单片机的串口。对于只有一个串口的普通单片机,即SIN和SOUT;对于有两个或者多个串口的单片机,即SnIN和SnOUT(n=0,1,…即单片机的串口号)。 例如:ASSIGN COM1 < SIN > SOUT 将计算机的串口1绑定到单片机的串口(针对只有一个串口的单片机)。 ASSIGN COM2 < SIN > SOUT 将计算机的串口2绑定到单片机的串口0(针对有多个串口的单片机,注意串口号的位置)。 需要注意的是,参数的括号是不能省略的,而outreg则是没有括号的。

虚拟串口使用方法

虚拟串口使用方法 虚拟串口访问方法要配合上位机驱动软件一起使用。安装了虚拟串口驱动程序后,利用虚拟串口管理软件创建一个虚拟串口,此虚拟串口的使用方法相当于电脑自带的实串口,它会自动检测打开该串口的软件所用的波特率和数据位停止位等信息,并同步到串口服务器,不需要手动设置。虚拟串口软件具有网络连接心中检测功能,可以检测到网络的异常断开,并自动重新连接。 按以下步骤操作,先把串口服务器的工作模式设置为TCP 服务器模式,再安装驱动软件创建串口。 0,串口服务器的设置 先通过网页浏览器登录串口服务器管理页面,设置串口服务器的工作参数。在浏览器的URL地址栏中输入串口服务器的IP地址(如串口服务器的默认IP为:192.168.1.111,用户名为:admin,密码为:admin),打开管理登录界面: 输入用户名和密码后看到串口服务器的当前工作参数:

在对应的串口的[串口设置]功能选项中的[连接模式]选项中选择“TCP 服务器”(串口服务器一厂时一般默认为该模式),其它参数不用设置(驱动程序会根据实际检测到的情况自动 修改)。如下所示:

其它选项不用填,选择“保存为默认设置”后提交马上生效,关机后仍然生效,当[连接模式]改变时请重启串口服务器。 1 虚拟串口软件安装 要通过虚拟串口方式来访问设备必须安装此软件,通过socket方式即可不安装. 安装软件系统要求: 操作系统:windows2000/XP/2003; CPU:1.4G或以上; 内存:128M以上。 在安装文件中,双击Setup.exe 文件,进入安装界面.

点击下一步,进入下一个安装界面, 如果同意软件安装协议选择”我接受”,否则选择”取消”退出安装.选择”我接受”进入下一个安装界面: 选择程序安装目标文件夹,由于所需空间很小,只需要8M左右,一般按照默认则可,若要改变目标文件夹,在”浏览”中选择你的目标文件夹,单击”安装”按钮进入一下安装界面. 在安装过程中会弹出以下窗口,提示正在安装驱动,请勿关闭此窗口,驱动安装完成后些窗口会自动关闭。

虚拟串口Virtual Serial Port说明书

VSPM虚拟串口软件使用帮助虚拟串口软件使用帮助 (Ver2.5) (Ver2.5)

一、一、 软件介绍软件介绍 1、 功能说明功能说明 VSPM 虚拟串口软件可以将TCP/IP 连接、连接、UDP UDP 广播,映射成本机的虚拟COM 口,应用程序通过访问虚拟串口,就可以完成远程控制、数据传输等功能。等功能。 VSPM 虚拟串口软件特点:虚拟串口软件特点: 多虚拟串口映射多虚拟串口映射 收/发多线程架构发多线程架构 支持虚拟串口参数同步指令支持虚拟串口参数同步指令 自动错误纠正、自动连接、自动重新试自动错误纠正、自动连接、自动重新试 实时虚拟串口数据传输监控实时虚拟串口数据传输监控 集成Telnet 管理器管理器 集成设备探测器集成设备探测器 Server Server、、Client Client、、U DP 广播模式,广播模式,33种工作模式种工作模式 支持扩展DLL 插件,具备强大的扩展功能插件,具备强大的扩展功能 免费软件免费软件

2、 VSPM 软件适用范围软件适用范围 适用的嵌入式设备适用的嵌入式设备 可以将任何使用TCP/IP 或UDP 广播方式传输数据的嵌入式设备虚拟成本机COM 口。口。 这些设备包括串口服务器、无线DTU 或其他各类嵌入式以太网&TCP/IP 设备。设备。 虚拟串口互联虚拟串口互联 1台电脑用Server 模式和Client 模式运行2个VSPM 虚拟串口软件,可以实现虚拟串口互联。可以实现虚拟串口互联。 软件调试及串口通讯模拟软件调试及串口通讯模拟 利用各类扩展DLL 插件,可以使VSPM 模拟成一个串口设备,方便软件调试。件调试。 3、 VSP VSPM M 虚拟串口性能参数虚拟串口性能参数 项目项目 配置配置 端口速度端口速度 110110--115200bps 115200bps 数据位数据位 5、6、7、8 停止位停止位 1、2 校验位校验位 无、奇、偶、标记。无、奇、偶、标记。 流控流控 可设置流控,但VSPM 软件在转发时忽略此设置。软件在转发时忽略此设置。 发送缓冲发送缓冲 8K 字节,如果超过此长度,将丢弃超出部分的数据。字节,如果超过此长度,将丢弃超出部分的数据。

如何使用IFD9506之虚拟串口访问PLC

如何使用IFD9506之虚拟串口访问PLC 一、连接方式 PC IFD9506 PLC PC与IFD9506的连接方式为工业以太网。 IFD9506与PLC的连接方式为RS485,接线图如下: IFD9506 PLC D+ ---------------------- + D- ----------------------- - SG --------------------- SG 二、PLC之通讯设置 设置PLC之RS485接口的通讯参数为9600,7,E,1,通讯模式为ASCII,通讯地址为1。在程序之初始位置写入以下程序,并下载至PLC,且PLC处于运行状态,全新的PLC也可不进行此操作,因为,出厂默认值即为本例的设定值。 三、计算机之设置 计算机需设置与IFD9506连接之以太网卡的IP地址,本例中IP设置为192.168.1.1,子网掩码为255.255.255.0,默认网关为192.168.1.1,如下:

计算机的IP地址与IFD9506的IP地址必须同在一个网段内,且IP地址不可重复。 四、IFD9506之通讯设置 1、设置IFD9506之RS485接口的通讯参数为9600,7,E,1,通讯模式为ASCII,通讯地址为2,工业以太网之IP地址为192.168.1.5,子网掩码为255.255.255.0,默认网关为192.168.1.1,如下图: 设置通讯模式为“序列主站”,通讯口协议设置为“自定义COM2”。

此通讯口协议必须设置与PLC之通讯协议完全一致。 自定义项中将序列主站的监听端口设置为20001。 设置完成后,点击【应用】确认配置生效。 2、检验计算机与IFD9506的通讯连接是否正常 计算机与IFD9506的IP地址均设置完成后,将网线进行正确连接后,可使用计算机的运行命令对IFD9506进行检验,用来检查工业以太网是否连接正常,如下: 在运行命令框中输入ping 192.168.1.5(IFD9506之IP地址),如果连线正常则会出现以下对话框: 中间空白处会显示ping之IP地址。 3、增加虚拟串口 使用DCISoft V1.05(或更高版本)软件与IFD9506进行工业以太网连接。

USB模拟串口设置说明

19系列扫描枪USB模拟串口设置操作手册 1、串口驱动的安装: 1) 解压驱动文件“Honeywell Scanning and Mobility (HSM) USB serial driver.zip”。 2) 执行解压缩后的文件夹中的“_Install.bat”。 3) 将扫描枪插入电脑USB中,系统自动进行默认安装。 2、扫描器设置:确定扫描枪的读取方式为USBSerial,扫描下面条码。必须执行此操作。 3、串口配置 1) 查看端口号,驱动安装完成后,打开设备管理器,找到端口(COM和LPT),就能找到Xenon 1900 Area_Imaging Scanner,根据端口情况的不同,端口号不固定.

2) 串口参数设置.可以根据具体情况设置串口传输速率,数据位,校验位等.具体设置如下图. 3) 更改串口端口号: 如果需要统一端口号,在属性Force COM port 选项中按照下图设置。COM port可以是下面推荐的值,也可以是使用1~17以内未使用的端口数值。点击确定系统将自动更改。 更改后的端口:

4、串口测试 1)运行超级终端:串口配置完成后,我们可以通过电脑自带的超级终端进行验证串口配置是否正确。在开始–所有程序–附件–通讯–超级终端,点击超级终端 2)配置超级终端,链接使用COM15,串口属性按照系统属性里面的设置进行配置。 3)扫描条码。 配置完成后,在焦点处,扫描条码,将显示扫描到的数据。 如果能够快速显示数据,则表示我们虚拟串口的扫描枪,设置完成。

19GSR 车管所读取方式: 19GSR在车管所监控软件设置方式: 虚拟出串口的端口号

虚拟串口以及在Proteus中的使用

一,虚拟串口 虚拟串口是计算机通过软件模拟的串口,当其它设计软件使用到串口的时候,可以通过调用虚拟串口仿真模拟,以查看所设计的正确性。首先要安装虚拟串口设置的软件,网上有很多设置虚拟串口的软件,我用的是VSPD,可试用1个月,试用期过后,该软件将不能使用,但不用担心,所设置的虚拟串口不会消失,可以继续使用。 设置界面: 我设置的是COM3和COM4,软件只能成对设置,主要是因为通信时,一方可以监视另一方,如果仅设置1个虚拟串口的话,如你用COM3发送接收数据,但发送了什么接收到什么,你无法验证其正确与来源。这是人家编写软件的

高明之处。软件设置时将所设置的两个虚拟串口对接,这样就可实现发送与接收的监视。从设备管理器中可以看到 两个虚拟串口对接方式:

这样可以用串口调试助手调试串口通信了,从下图可以看到COM3发送的数据到达了COM4的接收区域,COM4发送的数据到达了COM3的接收区域,从而实现了COM3与COM4之间的互联互通。 到这虚拟串口已经设置好,对其它设计软件而言,虚拟串口和普通串口没有区别,如串口调试助手对虚拟串口的使用和普通串口的使用方法一样。二,虚拟串口在Proteus中的使用 下一步介绍一下虚拟串口在Proteus中的使用,更准确的应该说是“串口在Proteus中的使用”,只不过我们用软件实现仿真,虚拟串口在这使用的比较频繁。

先在Proteus中将环境建立起来,很简单,先需要两个元器件就可以建立连接VIRTUAL TERMINAL和COMPIM,如图VIRTUAL TERMINAL的TXD与COMPIM 的TXD相连,RXD与RXD相连,后面有图分析为什么这样相连: VIRTUAL TERMINAL是串口监视仪器,可以通过它将数据线上的符合RS232协议的波形捕捉到,并显示出来,也可以往数据线上发送RS232协议的波形;COMPIM为串口元件,可设置占用计算机上哪一个串口,可以是“实际串口”,也可以是“虚拟串口”,对Proteus而言,是分不清虚拟串口还是实际串口的。下一步就要设置通信速率以及通信格式了,在属性框中实现设置相同的就行了。这样就可实现数据的通信了。图为本人的VIRTUAL TERMINAL和COMPIM的设置:

虚拟串口以及在Proteus中的使用

虚拟串口以及在Proteus中的使用 一,虚拟串口 虚拟串口是计算机通过软件模拟的串口,当其它设计软件使用到串口的时候,可以通过调用虚拟串口仿真模拟,以查看所设计的正确性。首先要安装虚拟串口设置的软件,网上有很多设置虚拟串口的软件,我用的是VSPD,可试用1个月,试用期过后,该软件将不能使用,但不用担心,所设置的虚拟串口不会消失,可以继续使用。 设置界面: 我设置的是COM3和COM4,软件只能成对设置,主要是因为通信时,一方可以监视另一方,如果仅设置1个虚拟串口的话,如你用COM3发送接收数据,但发送了什么接收到什么,你无法验证其正确与来源。这是人家编写软件的高明之处。软件设置时将所设置的两个虚拟串口对接,这样就可实现发送与接收的监视。从设备管理器中可以看到

两个虚拟串口对接方式: 这样可以用串口调试助手调试串口通信了,从下图可以看到COM3发送的数据到达了COM4的接收区域,COM4发送的数据到达了COM3的接收区域,从而实现了COM3与COM4之间的互联互通。

到这虚拟串口已经设置好,对其它设计软件而言,虚拟串口和普通串口没有区别,如串口调试助手对虚拟串口的使用和普通串口的使用方法一样。 二,虚拟串口在Proteus中的使用 下一步介绍一下虚拟串口在Proteus中的使用,更准确的应该说是“串口在Proteus中的使用”,只不过我们用软件实现仿真,虚拟串口在这使用的比较频繁。 先在Proteus中将环境建立起来,很简单,先需要两个元器件就可以建立连接VIRTUAL TERMINAL和COMPIM,如图VIRTUAL TERMINAL的TXD与COMPIM的TXD相连,RXD 与RXD相连,后面有图分析为什么这样相连: VIRTUAL TERMINAL是串口监视仪器,可以通过它将数据线上的符合RS232协议的波形捕捉到,并显示出来,也可以往数据线上发送RS232协议的波形;COMPIM为串口元件,可设置占用计算机上哪一个串口,可以是“实际串口”,也可以是“虚拟串口”,对Proteus

虚拟串口简介[1]

虚拟串口简介 摘要 本文简单介绍虚拟串口的原理以及Link-com虚拟串口的特点。

一、虚拟串口简介 利用底层设备驱动技术,创建一个可供应用程序访问的编程接口,其行为特性与传统的串口一样,但计算机中并无对应的串口硬件。这样的串口我们称之为虚拟串口。虚拟串口通常通过其他通讯方式,与某一个串口硬件关联,使应用程序对虚拟串口的访问映射为对串口硬件的访问。 Link-com采用了国外成熟的虚拟串口驱动技术,针对串口通讯应用的特点,开发了串口联网设备配套的虚拟串口管理软件。使用虚拟串口管理软件,传统的应用程序可以不用修改或很少修改即可使用串口联网设备。 二、Link-com虚拟串口原理 虚拟串口平台启动后,会根据配置,在Windows驱动层创建虚拟串口,并自动与以太网上的串口联网设备连接,建立通信通道。当应用程序对虚拟串口的写操作时,虚拟串口管理平台通过连接,将数据发到串口联网设备,从串口联网设备的串口发送出去。当串口联网设备接收到串口数据时,通过连接发送给虚拟串口,由虚拟串口转发给应用程序。 一个虚拟串口可以与多个串口联网设备关联。此时,虚拟串口将数据复制,分别发送给多个串口联网设备。因此一个虚拟串口上关联多个设备会导致网络数据流量的增加。如果一

个应用内有多个串口联网设备,用户可以考虑将串口联网设备分组,每组对应一个虚拟串口。 三、Link-com虚拟串口的特点 Link-com的虚拟串口主要有如下特点: ·运行于Windows操作系统,支持Windows 2000,Windows XP,Windows 2003. ·可创建最多128个多个虚拟串口。 ·每个虚拟串口可与多个串口联网设备关联, ·配置方便,根据虚拟串口设置配置相应的串口联网模块参数。 ·支持TCP,UDP协议。 ·提供Server 和 Client 两种工作模式。 ·可动态调整串口波特率,校验位等参数 ·具有程序自启动功能。 四、关注我们 Link-com会将最新的产品和资料更新到https://www.doczj.com/doc/b34690424.html,网站上,请到此网站了解我们更多的信息。

在Proteus中使用虚拟串口的详细资料汇总

【转】虚拟串口以及在Proteus中的使用 一,虚拟串口 虚拟串口是计算机通过软件模拟的串口,当其它设计软件使用到串口的时候,可以通过调用虚拟串口 仿真模拟,以查看所设计的正确性。首先要安装虚拟串口设置的软件,网上有很多设置虚拟串口的软件, 我用的是VSPD,可试用1个月,试用期过后,该软件将不能使用,但不用担心,所设置的虚拟串口不会消失,可以继续使用。 设置界面: 我设置的是COM3和COM4,软件只能成对设置,主要是因为通信时,一方可以监视另一方,如果仅设置1个 虚拟串口的话,如你用COM3发送接收数据,但发送了什么接收到什么,你无法验证其正确与来源。 这是人家编写软件的高明之处。软件设置时将所设置的两个虚拟串口对接,这样就可实现发送与接收的监视。从设备管理器中可以看到

两个虚拟串口对接方式: COM4发送的数据到达了COM3的接收区域,从而实现了COM3与COM4之间的互联互通。

到这虚拟串口已经设置好,对其它设计软件而言,虚拟串口和普通串口没有区别,如串口调试助手对虚拟串口的使用和普通串口的使用方法一样。 二,虚拟串口在Proteus中的使用 下一步介绍一下虚拟串口在Proteus中的使用,更准确的应该说是“串口在Proteus中的使用”,只不过我们用软件实现仿真,虚拟串口在这使用的比较频繁。 先在Proteus中将环境建立起来,很简单,先需要两个元器件就可以建立连接VIRTUAL TERMINAL 和COMPIM,如图VIRTUAL TERMINAL的TXD与COMPIM的TXD相连,RXD与RXD相连,后面有图分析为什么 这样相连:

虚拟串口调试心得

Proteus虚拟串口调试心得 我们不需要实际的串口,通过proteus虚拟串口,再加串口调试工具就可以实 现调试,将单片机的程序加载到proteus仿真软件电路,串口助手就有反应, 1、首先,需要一个虚拟串口软件VSPD,文件名叫VSPD破解版.rar,安装虚 拟软件。 2、其次是需要虚拟串口调试小助手和串口调试的例子.rar(可选择下载它) 3、以上两项先安装虚拟串口软件,里面有破解说明,装完后启动界面是这 样的 4、需要增加虚拟端口,看到右边的ADD PAIR 了吗?就用它了,别急,先从它右边的两个下拉框中选择一下才行。 First 的选择框选择COM3 Second 的选择框选择COM4。就这二步,完成后成这个样子的界面

5 、现在到点击ADD pair按钮的时候了,点击下去,看到左边窗口出现了 整个窗口成这样的效果 不用管First 和Second 的选择框成了原来模样,这是软件自动默认归位造成的, 到了这个界面,恭喜你虚拟串口建成了。 6、接下来我们启动虚拟串口调试软件(软件调试小助手)

这里只需要注意串口号和波特率的选择下拉框,第一次启动时如上图界面串口号为: COM1;波特率为:9600。 7、打开自己的仿真图 单片机的RXD连接COMPIM的RXD,单片机的TXD连接COMPIM的TXD,终端VTERM的

RXD接TXD, TXD接RXD; 设置COMPIM的属性 我们需要关心的是Physical port、Physical Baud Rate、Virtual Baud Rate 这三个栏目,请切记住它们的设定值,特别是波特率的值一定要与源文件规定的值一定,比如我们这里是9600,则就是因为C程序源文件中设置的就是9600,在这里我们一定要选择好COM3,默认是COM1, 一定要注意呀。设置完成这个界面

C2000虚拟串口应用-设置说明

C2000串口服务器 串口服务器//模块 虚拟串口应用 设置说明

目录 一、按现场的监控主机(电脑)的网络参数正确配置每一C2000转换器/模块的参数 (2) 二、现场正确安装C2000,正确接入网络; (4) 三、在监控主机上安装最新C2000程序: (4) 四、虚拟串口管理程序中正确配置通讯参数: (4) 五、设置虚拟串口管理程序随系统自启动: (7) 六、上位软件(客户监控管理软件)使用虚拟串口 (7) 七、常见问题处理 (8)

在需要使用虚拟串口的情况下,可按如下流程参考配置: 一、按现场的监控主机(电脑)的网络参数正确配置每一C2000转换器/模块的参数(1)将C2000与电脑接同一个交换机上,或者使用交叉网线直接连接的情况下,使用C2000设置程序,搜索到C2000,双击它进入设置页面: (2)根据现场网络情况来正确设置各个C2000的IP、子网掩码、默认网关 如果监控主机与C2000在同一网段内通讯,则C2000的子网掩码和默认网关与监控主机完全相同,各C2000的IP地址与现有网络中的IP地址不能一样,且必须全部不重复,以免造成IP地址冲突导致通讯异常(对于百兆产品可配置DNS服务器以支持与使用域名的电脑通讯) (3)正确配置C2000的串口参数,这里有两种工作方式的设置: A、C2000的工作方式设置为TCP Client时必须设置正确的服务器IP和服务器端口号(所有C2000设置同样的服务器IP和端口号),必须勾选“使用虚拟串口或EDSockServer控件”这一项;然后确

定。(该工作方式下要正常工作请务必保证系统防火墙开放“服务器端口”)。 但是当电脑安装有防火墙导致通讯不上时,就要将C2000的工作方式设置为TCP Server B、C2000的工作方式设置为TCP Server(建议在电脑有防火墙无法连接C2000时使用)时必须记录C2000的IP和C2000端口号(在虚拟串口管理程序中“添加设为服务器的C2000”时需要用到),必须勾选“使用虚拟串口或EDSockServer控件”这一项,然后确定。

51单片机模拟串口的三种方法

随着单片机的使用日益频繁,用其作前置机进行采集和通信也常见于各种应用,一般是利用前置机采集各种终端数据后进行处理、存储,再主动或被动上报给管理站。这种情况下下,采集会需要一个串口,上报又需要另一个串口,这就要求单片机具有双串口的功能,但我们知道一般的51 系列只提供一个串口,那么另一个串口只能靠程序模拟。 本文所说的模拟串口,就是利用51的两个输入输出引脚如和,置1或0分别代表高低电 平,也就是串口通信中所说的位,如起始位用低电平,则将其置0,停止位为高电平,则将其置 1,各种数据位和校验位则根据情况置1或置0。至于串口通信的波特率,说到底只是每位电平持续 的时间,波特率越高,持续的时间越短。如波特率为9600BPS,即每一位传送时间为 1000ms/9600=,即位与位之间的延时为为毫秒。单片机的延时是通过执行若干条 指令来达到目的的,因为每条指令为1-3个指令周期,可即是通过若干个指令周期来进行延时的, 单片机常用的的晶振,现在我要告诉你这个奇怪数字的来历。用此频率则每个指令周期 的时间为(12/us,那么波特率为9600BPS每位要间融多少个指令周期呢? 指令周期s=(1000000/9600)/(12/=96,刚好为一整数,如果为4800BPS则为 96x2=192,如为19200BPS则为48,别的波特率就不算了,都刚好为整数个指令周期,妙吧。至于 别的晶振频率大家自已去算吧。 现在就以的晶振为例,谈谈三种模拟串口的方法。 方法一:延时法 通过上述计算大家知道,串口的每位需延时秒,中间可执行96个指令周期。 #define uchar unsigned char sbit P1_0 = 0x90; sbit P1_1 = 0x91; sbit P1_2 = 0x92; #define RXD P1_0 #define TXD P1_1 #define WRDYN 44 //写延时 #define RDDYN 43 //读延时 //往串口写一个字节 void WByte(uchar input) { uchar i=8; TXD=(bit)0; //发送启始 位 Delay2cp(39); //发送8位数据位 while(i--) { TXD=(bit)(input&0x01); //先传低位 Delay2cp(36);

虚拟串口概念

虚拟串口及其在串口转以太网中的应用 本文介绍虚拟串口的概念,以及如何在串口转以太网中利用该技术。 1.虚拟串口的概念 虚拟串口是用操作系统的虚拟驱动技术产生的串口(COM口),相对于计算机本身的硬件串口(COM1等)来说虚拟串口并不对应一个物理上的串口,但是计算机应用软件可以像硬件串口一样地使用虚拟串口,对于串口软件来说虚拟串口和硬件串口并没有区别。 图1. 串口设备利用虚拟串口的网络化升级 2.虚拟串口的应用 在串口转以太网中需要用到虚拟串口是因为有以下两种需要: 1. 应用软件的延续性。用户软件原来使用串口通信(COM1等),现在升级为网络方式通信后,用户的软件不想重新编写。此时使用虚拟串口技术创建一个虚拟串口(计算机上原来没有的COM5等),用户软件打开COM5即可和以前一样使用。极大地加快项目进度、产品上市。 2. 应用软件的通用性。用户不必为串口通信和软件通信开发两套系统。因为在不同的应用中用户可能采用串口通信,也有可能采用网络通信。虚拟串口技术屏蔽了这两种差别,提高了软件通用性。 3.虚拟串口的演示 创建虚拟串口:打开卓岚ZLVircom程序,进入“串口管理”界面,点击“添加”按钮,添加任意一个原来不存在的串口,例如

COM5。此时打开计算机的设备管理可以看到已经出现了一个新的串口COM5,同时如果用“超级终端”选择串口时已增加了COM5。此时你已经可以正常打开COM5使用了。 图2. 检查虚拟串口的存在 绑定虚拟串口:既然虚拟串口已经可以使用了,那么那com5的输出在哪里?输入又来此哪里?这就需要绑定了。进入ZLVircom的“设备管理”,从中选择一台NETCOM2000串口服务器(例如“串服1”),然后进入该设备的编辑,即可选择和这台NETCOM2000绑定的虚拟串口,这里选择COM5。之后在ZLVircon的主界面就出现了一条记录,表示虚拟串口COM5实际就等价于“串服1”这台NETCOM2000设备上的硬件串口。

1900USB模拟串口设置说明

硬件设置 1、扫描器设置: 确定扫描枪的读取方式为USB Serial,扫描下面条码。必须执行此操作。 补充: 如果需要恢复默认键盘方式读取和出厂设置,请扫描下面条码. 恢复出厂设置 扫描枪默认读取方式为USB Keyboard :

2、串口驱动的安装: 1)解压驱动文件“Honeywell Scanning and Mobility (HSM) USB serial driver.zip”。 2)执行解压缩后的文件夹中的“_Install.bat”。 3)将扫描枪插入电脑USB中,系统自动进行默认安装。 3、串口配置 1)查看端口号,驱动安装完成后,打开设备管理器,找到端口(COM和LPT),就能找到 Xenon 1900 Area_Imaging Scanner,根据端口情况的不同,端口号不固定. 2)串口参数设置.可以根据具体情况设置串口传输速率,数据位,校验位等.具体设置如下 图.

3)更改串口端口号: 如果需要统一端口号,在属性Force COM port 选项中按照下图设置。COM port可以是下面推荐的值,也可以是使用1~17以内未使用的端口数值。点击确定系统将自动更改。

更改后的端口: 4、串口测试 1)运行超级终端:串口配置完成后,我们可以通过电脑自带的超级终端进行验证串口配置是否正确。 在开始–所有程序–附件–通讯–超级终端,点击超级终端

2)配置超级终端,链接使用COM15,串口属性按照系统属性里面的设置进行配置。

3)扫描条码。 配置完成后,在焦点处,扫描条码,将显示扫描到的数据。 如果能够快速显示数据,则表示我们虚拟串口的扫描枪,设置完成。

4G DTU虚拟串口软件使用说明书

4G DTU虚拟串口软件使用说明书 本软件为4G DTU数据转发串口软件,可用于以下两种情况:转实串口和转虚串口。 一、实串口 该软件将从指定ID号的4G DTU F2X16收到的数据转发至计算机指定的物理串口,将从指定串口里收到的数据转发到指定ID号的4G DTU,设置如下:

打开软件,点击图标或者“窗口”-----“通信管理器”如图: 点击“增加通道”,如下图: 根据转发串口特性设置匹配的串口参数

注:在此窗口设置转发通道,图中的设置为将ID号为10000001的4G DTU 的数据转发到COM1,同时COM1里的数据也会转发到ID号为10000001的4G DTU。 设置好转发参数后,点击“完成”,提示“增加通道成功”,点击确定。 通道增加成功后,在通道管理器列表会体现相应的转发参数,如下图: 注意:A、可以将不同ID号4G DTU的数据转向一个串口,但不能将相同ID号4G

DTU数据转向几个不同的串口。 B、通道管理器可以按需求继续添加通道,通道数量无限制,同时也可以 对现有的通道进行修改或者删除。 二、虚串口 首先按以下步骤安装虚拟串口驱动: 首先点该软件左上角菜单:“操作”-----“增加虚串口驱动” 然后会弹出安装驱动的对话框,点确定即可。显示安装成功后会弹出找到新硬件向导,如下图:

该过程会弹出两次,每次会增加一个串口,也就是说一次会虚拟出两个对应的串口。 要虚拟多个串口请按以上步骤重复操作即可。 三、中心服务器参数设置 首先建立中心服务器的基本参数 点击设置按钮,打开设置项,如下图:

在此设置该软件侦听的端口号2007,以及在线维持时间240s(系统当前时间减掉最后一次收到数据包的时间的值,如果这个值大于240s,转发软件则判断此4G DTU已断线,程序界面上将显示4G DTU断线状态)。 “通信管理器”和“设置”里的参数在设置过一次后将保存在数据库,下次启动不用重新设置,如需更改参数直接改动即可保存。 四、中心服务器连接状态说明 所有设置完成后点击启动服务按钮即可,此时中心软件就处在等待4G DTU的连接状态,如下图: 启动后4G DTU未连接状态 启动后列表会提示相关信息,等待4G DTU的连接,这时设备连接状态显示“未连接”。

KEIL中如何用虚拟串口调试串口程序

KEIL中如何用虚拟串口调试串口程序 以前没接触过串口,一直都以为串口很复杂。最近在做一个新项目,用单片机控制GSM模块。单片机和GSM模块接口就是串口。调试完后觉得串口其实很简单。“不过如此”。这可能是工程师做完一个项目后的共同心态吧。下面详细介绍下如何用虚拟串口调试串口发送接收程序。 需要用到三个软件:KEIL,VSPD XP5(virtual serial ports driver xp5.1虚拟串口软件),串口调试助手。 1、首先在KEIL里编译写好的程序。 2、打开VSPD,界面如下图所示: 左边栏最上面的是电脑自带的物理串口。点右边的add pair,可以添加成对的串口。一对串口已经虚拟互联了,如果添加的是COM3、COM4,用COM3发送数据,COM4就可以接收数据,反过来也可以。 3、接下来的一步很关键。把KEIL和虚拟出来的串口绑定。现在把COM3和KEIL绑定。在KEIL中进入DEBUG模式。在最下面的COMMAND命令行,输入 MODE COM3 4800,0,8,1(设置串口3的波特率、奇偶校验位、数据位、停止位,打开COM3串口,注意设置的波特率和程序里设置的波特率应该一样) ASSIGN COM3 SOUT(把单片机的串口和COM3绑定到一起。因为我用的单片机是AT892051,只有一个串口,所以用SIN,SOUT,如果单片机有几个串口,可以选择S0IN,S0OUT,S1IN,S1OUT。)

4、打开串口调试助手 可以看到虚拟出来的串口COM3、COM4,选择COM4,设置为波特率4800,无校验位、8位数据位,1位停止位(和COM3、程序里的设置一样)。打开COM4。 现在就可以开始调试串口发送接收程序了。可以通过KEIL发送数据,在串口调试助手中就可以显示出来。也可以通过串口调试助手发送数据,在KEIL中接收。 这种方法的好处是不用硬件就可以调试。这是网上一篇文章介绍的方法,联系我实际的使用做了整理。有用的着的人就不用继续摸索了

虚拟串口管理软件使用说明

虚拟串口管理软件使用说明 Date: 2011/1/4 Version 1.0.0 深圳市三旺通信技术有限公司 https://www.doczj.com/doc/b34690424.html,

声明 版权所有: 本文档版权归深圳市三旺通信技术有限公司所有,公司保留更改等权利。 非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容 的部分或全部,并不得以任何形式传播。 商标声明: 和是深圳市三旺通信技术有限公司的注册商标。本文档提及的其他所有商标或注册商标,由各自的所有人拥有。本文约定: 由于产品版本升级或其他原因,本文档内容会不定期进行更新。除非另 有约定,本文档仅作为使用指导,本文档中的所有陈述、信息和建议不 构成任何明示或暗示的担保。 修订历史: 注意事项: 在阅读本手册时,敬请注意下列图标: :此图标表示在使用本手册过程中必要的解释信息。 :此图标表示在使用本手册需要特别注意的事项。

技术支持 技术支持邮箱:support@https://www.doczj.com/doc/b34690424.html, 免费技术支持热线:400-600-4496 公司网址:https://www.doczj.com/doc/b34690424.html, https://www.doczj.com/doc/b34690424.html, 各地销售与服务网点 ●深圳市三旺通信技术有限公司 地址:深圳市南山区西丽九祥岭工业区2栋3楼 电话:+86(0755)26702688 26700713 266280877 传真:0755-******** E-mail:sale@https://www.doczj.com/doc/b34690424.html, ●南京营销中心●广州营销中心 地址:南京市汉中门外3号汉中翠庭1单元502室地址:广州市天河区中山大道西荷光路269号现代公寓635室电话:025-******** 电话:020-******** 传真:025-******** 传真:020-******** E-mail:jiangyunqi@https://www.doczj.com/doc/b34690424.html, E-mail:tubin@https://www.doczj.com/doc/b34690424.html, ●北京营销中心●成都营销中心 地址:北京海淀区中关村南二街7号华星一层地址:成都市一环路东五段108号东恒国际1栋1区2001 电话:010-******** 82616166 82616266 62553393 电话:028-******** 传真:010-******** 传真:028-******** E-mail:daigangqiang@https://www.doczj.com/doc/b34690424.html, E-mail:tuhuadong@https://www.doczj.com/doc/b34690424.html, ●西安营销中心●上海营销中心 地址:西安市雁塔西路158号双鱼花园A座1201G 地址:上海市徐汇区漕溪路250号银海大厦A608 电话:029-******** 电话:021-6090 4901 E-mail:baiguangyong@https://www.doczj.com/doc/b34690424.html, ●长沙营销中心●武汉营销中心 地址:长沙市开福区湘雅路上麻园岭301号一单元403室地址:武汉市武昌区中南路2号中建广场C座19H室 电话:0731-******** 电话:027-******** 传真:0731-******** 传真:027-******** E-mail:xuyiming@https://www.doczj.com/doc/b34690424.html, E-mail:shixiangdong@https://www.doczj.com/doc/b34690424.html,

巧用虚拟串口软件调试串口通信

巧用电脑虚拟串口软件调试串口通信 殷建彬朱前华 笔者在试用Proteus这个软件的时候,在Labcenter Electronics\Proteus 6 Demonstration\SAMPLES\目录下看到COMPIM Demo这个例子,电路图如图1所示。它用虚拟串口物理模型(左侧的P1)和一个虚拟终端(右侧的VT1)通信。在使用这个例子的时候,笔者准备使用一个串口调试软件sscom32来检验一下,发现需要把电脑的两个串口连接起来,并且要串口2、3脚颠倒使用,当时手头没有这样的连线,也就没有进行这个试验。后来有一天突然想到软驱、光驱、打印机甚至PC都能虚拟,串口也应该可以吧?功夫不负有心人,终于在一个外国的网站上找到一个虚拟串口软件――Virtual Serial Ports kit。 虚拟串口的使用 Virtual Serial Ports kit在它的官方网站上下载到的最新版本是4.72,可惜只有15天的试用期。下载解压后点击setup.exe进行安装,安装的时候,要求你同意它的协议才能继续安装。然后一路“NEXT”,就可以安装成功了!安装完毕 点击桌面上的图标,出现图2所示的界面。点击工具栏的图标,出现了 如图3所示的对话框,这是让我们设置虚拟串口的。一般来说,电脑硬件上已经设置串口COM1和COM2,所以我们可以把虚拟串口设置成COM3和COM4,让这两个串口通讯,点击“OK”按钮,这个时候软件的界面变成了如图4所示 的界面了。如果发现工具栏上按钮是灰色,还需要点击一下,使它变成绿色, 这意味着两个串口可以正常通信了。 笔者先试验了一下这个软件。同时运行两个sscom32软件,既双击sscom32图标两次,软件的界面如图5所示。点击左侧串口选择下拉箭头,如图6,把运行的两个sscom32的串口分别设置为COM3和COM4(要和虚拟串口软件的一 致。)点击“打开串口”按钮,打开两个串口,使“打开串口”前面的 指示灯变为红色。这个时候我们就可以进行两个串口通信的试验了。在其中一个sscom32 要发送的栏里添上几个字母,然后点击的“发送”按钮,在另一个sscom32里就接收到刚才发送的字母了。 虚拟串口和Proteus结合调试串口通信 打开Proteus的ISIS,然后打开Labcenter Electronics\Proteus 6 Demonstration\SAMPLES\目录下的COMPIM Demo这个例子。右键点击P1,选中它,然后点击左键出现如图7所示的对话框。按照如图所示的情形设置P1的通信串口(COM3)、波特率(2400)等。先打开Virtual Serial Ports kit软件,软件的设置和上面的一样即可。然后运行sscom32软件,把它的串口设置为COM4(必须先运行Virtual Serial Ports kit,才会出现COM3和COM4口选择的),波特率要和P1的设置一致,以便他们之间能进行通信。 点击ISIS的右下脚的运行按钮,或者按F12,让Proteus模拟运行, 这个时候出现虚拟终端的对话框,如图8所示。在Sscom32的字符输入框里随

模拟串口的三种方法及C语言

51单片机模拟串口的三种方法 [ 2007-8-2 9:50:00 | By: MCUBLOG ] (转)随着单片机的使用日益频繁,用其作前置机进行采集和通信也常见于各种应用,一般是利用前置 机采集各种终端数据后进行处理、存储,再主动或被动上报给管理站。这种情况下下,采集会需 要一个串口,上报又需要另一个串口,这就要求单片机具有双串口的功能,但我们知道一般的51 系列只提供一个串口,那么另一个串口只能靠程序模拟。 本文所说的模拟串口,就是利用51的两个输入输出引脚如P1.0和P1.1,置1或0分别代表高低电 平,也就是串口通信中所说的位,如起始位用低电平,则将其置0,停止位为高电平,则将其置 1,各种数据位和校验位则根据情况置1或置0。至于串口通信的波特率,说到底只是每位电平持续 的时间,波特率越高,持续的时间越短。如波特率为9600BPS,即每一位传送时间为 1000ms/9600=0.104ms,即位与位之间的延时为为0.104毫秒。单片机的延时是通过执行若干条 指令来达到目的的,因为每条指令为1-3个指令周期,可即是通过若干个指令周期来进行延时的, 单片机常用11.0592M的的晶振,现在我要告诉你这个奇怪数字的来历。用此频率则每个指令周期 的时间为(12/11.0592)us,那么波特率为9600BPS每位要间融多少个指令周期呢? 指令周期s=(1000000/9600)/(12/11.0592)=96,刚好为一整数,如果为4800BPS则为 96x2=192,如为19200BPS则为48,别的波特率就不算了,都刚好为整数个指令周期,妙吧。至于 别的晶振频率大家自已去算吧。 现在就以11.0592M的晶振为例,谈谈三种模拟串口的方法。 方法一:延时法 通过上述计算大家知道,串口的每位需延时0.104秒,中间可执行96个指令周期。 #define uchar unsigned char sbit P1_0 = 0x90; sbit P1_1 = 0x91; sbit P1_2 = 0x92; #define RXD P1_0 #define TXD P1_1 #define WRDYN 44 //写延时 #define RDDYN 43 //读延时 //往串口写一个字节 void WByte(uchar input) { uchar i=8; TXD=(bit)0; //发送启始 位 Delay2cp(39); //发送8位数据位 while(i--) { TXD=(bit)(input&0x01); //先传低位 Delay2cp(36);

相关主题
相关文档 最新文档