Cov txheej txheem:

STM32CubeMx Microphone (STM32F407VG): 5 Kauj Ruam
STM32CubeMx Microphone (STM32F407VG): 5 Kauj Ruam

Video: STM32CubeMx Microphone (STM32F407VG): 5 Kauj Ruam

Video: STM32CubeMx Microphone (STM32F407VG): 5 Kauj Ruam
Video: STM32 Microphone Audio Acquisition: Part 1, Microphone Basics 2024, Kaum ib hlis
Anonim
STM32CubeMx Microphone (STM32F407VG)
STM32CubeMx Microphone (STM32F407VG)

Nyob zoo! Hauv txoj haujlwm no peb yuav sim kom tau txais lub suab los ntawm kev siv lub microphone (sab nraud tsis nyob hauv lub microphone) thiab ua si los ntawm tus hais lus. Cov ntawv qhia no yuav luv heev raws li kuv yuav muab cov lus piav qhia ntawm qhov project los ntawm kev siv qee cov vis dis aus. Yog li, cia peb dhia mus rau qhov haujlwm:)

Kauj Ruam 1: Kev Xav Tau Software thiab Kho Vajtse

Yuav tsum tau kho vajtse:

  • STM32F4 tshawb pom lub rooj tsavxwm (lossis lwm lub rooj tsav xwm STM32F4)
  • MAX9814 electret microphone nrog amplifier
  • PAM8403 suab amplifier module
  • 4 OHM tus hais lus

Software yuav tsum tau:

  • STM32CubeMX
  • Keil uVision 5

Kauj Ruam 2: Txheeb Xyuas Txoj Haujlwm Txoj Haujlwm

Yog li, cia peb nkag siab ua ntej seb peb xav ua dab tsi. Ua ntej, peb xav tau lub suab los ntawm lub tshuab electret microphone. Raws li koj paub, MCU txheej txheem txhua yam digitally. Txawm li cas los xij, suab yog analog teeb liab. Yog li, peb yuav tsum hloov nws mus rau cov teeb liab digital thiab qhov no ua tiav los ntawm ADC (analog to digital converter) thiab cov txheej txheem hu ua piv txwv. Koj tuaj yeem tshawb nrhiav cov ntaub ntawv ntxiv. Ntawm no muaj ib lub ntsiab lus tseem ceeb: Txhawm rau kom tau txais lub suab los ntawm tus neeg hais lus tsim nyog, kev ntsuas tus qauv yuav tsum yog tsawg kawg ob zaug ntau dua li lub suab zaus ntawm qhov tso tawm. Qhov no hu ua Nyquist-Shannon theorem.

Tom qab hloov nws mus rau cov teeb liab digital peb tuaj yeem ua nws raws li peb xav tau thiab tom qab ntawd tso lub suab ntawd dua. Txawm li cas los xij, tus neeg hais lus xav tau teeb liab analog. Yog li, peb xav tau hloov pauv lub teeb liab digital no mus rau analog rov qab. Rau qhov ntawd peb yuav siv DAC (digital rau analog hloov pauv). Thaum kawg peb tuaj yeem tso lub suab ntawd:)

Kauj Ruam 3: Yuav Teeb Li Cas thiab Siv ADC thiab DAC Nrog DMA

Raws li kuv tau hais, Kuv tau kawm cov txheej txheem no los ntawm cov vis dis aus. Kuv yuav muab qhov txuas rau daim vis dis aus no. Ua siab ntev thiab mloog zoo. Nws piav qhia tag nrho cov txheej txheem.

Txuas: Part1 thiab Part2

*Nco tseg: Txheeb xyuas kab kab no hauv koj cov cai thiab pab kom DMA thov txuas ntxiv mus:

hadc1. Init. DMAContinuousRequests = ENABLE;

Kauj ruam 4: Tawm rau Tus Hais Lus

Tawm rau Tus Hais Lus
Tawm rau Tus Hais Lus

Tom qab ua txhua kauj ruam, koj yuav tsum txuas tus neeg hais lus raws li cov duab saum toj no. Tom qab ntawd, ua suab hauv koj lub xov tooj thiab txo lub suab kom qis uas koj tuaj yeem hnov nyuaj. Tom qab ntawd, nqa lub xov tooj ze rau lub microphone thiab koj yuav hnov lub suab los ntawm tus hais lus nrov nrov. Tsis txhob tham nrog lub microphone, vim nws yuav nyuaj rau ntes seb puas muaj cov lus los ntawm tus hais lus lossis tsis:)

Kauj Ruam 5: Xaus

Yog li, peb tau mus txog qhov kawg ntawm qhov haujlwm. Yog tias koj muaj lus nug lossis teeb meem thov tsis txhob ua siab deb nug:)

Pom zoo: