Cov txheej txheem:

Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano: 7 Cov Kauj Ruam
Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano: 7 Cov Kauj Ruam

Video: Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano: 7 Cov Kauj Ruam

Video: Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano: 7 Cov Kauj Ruam
Video: Nkauj Ntseeg-nkauj tawm tshiab-Cia peb tsim tsa pawg ntseeg 2024, Hlis ntuj nqeg
Anonim
Image
Image
Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano
Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano
Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano
Cia Peb Tsim SN76489 USB MIDI Synth Nrog Arduino Nano

Puas tau xav tsim koj tus kheej cov khoom sib xyaw raws li cov laus chip-tunes los ntawm 80's? Ua si cov suab paj nruag yooj yim uas suab zoo li cov qub Sega Master System thiab Megadrive cov vis dis aus ua si zoo li?

Kuv muaj, yog li, kuv xaj ob peb SN76489 chips los ntawm ebay thiab midi host interface thiab muab nws tua. Zoo, nws tsis yog taug kev hauv lub tiaj ua si rau kuv, tab sis, Kuv nyiam txhua lub sijhawm.

Ua ntej kuv kawm paub yuav ua li cas ncaj qha cuam tshuam nrog SN76489 thiab ua suab nrov nrog nws. Muaj qee cov ntsiab lus tsis meej pem rau qhov no, tab sis, nrog kev pab ntawm Oddbloke Geek Blog thiab ob peb lwm yam piv txwv, ua ke nrog cov ntawv qhia tshwj xeeb nti kuv muaj peev xwm los tsim cov tsev qiv ntawv yooj yim arduino.

Tom ntej no, Kuv yuav tsum kawm paub yuav ua li cas cuam tshuam cov keyboard midi nrog USB mini tus tswv tsev ntaub thaiv npog. Qhov no tsis nyuaj li, vim muaj qee cov ntaub ntawv muaj, thiab cov tsev qiv ntawv zoo nyob nrog cov piv txwv meej.

Thaum kuv nkag siab yuav ua li cas tswj lub nti thiab yuav ua li cas cuam tshuam rau kuv USB midi keyboard, qhov tsuas yog sab laug ua yog sau qee cov cai uas yuav qhwv txhua qhov no ua ke thiab tso cai rau kuv siv cov keyboard los tswj lub nti.

Nrog txoj kev, Kuv tau kawm tias lub suab nrog zaus qis dua cov uas kuv tau sim tsim rau 0x2f midi sau ntawv tsis zoo, yog li, kuv txiav txim siab siv qhov ntawd tso cai xa suab nrov mus rau lub tshuab tsim suab nrov rau ib qho ntawv sau nruab nrab ntawm 0x28 thiab 0x2f thiab tseem tso cai ua si sau ntawv nrog rau sab hnub poob arab kov rau nws rau txhua yam qis dua midi 0x28.

Saib rov qab, nws yog qhov lom zem heev thiab nthuav heev los tsim.

Kuv vam tias koj pom nws lom zem thiab txaus nyiam ib yam li kuv tau ua thiab tias yog koj tsim koj tus kheej, koj yuav ua siab zoo qhia qee cov duab ntawm nws.

Yog tias koj nyiam txoj haujlwm no, thov pov npav rau nws hauv qab no txhawm rau pab yeej qhov kev sib tw nws koom nrog

Khoom siv

Kuv tau ntxiv cov ntawv txuas rau cov khoom koj tuaj yeem yuav rau txoj haujlwm no, txawm li cas los xij, koj tuaj yeem pom ntau yam khoom muaj uas koj tuaj yeem khawb ntawm cov khoom siv hluav taws xob qub.

Cov kev txuas no yog cov koom nrog sib txuas, yog li, yog tias koj yuav tom qab nyem rau lawv, kuv tau txais ib feem me me (tsis yog hmoov zoo) thiab koj tau txais cov khoom lag luam uas yog rau txoj haujlwm no. Tsis muaj tus nqi lossis tus nqi ntxiv hauv kev siv cov no, txawm li cas los xij, koj tuaj yeem pom cov khoom zoo sib xws uas tuaj yeem hloov cov no yooj yim zoo nkauj.

ebay.us/svA4z4 | 1 x board ua tau zoo

ebay.us/ZyEFNp | 1 x arduino nano

ebay.us/t1zy0v | 1 x USB mini ntaub thaiv npog

ebay.to/2QrHl1C | 1 x SN76489 suab nti

ebay.us/aaaj8p | 1x595 ua

ebay.us/DSvTHO | 1 x Crystal oscillator ntawm 4MHz

ebay.us/XQeM0Q | 1 x 5V qhov ntsuas hluav taws xob 7805

ebay.us/6R6Fpf | 1 x cov cua sov rau qhov ntsuas hluav taws xob

ebay.us/xkLbn4 | 3 x 10 uF capacitors

ebay.us/pnm2BH | xov hlau

ebay.us/PMbUfY | 1 x liab LED rau lub zog

ebay.us/zokHtc | 1 x 220 ohm resistor los txwv cov LED tam sim no ntws

ebay.us/qjbesJ | 1 x fais fab txuas rau 12v fais fab mov

ebay.us/cS0wwv | 1 x on/off switch

ib lub thawv uas tsim nyog (Kuv ua kuv li los ntawm tus tub rau khoom qub uas tau so hauv kuv lub chaw khaws khoom tau ntau xyoo)

Kauj Ruam 1: Npaj USB Mini Host Shield los Tsav 5V Midi Device

Npaj USB Mini Host Shield los Tsav 5V Midi Device
Npaj USB Mini Host Shield los Tsav 5V Midi Device

Txij li USB tus tswv tsev tiv thaiv me me ua haujlwm ntawm 3.3V thiab USB midi cov twj siv hluav taws xob Kuv siv xav tau 5V, nws yuav tsum tau hloov kho cov ntaub thaiv npog qhov hluav taws xob los ntawm kev txiav kab 3.3V uas mus rau USB tawm Vcc, yog li, peb tuaj yeem txuas tom qab nws rau 5v.

Muaj ntau ntau cov lus qhia yuav ua li cas thiab nws tau dhau los ua qhov yooj yim heev:

Tsuas yog txiav kab ntawm 2k2 resistor thiab Vcc kab (saib cov duab txuas nrog). Kuv siv tus neeg tsav tsheb ntsia hlau los kos kab no thiab ntsuas yog tias nws ua haujlwm nrog lub ntsuas ntsuas txuas mus.

Kauj Ruam 2: Txuas USB Mini Shield Nrog Koj Arduino Nano

Txuas USB Mini Shield Nrog Koj Arduino Nano
Txuas USB Mini Shield Nrog Koj Arduino Nano
Txuas USB Mini Shield Nrog Koj Arduino Nano
Txuas USB Mini Shield Nrog Koj Arduino Nano

Luckily, muaj ntau cov ntaub ntawv ntawm yuav ua li cas, yog li, los ntawm googling rau "Arduino Nano thiab mini USB host shield" Kuv tau tsaws ntawm cov xov no

Nws piav qhia yuav ua li cas txuas lub USB mini v2.0 ntaub thaiv npog thiab tom qab ua raws nws kuv tau mus ncaj ua ntej sim qee qhov piv txwv USB midi.

Thaiv:

Arduino Host tus tiv thaiv

10--------------5

11--------------6

12--------------7

13--------------8

2----------------2

5V -------------- 1

3.3V ------------ 9

NTSB -------------- 3

RST ------------ 4

Hauv cov xov no, nws tseem tau hais tias lawv txiav 3.3V cov hlau lead kom USB tuaj yeem tau 5V los ntawm VBUS.

Cov lus piav qhia no thiab cov duab uas nyob nrog tau los ntawm cov xov no.

BTW, muaj qhov ua yuam kev ntawm kev luam tawm ntawm lub rooj tsavxwm no, yog li qhov no tsis meej pem me ntsis, txawm li cas los xij, koj tuaj yeem pom kuv cov lus tawm tswv yim txog qhov ntawd (tyrkelko) thiab qhov twg kuv kawm nws los ntawm.

Kauj Ruam 3: Chips Leej Twg? Ntxiv SN76489 Nrog 4MHz Osc. thiab 595 Shift Register

Chips Leej Twg? Ntxiv SN76489 Nrog 4MHz Osc. thiab 595 Shift Register
Chips Leej Twg? Ntxiv SN76489 Nrog 4MHz Osc. thiab 595 Shift Register

Tam sim no nws yog lub sijhawm los ntxiv cov nti uas ua rau lub suab zoo no.

Kuv twb tau tsim lub tsev qiv ntawv los cuam tshuam nrog arduino nrog cov nti no thiab tsuas yog yuav tsum ua raws kuv cov lus qhia.

Lub tsev qiv ntawv raug tso tawm hauv github hauv qab GPLv3 (kuv thawj zaug qhib qhov tso tawm).

github.com/tyrkelko/sn76489

Kev sib txuas ntawm 76489 thiab 595 zoo li hauv cov duab uas tau muab los ntawm lub tsev qiv ntawv readme.txt cov ntaub ntawv

Qhov Sau Tau Txais ntawm Tsawg (NotWE) ntawm 76489 tau txuas nrog tus pin 3 ntawm nano thiab tuaj yeem hloov pauv hauv txoj cai.

#define PIN_NotWE 3

595 tau txuas nrog nano raws li hauv qab no thiab tseem tuaj yeem hloov kho los ntawm kev kho tus lej tus lej:

#define PIN_SER 7

#define PIN_LATCH 6

#define PIN_CLK 5

Tus oscillator kuv siv yog 4MHz siv lead ua oscillator nrog 4 ceg.

Nws tau teeb tsa hauv cov cai raws li hauv qab no thiab koj tuaj yeem kho nws tus nqi rau ib qho oscillator zaus ntawm 500kHz thiab 4MHz:

#define FREQUENCY 4000000.0

Txuas cov oscillator kuv siv yog raws li hauv qab no:

tus pin 1 - tsis txuas nrog

pin 7 - pin

tus pin 8 - txuas nrog 76489 tus pin 14 - moos osc

Kauj Ruam 4: Tsuas yog Ntxiv Code - Ntxiv Cov Tsev Qiv Ntawv, Ua Ke thiab Xa Cov Cai

Cov tsev qiv ntawv siv hauv txoj haujlwm no yuav tsum tau ntxiv rau Arduino IDE raws li hauv qab no:

Qhib Arduino IDE

Rub tawm cov tsev qiv ntawv hauv qab no mus rau hauv lub tsev qiv ntawv tais ceev tseg ntawm koj li IDE (vam tias yuav pom cov no hauv qab "Tswj Cov Tsev Qhua …" ntawv qhia zaub mov hauv IDE "Cov cuab yeej" ntawv qhia zaub mov sai):

github.com/felis/USB_Host_Shield_2.0

github.com/tyrkelko/sn76489

Siv cov cai los ntawm qhov project github hauv qab no:

github.com/tyrkelko/usb_midi_tone

Rub tawm usb_midi_tone.ino, sau ua ke thiab upload rau koj Arduino nano.

Kauj Ruam 5: Txuas lub Amplifier thiab Tus Hais Lus, Txuas Koj USB Midi Keyboard thiab Kuaj

Tam sim no nws yog lub sijhawm los sim txhua yam ua haujlwm.

Txhawm rau ua qhov ntawd peb xav tau:

1. Lub tshuab ua kom nrov nrov thiab hais lus

2. USB keyboard midi

Txuas SN76489 tus pin 7, tawm suab, mus rau lub tshuab ua suab nrov hauv.

Fais fab lub tshuab hluav taws xob thiab tom qab ntawd ua kom lub zog arduino nano. Tam sim no koj yuav tsum hnov lub zog ntsuas suab ntsuas rau qhov sib cais ntawm ob.

Txuas lub USB midi keyboard thiab sim.

Yog tias txhua yam ua haujlwm raug, koj yuav tsum tuaj yeem ua 3 tones ib txhij, thiab tseem ua 8 hom suab nrov thiab txawm tias qee lub suab nrov ntawm 24 EDO-Nplai.

Yog tias nws tsis ua haujlwm, hla cov kauj ruam los saib seb yuav muaj dab tsi tsis raug.

Yog tias koj xav tias qhov txiaj ntsig no los ntawm cov lus qhia tsis meej thov sau kuv li ntawv yog li kuv hloov kho cov lus qhia txhawm rau kho nws.

Kauj Ruam 6: Ua kom tiav Cov Circuit nrog 5V Tus Tswj Hluav Taws Xob, 12V Txuas, Lub Hwj Chim Rau/Tawm Hloov thiab Lub Hwjchim LED

Hauv cov kauj ruam no koj yuav tsum tuaj yeem qhwv lub Circuit tom qab kuaj nws kom ua haujlwm raug.

1. Ntxiv lub hwj chim tswj nrog LM7805 thiab ob lub 10uF capacitors thiab 0.1uF. Muaj ntau cov lus qhia ntawm no, koj tuaj yeem siv cov lus qhia hauv qab no kom ua tiav qhov ntawd-https://www.instructables.com/id/7805-Regulator-5V…

2. Ntxiv qhov txuas hluav taws xob 12V nrog Vcc mus los ntawm qhov qhib/tua hloov

3. Ntxiv ib qho LED nrog qhov txwv tam sim no resistor los qhia thaum lub hwj chim qhib.

Kauj Ruam 7: Muab ntim rau hauv ib lub thawv, Xim thiab Txaus Siab Rau Koj Cov Synth Tshiab

Thaum ntsuas qhov ntsuas hluav taws xob thiab ua haujlwm rau koj nyiam, tsis muaj ntau qhov ua tsuas yog tsim lub tsev zoo, pleev xim nws nrog cov xim txaus thiab ua suab nkauj.

Kuv vam tias koj nyiam nyeem cov lus qhia no, thiab nws tau tshoov siab koj los tsim koj tus kheej synth lossis mus nrog lwm qhov haujlwm koj tab tom ua haujlwm.

Thov tawm tswv yim hauv qab no nrog cov lus nug thiab yog tias koj tau tsim ib yam zoo sib xws raws li hauv qhov kev qhia no nws yuav zoo yog tias koj yuav qhia qhov koj tau ua hauv "Kuv tau ua qhov no!" cheeb tsam lossis hauv ntu lus tawm tswv yim.

Pom zoo: