STM32F1 Programming Manual

Started by tha, January 16, 2021, 06:11:52 AM

Previous topic - Next topic

tha

PM0056
Programming manual
STM32F10xxx/20xxx/21xxx/L1xxxx
Cortex®-M3 programming manual


Introduction

programming manual นี้จัดให้มีข้อมูลสำหรับ application และ system-level software developers. มันให้คำอธิบายอย่างเต็มของ the STM32F10xxx/20xxx/21xxx/L1xxxx Cortex®-M3 processor programming model, instruction set และ core peripherals

The STM32F10xxx/20xxx/21xxx/L1xxxx Cortex®-M3 processor คือ a high performance 32-bit processor ถูกออกแบบมาสำหรับ the microcontroller market. มันเสนอประโยชน์อย่างมีนัยสำคัญแก่นักพัฒนา, ได้แก่
•    processing performance ที่โดดเด่นรวมกันกับ a fast interrupt handling
•    Enhanced system debug พร้อมด้วย extensive breakpoint และ trace capabilities
•    Efficient processor core, system and memories
•    Ultra-low-power consumption พร้อมด้วย integrated sleep modes
•    Platform security

tha

1.3 About the STM32 Cortex®-M3 processor and core peripherals

The Cortex-M3 processor ถูกสร้างขึ้นจาก a high-performance processor core, พร้อมด้วย a 3-stage pipeline Harvard architecture, ทำให้เหมาะอย่างยิ่งสำหรับ demanding embedded applications. The processor มอบ exceptional power efficiency ผ่านทาง an efficient instruction set และการออกแบบที่ได้รับการปรับแต่งอย่างครอบคลุม, จัดให้มี high-end processing hardware รวมถึง single-cycle 32x32 multiplication(คูณ) และ dedicated hardware division(หาร).

tha

เพื่ออำนวยความสะดวกในการออกแบบของ cost-sensitive devices, the Cortex-M3 processor จัดให้มีใช้ tightly-coupled system components ที่ลด processor area ในขณะที่ปรับปรุงให้ดีขึ้นอย่างมีนัยยะ interrupt handling and system debug capabilities. The Cortex-M3 processor จัดให้มีใช้ a version of the Thumb® instruction set, ทำให้แน่ใจว่า high code density และลด program memory requirements. The Cortex-M3 instruction set จัดให้มีประสิทธิภาพที่ยอดเยี่ยมตามที่คาดไว้ของ a modern 32-bit architecture, พร้อมด้วย the high code density of 8-bit and 16-bit microcontrollers.


tha

The Cortex-M3 processor ผสานรวมอย่างใกล้ชิด a configurable nested interrupt controller (NVIC), เพื่อมอบ industry-leading interrupt performance. The NVIC ประกอบด้วย a non-maskable interrupt (NMI), และจัดให้มีสูงถึง 256 interrupt priority levels. การผสานรวมอย่างแน่นหนาของ the processor core และ NVIC ให้การดำเนินการที่รวดเร็วของ interrupt service routines (ISRs), ซึ่งช่วยลดเวลาแฝงของอินเตอร์รัปต์ลงได้อย่างมาก. นี้ถูกทำให้สำเร็จลงผ่านทาง the hardware stacking of registers, และมีความสามารถหยุดค้างไว้ load-multiple และ store-multiple operations. Interrupt handlers ไม่ต้องการ assembler stubs ใดๆ, เอาออก code overhead ใดๆจาก the ISRs. Tail-chaining optimization ลดอย่างมีนัยยะ the overhead อีกด้วยเมื่อสวิทชิ่งจาก ISR ตัวหนึ่งไปยังตัวอื่น.

เพื่อเพิ่มประสิทธิภาพ low-power designs, the NVIC จะทำงานร่วมกับ the sleep modes, ซึ่งรวมถึง a deep sleep function ที่สามารถทำให้ the STM32 เข้าสู่ STOP หรือ STDBY mode.

tha

1.3.1 System level interface

The Cortex-M3 processor จัดให้มีหลาย interfaces โดยใช้ AMBA® technology เพื่อจัดให้มี high speed, low latency memory accesses. มันรองรับ unaligned data accesses และจัดให้มีใช้ atomic bit manipulation ที่ทำให้สามารถ faster peripheral controls, system spinlocks และ thread-safe Boolean data handling.

tha

1.3.2 Integrated configurable debug

The Cortex-M3 processor จัดให้มีใช้ a complete hardware debug solution. นี้จัดให้มี high system visibility of the processor and memory ผ่านทางอย่างใดอย่างหนึ่ง a traditional JTAG port หรือ a 2-pin Serial Wire Debug (SWD) port ที่เหมาะสำหรับ small package devices.

For system trace the processor จะรวม an Instrumentation Trace Macrocell (ITM) ควบคู่ไปกับ data watchpoints และ a profiling unit. เพื่อให้สามารถโปรไฟล์ที่ง่ายและคุ้มค่าของ the system events เหล่านี้สร้างขึ้น, a Serial Wire Viewer (SWV) สามารถส่งออกสายหนึ่งของ software-generated messages, data trace, and profiling information ผ่านทาง a single pin.

The optional Embedded Trace Macrocell™ (ETM) ส่งมอบ unrivalled instruction trace capture ใน an area ที่เล็กกว่า traditional trace units มาก, ทำให้ many low cost MCUs สามารถจัดให้มีใช้ full instruction trace ได้เป็นครั้งแรก.

tha

1.3.3 Cortex®-M3 processor features and benefits summary

•   การผสานรวมของ system peripherals ลด area and development costs
•   Thumb instruction set รวม high code density เข้ากับ 32-bit performance
•   Code-patch ability สำหรับ ROM system updates
•   Power control optimization of system components
•   รวบรวม sleep modes สำหรับ low power consumption
•   Fast code execution ยอมให้ processor clock ช้าลงหรือเพิ่ม sleep mode time
•   Hardware division(หาร) and fast multiplier(ตัวคุณ)
•   Deterministic, high-performance interrupt handling สำหรับ time-critical applications
•   Extensive debug and trace capabilities:
     –   Serial Wire Debug and Serial Wire Trace ลด the number of pins ที่ต้องการสำหรับ debugging and tracing.

tha

1.3.4 Cortex®-M3 core peripherals

เหล่านี้คือ:

Nested vectored interrupt controller

The nested vectored interrupt controller (NVIC) คือ an embedded interrupt controller ที่รองรับ low latency interrupt processing.

System control block

The system control block (SCB) คือ the programmers model เชื่อมต่อถึง the processor. มันจัดให้มี system implementation information และ system control, รวมถึง configuration, control, และการรายงานของ system exceptions.

System timer

The system timer, SysTick, คือ a 24-bit count-down timer. ใช้สิ่งนี้เป็น a Real Time Operating System (RTOS) tick timer หรือเป็น a simple counter.