Cov txheej txheem:

ATMega1284 Quad Opamp Effects Box: 4 Cov Kauj Ruam (nrog Duab)
ATMega1284 Quad Opamp Effects Box: 4 Cov Kauj Ruam (nrog Duab)

Video: ATMega1284 Quad Opamp Effects Box: 4 Cov Kauj Ruam (nrog Duab)

Video: ATMega1284 Quad Opamp Effects Box: 4 Cov Kauj Ruam (nrog Duab)
Video: Night 2024, Hlis ntuj nqeg
Anonim
ATMega1284 Quad Opamp Effects Box
ATMega1284 Quad Opamp Effects Box

Lub Stomp Shield rau Arduino los ntawm Qhib Music Labs siv Arduino Uno thiab plaub lub suab opamps ua lub thawv ntaus suab paj nruag. Zoo ib yam li cov lus qhia yav dhau los uas qhia tias yuav ua li cas thiaj nkag tau Electrosmash Uno Pedalshield, Kuv kuj tseem tau xa Qhib Music Labs Guitar Effects lub thawv mus rau ATMega1284P uas muaj yim zaus ntau dua li Uno (16kB piv rau 2kB).

Piv rau cov lus qhia yav dhau los siv ATMega1284 cov teebmeem, lub thawv no muaj qhov zoo hauv qab no:

(1) Nws muaj cov khoom sib xyaw uas sib xyaw lub teeb liab tsis tau ua tiav nrog MCU cov teeb liab ua tiav - uas txhais tau tias qhov ua tau zoo ntawm lub teeb liab ntawm qhov tso tawm tau zoo dua qub.

(2) Nws ua 16 qhov kev ua haujlwm me me rau ob qho PWM tso tawm wheras lub thawv cuam tshuam yav dhau los siv 8 khoom rau qee qhov piv txwv xws li cuam tshuam qeeb.

(3) Nws muaj cov lus tawm tswv yim potentiometer uas tuaj yeem siv los txhim kho qhov cuam tshuam - tshwj xeeb nrog cov flanger/phaser cuam tshuam txog 30 feem pua cov lus tawm tswv yim ntxiv ntau rau qhov ua tau zoo.

(4) Qhov qis -lim lim zaus yog 10 kHz piv rau 5 kHz ntawm lub npov cuam tshuam dhau los - qhov no txhais tau tias lub teeb liab ntawm cov suab tso tawm ntau "nkig".

(5) Nws siv qhov cuam tshuam cuam tshuam sib txawv uas tuaj yeem piav qhia txog qib qis qis qis uas pom los ntawm lub thawv cuam tshuam no.

Kuv pib los ntawm qhob cij-boarding Uno-based Open Music Labs Stompbox Shield thiab kuv zoo siab nrog qhov ua tau zoo ntawm plaub qhov OpAmp teeb liab ua Circuit (txawm tias thaum siv Arduino Uno), uas kuv tau hloov nws mus rau kab txaij kom siv tau tas mus li.

Tib qho plaub qhov kev sib tw opamp thiab DSP code tau xa mus rau ATMega1284-dua, qhov xav tsis thoob ntawm qhov tsis tseem ceeb hloov pauv xws li muab cov hloov pauv thiab LED rau lwm qhov chaw nres nkoj, thiab faib 7,000 kilo-lo lus tsis yog 1, 000 kilo-lo lus ntawm RAM rau ncua sijhawm ncua, tsuas yog ob qhov kev hloov pauv tseem ceeb yuav tsum tau ua hauv qhov chaws, uas yog hloov mus rau ADC0 los ntawm ADC2, thiab hloov Timer1/PWM OC1A thiab OC1B tawm los ntawm Port B ntawm Uno mus rau Port D (PD5 thiab PD4) ntawm ATMega1284.

