Cov txheej txheem:

ESP32: Koj Puas Paub DAC Yog Dab Tsi?: 7 Kauj Ruam
ESP32: Koj Puas Paub DAC Yog Dab Tsi?: 7 Kauj Ruam

Video: ESP32: Koj Puas Paub DAC Yog Dab Tsi?: 7 Kauj Ruam

Video: ESP32: Koj Puas Paub DAC Yog Dab Tsi?: 7 Kauj Ruam
Video: dab neeg 1651 siv yis adventure EP 32 2024, Hlis ntuj nqeg
Anonim
Image
Image
ESP32: Koj Puas Paub Dab Tsi DAC?
ESP32: Koj Puas Paub Dab Tsi DAC?

Hnub no, peb yuav tham txog ob qhov teeb meem. Thawj qhov yog DAC (Digital-to-Analog Converter). Kuv xav tias nws yog qhov tseem ceeb, vim tias dhau los ntawm nws, piv txwv li, peb ua lub suab tso tawm hauv ESP32. Qhov teeb meem thib ob uas peb yuav hais txog niaj hnub no yog oscilloscope. Peb mam li suav sau cov lej DAC yooj yim hauv ESP32, thiab pom kev nrog oscilloscope cov teeb liab zoo sib xws tsim los ntawm lub microcontroller.

Lub rooj sib txoos niaj hnub no yooj yim heev, yog li ntawd kuv thiaj li tsis kaw qhov ua qauv qhia. Nws yooj yim txaus kom nkag siab nrog tsuas yog cov duab tso rau ntawm no. Yeej, peb muaj ESP32 uas, los ntawm txoj haujlwm, yuav tsim ntau hom kev hloov pauv.

Peb siv GPIO25 raws li kev tso tawm, thiab GND raws li kev siv.

Kauj Ruam 1: Cov Khoom Siv

Cov peev txheej siv
Cov peev txheej siv

• ESP32

• Oscilloscope

• Protoboard (yeem)

• Cov dhia

Kauj Ruam 2: Pine Siv

Pine Siv
Pine Siv

Hauv qhov piv txwv no, peb yuav siv GPIO 25, uas sib haum rau DAC_1.

Lwm qhov piv txwv uas tuaj yeem siv tau yog GPIO 26, uas sib haum rau DAC_2.

Kauj Ruam 3: ESP32 Code - Wave Matrix

ESP32 Code - Wave Matrix
ESP32 Code - Wave Matrix
ESP32 Code - Wave Matrix
ESP32 Code - Wave Matrix
ESP32 Code - Wave Matrix
ESP32 Code - Wave Matrix

Peb muaj qhov chaws uas yuav tsim plaub hom kev hloov pauv.

Ua ntej tshaj plaws, peb sib sau ua ke ob daim duab.

Ntawm no, kuv hais qhia qhov zoo ntawm lub sine thiab daim duab peb sab voos.

Hauv cov duab, kuv tso saib cov duab ntawm cov hniav pom thiab lub xwmfab.

Raws li rau qhov chaws, tsis muaj qhov yuav tsum tau ua hauv Teeb. Hauv Loop, Kuv txiav txim siab txoj haujlwm matrix sib xws rau hom yoj thiab siv cov piv txwv ib puag ncig. Peb sau cov ntaub ntawv khaws tseg hauv cov lej ntawm tus pin 25. Txheeb xyuas yog tias "i" nyob hauv kab lus kawg ntawm kab ntawv. Yog tias yog, "i" tau rov pib dua thiab peb rov qab mus rau qhov pib.

Kuv xav ua kom pom tseeb tias DAC no sab hauv ESP32 ntawm STM32, uas yog, ntawm cov chips, feem ntau, yog lub peev xwm me. Lawv yog cov siv dav dav. Txhawm rau tsim kom muaj cov nthwv dej ntau, muaj DAC nti nws tus kheej, muab los ntawm Texas lossis Cov Khoom Siv Sib Piv, piv txwv.

teeb tsa tsis muaj dab tsi () {//Serial.begin(115200); } // TESTE SEM POSICIONAMENTO (MAIOR FREQUENCIA) /* void loop () {dacWrite (25, 0xff); // 25 lossis 26 dacWrite (25, 0x00); // 25 ou 26 // delayMicroseconds (10); } */// TESTE COM POSICIONAMENTO (MENOR FREQUENCIA) void loop () {byte wave_type = 0; // Sine // byte wave_type = 1; // Daim duab peb sab // byte wave_type = 2; // Sawtooth // byte wave_type = 3; // Square dacWrite (25, WaveFormTable [wave_type] ); // 25 lossis 26 i ++; yog (i> = Num_Samples) i = 0; }

Siv tus lej:

Kauj Ruam 4: Tus Kws Tshaj Lij Ua Haujlwm

Cov kws tshaj lij
Cov kws tshaj lij

Kuv coj qhov piv txwv ntawm lub tshuab hluav taws xob tshaj lij, tsuas yog muab tswv yim rau koj txog tus nqi ntawm cov cuab yeej no. Nws tuaj yeem siv tau, piv txwv li, txhawm rau sim qhov chaw thiab tsim kev sib tsoo. Peb tuaj yeem txhaj tshuaj hluav taws xob nrov rau hauv STM microcontroller, txheeb xyuas ntau npaum li cas lub suab nrov yuav cuam tshuam lub nti. Cov qauv no tseem muaj lub luag haujlwm tsis siv neeg los tsim hluav taws xob nrov.

Kauj Ruam 5: Hantek DSO 4102C 100mhz Oscilloscope Nrog Kev Txiav Txim Siab Ua Haujlwm Generator

Hantek DSO 4102C 100mhz Oscilloscope Nrog Kev Txiav Txim Siab Ua Haujlwm Generator
Hantek DSO 4102C 100mhz Oscilloscope Nrog Kev Txiav Txim Siab Ua Haujlwm Generator
Hantek DSO 4102C 100mhz Oscilloscope Nrog Kev Txiav Txim Siab Ua Haujlwm Generator
Hantek DSO 4102C 100mhz Oscilloscope Nrog Kev Txiav Txim Siab Ua Haujlwm Generator

Nov yog cov lus qhia hais txog kev xaiv cov cuab yeej pheej yig dua. Nws raug nqi ib ncig $ 245 ntawm Aliexpress. Kuv nyiam nws, vim tias nws muaj lub tshuab hluav taws xob ua haujlwm, tsis txhob hais tias nws pab txhawb qhov chaw ntawm qhov ua yuam kev hauv Circuit Court.

Kauj Ruam 6: Tau Txais Cov Oscilloscope:

Ntes Tau Txais Nrog Oscilloscope
Ntes Tau Txais Nrog Oscilloscope
Ntes Tau Txais Nrog Oscilloscope
Ntes Tau Txais Nrog Oscilloscope
Ntes Tau Txais Nrog Oscilloscope
Ntes Tau Txais Nrog Oscilloscope
Ntes Tau Txais Nrog Oscilloscope
Ntes Tau Txais Nrog Oscilloscope

Peb xub ntes nthwv dej hauv daim duab sinusoidal, Daim duab peb sab, Sawtooth, thiab, thaum kawg, Square.

Kauj ruam 7: Rub tawm Cov Ntaub Ntawv:

PDF

INO

Pom zoo: