STM32F1 DSP

Started by tha, June 28, 2021, 09:39:56 AM

Previous topic - Next topic

tha

2.3 SIMD instructions

นอกเหนือจาก MAC instructions ที่ปฏิบัติ a multiplication and an accumulation ใน a single cycle, ยังมี the SIMD (Single Instruction Multiple Data) instructions, ที่กระทำ multiple identical operations ใน a single cycle instruction.

Table 3 แสดงรายการบาง SIMD instructions.



ตัวอย่างต่อไปนี้อธิบายว่า the __shadd8 instruction ทำงานอย่างไร.



The __shadd8 การคืนกลับที่แท้จริง:
•    การบวกที่แบ่งเท่าๆกันของไบต์แรกจากแต่ละ operand, ในไบต์แรกของค่าคืนกลับ
•    การบวกที่แบ่งเท่าๆกันของไบต์ที่สองจากแต่ละ operand, ในไบต์ที่สองของค่าคืนกลับ
•    การบวกที่แบ่งเท่าๆกันของไบต์ที่สามจากแต่ละ operand, ในไบต์ที่สามของค่าคืนกลับ
•    การบวกที่แบ่งเท่าๆกันของไบต์ที่สี่จากแต่ละ operand, ในไบต์ที่สี่ของค่าคืนกลับ

tha

3 Algorithms

3.1 Filters

ตัวกรองดิจิทัลที่พบบ่อยที่สุดคือ:
•    FIR (Finite Impulse Response): ถูกใช้, ท่ามกลาง, ใน motor control และ audio equalization
•    IIR (Infinite Impulse Response): ถูกใช้ใน smoothing data
The IIR filter สามารถถูกใช้เพื่อจัดให้มีใช้ filters อย่างเช่น Butterworth, Chebyshev, และ Bessel.

3.2 Transforms

A transform เป็น a function ที่แปลง data จาก a domain หนึ่งไปเป็นโดเมนอื่น.
The FFT (Fast Fourier Transform) เป็นตัวอย่างทั่วไป: มันเป็น an efficient algorithm ที่ถูกใช้แปลง a discrete time-domain signal ไปเป็น an equivalent frequency-domain signal โดยอ้างอิง the Discrete Fourier Transform (DFT).

tha

4 DSP application development

4.1 CMSIS library

The Arm® Cortex® Microcontroller Software Interface Standard (CMSIS) คือ a vendor-independent hardware abstraction layer สำหรับทุก Cortex® processor based devices. CMSIS ถูกพัฒนาโดย Arm® ร่วมกับ silicon, tools and middleware partners.

แนวคิดเบื้องหลัง CMSIS คือการจัดเตรียมอินเทอร์เฟซซอฟต์แวร์ที่สม่ำเสมอและเรียบง่ายให้กับ the processor สำหรับ interface peripherals, real-time operating systems, และ middleware, การใช้ software ซ้ำง่าย, ลดเคิร์พการเรียนรู้สำหรับ new microcontroller developments และลดเวลาการวางตลาดสำหรับ new devices.

CMSIS library มากับ ST firmware ภายใต้ \Drivers\CMSIS\.

The CMSIS-DSP library ประกอบด้วย :
•    Basic mathematical functions พร้อมด้วย vector operations
•    Fast mathematical functions, อย่าง sine and cosine
•    Complex mathematical functions อย่าง calculating magnitude (มีค่า real + imagin อย่าง (1+j2))
•    Filtering functions อย่าง FIR or IIR
•    Matrix computing functions
•    Transform functions อย่าง FFT
•    Controller functions อย่าง PID controller
•    Statistical functions(สถิติ) อย่าง calculating minimum or maximum
•    Support functions อย่างการแปลงจากรูปแบบหนึ่งไปเป็นรูปแบบอื่น
•    Interpolation functions

algorithms ส่วนใหญ่ใช้ floating-point and fixed-point ในรูปแบบต่างๆ ตัวอย่างเช่น ในกรณี FIR, the available Arm® functions คือ :
•    arm_fir_init_f32
•    arm_fir_f32
•    arm_fir_init_q31
•    arm_fir_q31
•    arm_fir_fast_q31
•    arm_fir_init_q15
•    arm_fir_q15
•    arm_fir_fast_q15
•    arm_fir_init_q7
•    arm_fir_q7


tha

4.2 DSP demonstration overview

เป้าหมายของการสาธิตนี้คือการแสดงการผสานรวมอย่างเต็มรูปแบบด้วย STM32F429 โดยใช้ ADC, DAC, DMA และ timers, และยังเรียกใช้ CMSIS routines, ทั้งหมดด้วยการใช้ graphics, โดยใช้ประโยชน์จาก the 2.4" QVGA TFT LCD ที่รวมอยู่ใน the discovery board.

การสาธิตนี้ยังแสดงให้เห็นว่าการย้ายแอปพลิเคชันจาก an STM32F4 microcontroller ไปยังตัวหนึ่งของ the STM32F7 Series ง่ายเพียงใด.

A graphical user interface ถูกออกแบบโดยใช้ STemWin, เพื่อง่ายต่อการเข้าถึงไปยังคุณลักษณะต่างๆของ the demonstration.