Raws li tau sau tseg yav dhau los, txawm hais tias kev txhim kho cov laug cam rau lub ATMega1284 muaj (Github: MCUdude MightyCore), nws yog ib qho yooj yim siv los yuav tus liab qab (bootloader-free) nti (yuav PDIP version uas yog qhob cij-board thiab strip-board phooj ywg), tom qab ntawd rub Mark Pendrith diav rawg ntawm Maniacbug Mighty-1284p Core Optiboot bootloader lossis MCUdude Mightycore, los ntawm kev siv Uno ua tus ISP programmer, thiab tom qab ntawd thawb duab dua ntawm Uno mus rau AtMega1284. Cov ncauj lus kom ntxaws thiab txuas rau cov txheej txheem no tau muab hauv ntu 1 ntawm cov lus qhia yav dhau los.

Kauj Ruam 1: Daim Ntawv Teev Npe

Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe
Daim Ntawv Teev Npe

ATMega1284P (PDIP 40 tus lej pob ntawv) Arduino Uno R3 (siv los ua ISP los hloov lub khau raj loader thiab kos duab mus rau ATMega1284) OpAmp MCP6004 quad OpAmp (lossis zoo ib yam RRIO (Rail rau Rail Input thiab Output) OpAmp xws li TLC2274) 1 x Liab LED 1 x 16 MHz siv lead ua 2 x 27 pF capacitors 1 x 3n9 capacitor 1 x 1n2 capacitor 1 x 820pF capacitor 2 x 120 pf capacitor 4 x 100n capacitors 3 x 10uF 16v electrolytic capacitors 4 x 75k resistors 4 x 3k9 resistors 1 x 36k resistor 1 x 24k resistor 2 x 1M resistors 1 x 470 ohm resistor 3 x 1k resistors 2 x 50k Potentiometers (linear) 1 x 10k Potentiometer (linear) 3 x pushbutton keyboards (ib qho ntawm lawv yuav tsum tau hloov nrog 3-ncej 2- txoj kev footswitch yog tias lub thawv cuam tshuam yuav raug siv rau kev ua haujlwm nyob)

Kauj Ruam 2: Kev tsim kho

Kev tsim kho
Kev tsim kho

Circuit 1 qhia txog kev siv hluav taws xob thiab Stripboard 1 yog nws lub cev sawv cev (Fritzing 1) nrog Duab 1 qhov tseeb ntawm cov mov ci-boarded Circuit hauv kev ua haujlwm. Peb qhov kev hloov pauv me me tau ua: Qhov sib faib ib nrab-theem-qib opamp kev tsis ncaj ncees tau siv rau peb theem OpAmp, 3 x 75k thiab 2 x 75k ohms sib npaug resistors tau hloov nrog ib zaug 24k thiab 36k resistors, thiab cov lus tawm tswv yim tau nce ntxiv rau 120pF rau ob theem OpAmp no. Kev tswj teb tau hloov nrog ob lub khawm uas tau siv los nce lossis txo qhov cuam tshuam. Peb-xaim txuas mus rau ATMega1284 tau qhia ntawm lub Circuit Court raws li ADC rau tus pin 40, PWMlow los ntawm tus pin 19, thiab PWMhigh los ntawm tus pin 18. Peb lub khawm thawb txuas nrog tus pin 1, 36 thiab 35 thiab earthed ntawm lwm qhov kawg. Ib qho LED txuas nrog ntawm 470 tus tiv thaiv rau tus pin 2.

OpAmp Kev Tawm Tswv Yim thiab Cov Sijhawm Tawm: Nws yog qhov tseem ceeb uas RRO lossis nyiam dua RRIO OpAmp tau siv vim tias qhov hluav taws xob loj viav vias xav tau ntawm OpAmp tso tawm rau ADC ntawm ATMega1284. Daim ntawv teev npe muaj cov lej ntawm lwm hom OpAmp. 50k potentiometer tau siv los kho cov tswv yim nce mus rau qib qis dua ib qho kev txawv txav, thiab nws kuj tseem tuaj yeem siv los kho qhov nkag siab nkag siab rau cov tswv yim nkag uas tsis yog siv guitar xws li lub tshuab ntaus nkauj. Theem thib ob OpAmp cov tswv yim nkag mus thiab thawj qib opamp tso tawm muaj qhov kev txiav txim siab dua RC lim kom tshem cov digitally generated MCU suab nrov los ntawm cov suab.

ADC Theem: ADC tau teeb tsa los nyeem ntawm lub sijhawm cuam tshuam. Ib 100nF lub tshuab hluav taws xob yuav tsum txuas nrog ntawm AREF tus pin ntawm ATMega1284 thiab hauv av kom txo suab nrov raws li sab hauv Vcc qhov chaw tau siv los ua qhov ntsuas hluav taws xob - tsis txhob txuas tus pin AREF rau +5 volt ncaj qha!

DAC PWM Theem: Raws li ATMega1284 tsis muaj nws tus kheej DAC, cov suab tso tawm suab tau tsim los ntawm kev siv tes taw dav dav hloov pauv ntawm RC lim. Ob qho PWM tso tawm ntawm PD4 thiab PD5 tau teeb tsa ua qhov siab thiab qis bytes ntawm cov suab tso tawm thiab sib xyaw nrog ob lub resistors (3k9 thiab 1M) hauv 1: 256 piv (qis byte thiab siab byte) - uas tsim cov suab tso tawm.

Kauj ruam 3: Software

Lub software yog ua raws Qhib Music Labs stompbox pedal sketches, thiab ob qhov piv txwv suav nrog xws li flanger/phaser effect, thiab ncua sijhawm. Ib yam li nrog cov lus qhia yav dhau los, cov hloov pauv thiab LED tau hloov mus rau lwm qhov chaw nres nkoj deb ntawm cov uas siv los ntawm ISP programmer (SCLK, MISO, MOSI thiab Pib dua).

Qhov ncua sij hawm ncua tau nce los ntawm 1000 lo lus rau 7000 lo lus, thiab PortD tau teeb tsa ua qhov tso tawm rau ob qho PWM teeb liab. Txawm hais tias nrog qhov nce hauv qhov ncua ncua tsis kos duab tseem siv tsuas yog li 75% ntawm cov muaj ATMega1284 16 kB RAM.

Lwm yam piv txwv xws li tremolo los ntawm Qhib Music Labs lub vev xaib rau tus pedal

(1) Hloov DDRB | = 0x06; // set pwm outputs (pins 9, 10) to outputtoDDRD | = 0x30;

thiab

ADMUX = 0x62; // sab laug kho, adc2, sab hauv vcc raws li siv rau ADMUX = 0x60; // sab laug kho, adc0, sab hauv vcc raws li siv // Cov kev hloov pauv no yog XWB qhov tseem ceeb hloov pauv // thaum xa los ntawm Uno mus rau ATMega1284

Rau ob qhov piv txwv suav nrog ntawm no, cov ntaub ntawv header suav nrog hauv daim duab - piv txwv li tsis muaj cov ntaub ntawv header yuav tsum tau siv

Pushbuttons 1 thiab 2 tau siv hauv qee qhov kev kos duab kom nce lossis txo qhov cuam tshuam. Hauv qhov piv txwv ncua nws nce lossis txo lub sijhawm ncua. Thaum cov duab kos tau pib ua ntej nws pib nrog qhov cuam tshuam siab tshaj plaws. Rau cov flanger phaser kos duab sim ua kom muaj kev tawm tswv yim tswj kom muaj txiaj ntsig zoo dua.

Txhawm rau hloov qhov ncua mus rau cov txiaj ntsig ncho (ntxiv rov ua dua) hloov kab:

tsis [qhov chaw] = tawm tswv yim; // khaws cov qauv tshiab

rau

tsis [qhov chaw] = (tawm tswv yim + tsis [qhov chaw]) >> 1; // Siv qhov no rau echo effct

Tus footswitch yuav tsum yog peb tus ncej ob txoj kev hloov

Kauj ruam 4: Txuas

Electrosmash

Qhib Music labs Music

ATMega Effect Pedal

Pom zoo: