Cov txheej txheem:
- Kauj Ruam 1: Qee Qhov Kev Xav
- Kauj Ruam 2: Cia Pib Nrog Kho Vajtse
- Kauj Ruam 3: Kawg Tsim
- Kauj Ruam 4: Ua Haujlwm Nrog Software
- Kauj Ruam 5: Kev teeb tsa thiab teeb tsa ntawm V-usb Library
- Kauj Ruam 6: Kev teeb tsa Attiny-IR thiab Tinytuner Libraries
- Kauj Ruam 7: Kev teeb tsa thiab teeb tsa ntawm Bootloaders
- Kauj ruam 8: Hlawv Bootloaders thiab Upload Sketches
- Kauj Ruam 9: Calibrate Attiny85 Internal Clock (hla Qhov No Yog Koj Siv Crystal)
- Kauj Ruam 10: Txiav Txim Koj Cov Khawm Tej thaj chaw deb
- Kauj Ruam 11: Thauj Khoom Kawg Kawg thiab Cia Siab Rau Qhov Zoo Tshaj
Video: ATtiny85 IR USB Txais: 11 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:29
CEEB TOOM, Cov lus qhia no tau dhau los ua qhov tsis raug
V-usb lub tsev qiv ntawv tau tsim los ua haujlwm nrog USB 1.1 raws tu qauv uas tsis muaj nyob niaj hnub no. Nrog tuaj txog ntawm USB3 koj yuav muaj ntau dua li mob taub hau sim ua v-usb cov cuab yeej ua haujlwm. Tom qab hloov kuv qhov chaw multimedia, Kuv tau txais ntau qhov teeb meem kev ruaj ntseg thiab txawm hais tias tus txais tau ua haujlwm, tom qab ib ntus nws tsis ua haujlwm. Kuv tsis tau ua tiav sim kho nws. Kuv tau ua ib qho atmega328p version tab sis qhov no muaj qhov teeb meem zoo ib yam. Ua siv lub sijhawm saib xyuas kom rov pib dua lub rooj tswj hwm ib ntus tsis pab ib yam li kuv tso rau ntawm v-usb.
Ua rau koj tus kheej nyiam thiab tsis mus tom ntej nrog cov lus qhia no tshwj tsis yog nws yog rau lub hom phiaj kev kawm. Kuv pom zoo kom hloov pauv ib qho chip ATmega 32U4 uas twb tau ua ke usb interface thiab ua raws li phau ntawv qhia no:
www.sparkfun.com/tutorials/337
Tom qab ntawd muab pov rau hauv IR sensor TSOP31238 thiab koj zoo mus.
Nyob zoo cov! qhov no yog qhia kom tsim ua haujlwm USB IR tus txais siv lub Attiny85 microcontroller. Kuv pib qhov haujlwm no txhawm rau kov yeej qhov tsis muaj kev txhawb nqa (tsawg kawg ua tiav kev txhawb nqa) rau qee qhov IR nyob hauv GNU/Linux OS. Ua raws cov lus qhia no koj tuaj yeem tsim lub program USB USB IR tau txais uas ua haujlwm nrog ib qho IR chaw taws teeb rau ob peb nyiaj.
Ua ntej tshaj plaws, cov lus qhia no yuav tsis tshwm sim yam tsis tau ua haujlwm nyuaj ntawm cov tib neeg uas tsim cov tsev qiv ntawv uas kuv siv ntawm no:
- David A. Mellis rau nws qhov kev xav
- Rowdy Dog Software rau lawv lub tsev qiv ntawv TinyTuner
- Rowdy Dog Software rau lawv lub bootloader me me
- Rancidbacon (https://rancidbacon.com/) rau nws qhov chaw nres nkoj arduino ntawm v-usb library (https://code.google.com/archive/p/vusb-for-arduino/downloads)
- seejaydee rau nws lub tsev qiv ntawv IR rau cov cores me me pom ntawm cov lus qhia ntawm https://www.instructables.com/id/Attiny-IR-librar… code ntawm https://www.instructables.com/id/Attiny-IR -librar…
Qee zaum tsis yooj yim mus nrhiav tus tswv lub tsev qiv ntawv raug, yog li yog tias kuv ua yuam kev, thov tawm lus thiab kuv yuav daws qhov teeb meem ASAP.
Phau ntawv qhia no tshwm sim vim tias kuv tsis pom kev qhia ua tiav/phau ntawv qhia ua haujlwm tawm ntawm lub thawv (nws yuav muaj nyob, tab sis kuv tsis pom nws) yog li kuv tau sau tag nrho cov ntaub ntawv muaj nyob hauv lub vev xaib thiab tom qab qhov kev sim zoo thiab yuam kev Kuv tuaj nrog phau ntawv qhia ua tiav los ua haujlwm USB IR tus txais uas ua haujlwm tau zoo tiag tiag.
Cov ntaub ntawv tseem ceeb ntawm cov ntaub ntawv uas kuv tau ua raws:
- https://nathan.chantrell.net/20121014/tinypcremot…
- https://forum.arduino.cc/index.php?PHPSESSID=ap4jg…
- https://blog.petrockblock.com/2012/05/19/usb-keybo…
- https://learn.adafruit.com/using-an-infrared-libr…
- https://codeandlife.com/2012/03/03/diy-usb-passwor…
- https://codeandlife.com/2012/02/22/v-usb-with-atti…
- https://www.instructables.com/id/Attiny-IR-librar…
Kauj Ruam 1: Qee Qhov Kev Xav
- Kuv tsis yog tus tswv AVR ISP programmer thiab kuv tsis zoo nkauj heev yuav ib qho yog li kuv tau siv Arduino los teeb tsa cov txheej txheem 85
- Kuv tsis quav ntsej txog lwm yam OS dua li GNU/Linux yog li kuv tsis paub yog tias qhov no yuav ua haujlwm lwm yam.
- muaj lwm lub tsev qiv ntawv IR tab sis kuv tsis tuaj yeem ua rau lawv tsis ua haujlwm txawm tias nrog arduino. Xav txog tias kuv tau pib nrog kev paub tsawg txog IR cov tsev qiv ntawv. Tej zaum kuv tuaj yeem ua rau lawv ua haujlwm tam sim no tom qab qhov kev paub tau los daws cov teeb meem ncaj ncees. Xijpeem, Kuv tau poob thiab xav ua ntej pom lub tsev qiv ntawv uas Seejaydee muab thiab kuv tau siv qhov ntawd txij li (ntau tus txiv neej ua tsaug!).
- Muaj lwm qhov kev teeb tsa kho vajtse, tab sis kuv tsuas yog siv ib qho uas siv 5V txhawm rau ua kom muaj zog attiny85 thiab ob qho 3.6V 0.5W zener diodes txhawm rau txhawm rau qhov hluav taws xob ntawm cov ntaub ntawv kab, nws ua haujlwm tawm ntawm lub thawv yog li kuv tsis cuam tshuam nrog lwm yam kev teeb tsa.
- Koj tuaj yeem siv 16Mhz siv lead ua lossis koj tuaj yeem siv lub tsev qiv ntawv tinytuner txhawm rau ntsuas lub sijhawm sab hauv ntawm koj qhov kev xav 85. Kuv xav qhia tswv yim siv cov siv lead ua, nws ruaj khov dua thiab tej zaum yuav ua rau koj mob taub hau ntau.
- Kuv siv ntawm no ob qhov sib txawv bootloaders rau attiny85:
a) Rowdy Dog Software version, nws tau sib xyaw ua ke cov ntawv sib txuas uas txias heev thiab me me yog li koj muaj chaw seem ntau rau koj qhov program thiab lwm lub tsev qiv ntawv. Qhov teeb meem yog vim qee qhov txawm tias nws ua haujlwm tau zoo, tom qab qee lub sijhawm cov cuab yeej usb tau txais kev sib txuas (koj tuaj yeem pom cov teeb meem nrog cov lus txib dmesg). Kuv tsis paub tias qhov no yog teeb meem ntawm cov tub ntxhais lossis kev sib xyaw ua ke ntawm cov tub ntxhais ntxiv rau cov tsev qiv ntawv xaiv yog li tom qab ib pliag kuv txiav txim siab siv cov tub ntxhais no tsuas yog los txiav txim cov yuam sij nyob deb thiab ntsuas lub moos (thaum tsis siv 16Mhz. siv lead ua). Tom qab ntawd, Kuv tsuas yog hlawv lub Mellis bootloader thiab rub tawm lub ntsiab lus tseeb uas tsis siv cov ntawv txuas.
b) Mellis version, ruaj khov bootloader, Kuv tau siv qhov no hauv ntau txoj haujlwm. Kuv yuav tau siv lub bootloader ib txwm yog nws tau suav nrog tus lej txuas. Kuv siv cov tub ntxhais no hauv qhov kos duab zaum kawg tom qab txiav txim siab txhua tus yuam sij ntawm kuv qhov chaw nyob.
Kauj Ruam 2: Cia Pib Nrog Kho Vajtse
Cov cuab yeej koj xav tau:
- pawg thawj coj saib arduino
- ib qho txuas mus rau usb adapter los txiav txim siab koj cov yuam sij nyob deb (tsuas yog siv FT232RL)
- lub PC nrog GNU/Linux teeb tsa thiab arduino IDE teeb tsa kom raug, Kuv siv arduino IDE 1.8.0
- IR chaw taws teeb los ntsuas koj lub cuab yeej (txawm tias ib tus menyuam dev zoo li cov uas pom hauv arduino cov khoom siv pib yuav ua haujlwm)
- ib lub tshuab ntsuas kom debug koj lub rooj tsavxwm (Kuv vam tias koj yuav tsis xav tau, hmoov zoo!)
Cov npe khoom siv:
- 1 txa85
- 2 68R resistors
- 1 1.5K resistor
- 1 4.7K resistor
- 1 16Mhz siv lead ua
- 1 22pF capacitor
- 1 0.1uF capacitor
- 1 10uF capacitor
- 2 3.6V 0.5W zener diodes
- 1 USB hom A txiv neej txuas
- 1 tus lej pin nrog 6 tus pin rau qhov program thiab debug lub rooj tsavxwm.
- 1 IR sensor TSOP31238
- ntau kas fes kom koj tsaug zog
Ua ntej yuav muab cov laug cam txiav txim siab, koj yuav zaum xav ua lub khob cij ua qauv rau kev ntsuas lub hom phiaj, ua raws cov txheej txheem txuas nrog rau cov lus qhia no yuav tsum txaus los tsim nws.
Txhawm rau txuas tus attiny85 mus rau PC, kev tsim qauv zaum kawg siv USB hom A txuas uas tau muab tso rau hauv lub rooj tsavxwm, tab sis rau tus qauv koj yuav xav tau ua USB cable uas koj tuaj yeem txuas rau lub khob cij:
Cov laug rau hauv ib qho me me ntawm perfboard 4 tus pin, tom qab ntawd txiav lub qub USB cable thiab txuas tus pin rau 4 ntawm cov xov hlau sab hauv usb cable:
- liab yog VCC (5V)
- dub yog GND
- dawb yog D-
- ntsuab yog D+
Khaws txhua yam ua ke nrog cov kua nplaum kub.
Tam sim no peb yuav tsum txuas ISP programmer (Arduino), USB rau txuas txuas txuas (FT232RL) thiab IR sensor mus rau attiny85.
Koj tuaj yeem tso kev sib txuas tag nrho ua ke yog li koj yuav tuaj yeem hlawv cov bootloaders sib txawv, thauj cov duab kos thiab txheeb xyuas qhov chaw nres nkoj tsis hloov pauv xov hlau, Txhawm rau ua li ntawd, txuas txhua yam raws li cov lus qhia no:
ISP programmer (Arduino): qhov no tso cai rau peb hlawv bootloaders thiab thauj cov duab kos
- attiny85 PB0 (pin5) rau pin11 (MOSI) hauv arduino
- attiny85 PB1 (pin6) rau pin12 (MISO) hauv arduino
- attiny85 PB2 (pin7) rau pin13 (SCK) hauv arduino
- attiny85 RESET (pin1) nrog rub tawm (4.6k rau VCC) rau pin10 hauv arduino
- attiny85 VCC rau 5V hauv arduino
- attiny85 GND rau GND hauv arduino
usb rau serial adapter (FT232RL): qhov no tso cai rau peb tshawb xyuas qhov chaw nres nkoj
- attiny85 PB0 (pin5 RX) to TX in the FT232RL
- attiny85 PB2 (pin7 TX) rau RX hauv FT232RL
- attiny85 GND (pin4) rau GND ntawm FT232RL
- txij li attiny85 twb tau siv los ntawm arduino koj tsis tas yuav txuas 5v ntawm FT232RL, txwv tsis pub txuas: attiny85 VCC (pin8) rau 5V ntawm FT232RL
usb rau cov lej txuas (FT232RL) tsuas yog rau kev ntsuas lub moos (tsuas yog rau lub bootloader "ATtiny85 @ 8MHz (oscillator sab hauv; BOD xiam oob qhab)")
- PB4 (pin3 RX) to TX in the FT232RL attiny85
- PB3 (pin2 TX) rau RX hauv FT232RL attiny85
- GND (tus pin 4) rau GND ntawm FT232RL
- txij li attiny85 twb tau siv los ntawm arduino koj tsis tas yuav txuas 5v ntawm FT232RL, txwv tsis pub txuas: attiny85 VCC (pin8) rau 5V ntawm FT232RL
Yog tias koj siv 16Mhz siv lead ua, txuas nws mus rau Attiny85 pins PB3 (pin2) thiab PB4 (pin3) thiab txuas txhua tus pin rau GND ib yam li los ntawm 22pF cap txhua.
Lim Attiny85 VCC nrog 0.1uF thiab 10uF capacitors txuas lawv ua ke rau GND
Txuas IR lub cim tso zis tus pin mus rau attiny85 PB1 (pin6), txhawb nws.
Tsim thiab txuas usb interface:
- GND (xaim dub): txuas nws mus rau GND (txhua thaj chaw tau txuas ua ke)
- D.
- D+ (ntsuab xaim) txuas nrog PB2 los ntawm 68R resistor, txuas nws hauv av los ntawm 3.6V 0.5W zener
- 5V, koj tuaj yeem tso nws tsis txuas vim tias txhua yam tau siv los ntawm Arduino ntawm theem no, txwv tsis pub txuas nws mus rau attiny85 VCC
Lub zener diodes tau txuas nrog kom cov anodes raug khi rau GND thiab cathodes txuas nrog cov ntaub ntawv kab D+ thiab D-.
Kauj Ruam 3: Kawg Tsim
Txog qhov tsim qauv zaum kawg koj tuaj yeem siv perfboard nrog los ntawm cov khoom sib dhos lossis kos koj tus kheej lub rooj tsavxwm thiab siv cov khoom siv smd. Txhawm rau kawm paub yuav ua li cas kos lub rooj tsavxwm, tsuas yog google nws, muaj cov kev qhia txaus txaus muaj nyob online.
Kuv tau kos kuv tus kheej lub rooj tsavxwm thiab kuv zoo siab heev nrog cov txiaj ntsig kawg (pawg me, ruaj khov thiab ruaj khov). Yog, Kuv paub tias qhov txiav tawm, tab sis kuv siv tsis tau cov cuab yeej siv zog li yav tsaus ntuj thiab kuv tsuas yog txiav lub rooj tsavxwm nrog kuv cov txiab txiab txiab txiab.
Los ntawm txoj kev, cov cim ntawm cov duab tsis liab qab tooj liab, lawv tau kho nrog cov tshuaj phem uas tins tooj liab me ntsis (nws xav tias yuav ua rau mob qog noj ntshav, yog li siv nws nrog kev saib xyuas zoo, looj hnab looj tes thiab daim npog qhov ncauj):
Siv cov txheej txheem saum toj no los tsim koj cov qauv lossis koj tsuas tuaj yeem siv kuv lub pcb hneev taw los kos koj lub rooj tsavxwm.
Kauj Ruam 4: Ua Haujlwm Nrog Software
Lub voj voog hauv txoj haujlwm no yooj yim heev, software hloov chaw xav tau kev siv zog ntau dua.
Peb xav tau tsawg kawg 2 lub tsev qiv ntawv (ib qho ntxiv yog tias koj tsis siv cov siv lead ua) ntxiv rau 2 bootloaders los ua txoj haujlwm no. Thaum kuv pib qhov haujlwm no kuv sim qee lub tsev qiv ntawv, qee zaum lawv tsis ua haujlwm thiab ntau zaus lawv tsuas yog tsis tau teeb tsa los ua haujlwm nrog Attiny85 tawm ntawm lub thawv (Kuv tseem tsis tau paub dua). Tom qab ntawd kuv tau pom teeb meem nrog cov tsev qiv ntawv / bootloaders sib tshooj cuam tshuam. Thaum kawg kuv yuav tsum tau daws nrog qhov raug ntawm qhov ua yuam kev thaum kuv txuas lub Circuit Court kawg rau kuv lub PC. Kuv tsis muaj phau ntawv qhia no, yog li kuv xav tias koj yuav ua tau zoo, tsuas yog ua raws cov kauj ruam hauv cov lus qhia no, yog tias koj ua qhov ntawd yam tsis ua yuam kev koj yuav tsum ua zoo:)
Peb xav tau tam sim no los teeb tsa thiab teeb tsa ob peb lub tsev qiv ntawv:
- v-usb rau arduino tsev qiv ntawv: lub tsev qiv ntawv no tso cai rau lub microcontroller raug lees paub los ntawm PC ua HID USB Keyboard, thiab peb yuav siv nws los xa cov ntawv tseem ceeb rau lub PC. Lub tsev qiv ntawv no xav tau qee qhov kev hloov pauv kom haum nrog attiny85
- tinytuner lub tsev qiv ntawv tsuas yog tias koj yuav tsis siv 16Mhz siv lead ua. Tom qab ntawd koj yuav xav tau los ntsuas lub moos sab hauv ntawm lub microcontroller. Lub tsev qiv ntawv no ua haujlwm tawm ntawm lub thawv.
- Attiny-IR-tsev qiv ntawv los cuam tshuam nrog IR sensor. Lub tsev qiv ntawv no ua haujlwm tawm ntawm lub thawv.
Peb tseem xav tau 2 bootloaders:
- Aub Software version, nrog cov lej sib tham muaj. Lub bootloader no xav tau me ntsis tweak los ua haujlwm nrog attiny85 vim nws siv lub sijhawm 1 rau millis () ua haujlwm thiab yuav tsis ua haujlwm nrog IR lub tsev qiv ntawv. Peb yuav tsum hloov lub sijhawm mus rau timer0.
- Mellis version, ruaj khov bootloader uas peb yuav siv nyob rau theem kawg. Qhov no ua haujlwm tawm ntawm lub thawv.
Kauj Ruam 5: Kev teeb tsa thiab teeb tsa ntawm V-usb Library
Rub tawm lub tsev qiv ntawv los ntawm https://code.google.com/archive/p/vusb-for-arduin… Unzip cov ntawv thiab theej lub nplaub tshev tsev qiv ntawv/UsbKeyboard rau hauv koj lub tsev qiv ntawv sketchbook.
Tam sim no koj yuav tsum kho ob peb cov ntaub ntawv kom tau tshaj ATtiny85 (nws tau teeb tsa los ua haujlwm nrog arduino):
A) kho usbconfig.h:
hauv qab "Kho Vajtse Config" hloov:
#define USB_CFG_IOPORTNAME Dto ## txhais USB_CFG_IOPORTNAME B
thiab
#define USB_CFG_DMINUS_BIT 4 rau#txhais USB_CFG_DMINUS_BIT 0
nyob rau hauv "Optional Hardware Config" hloov:
#define USB_CFG_PULLUP_IOPORTNAME Dto ## txhais USB_CFG_PULLUP_IOPORTNAME B
Txhawm rau tsim tag nrho "khau raj ua raws li HID" kev qhia tshwj xeeb (txwv tsis pub tsis muaj multimedia yuam sij yuav ua haujlwm), hloov pauv:
#define USB_CFG_INTERFACE_SUBCLASS 0 // Bootto#txhais USB_CFG_INTERFACE_SUBCLASS 0x01 // Boot
thiab
#define USB_CFG_INTERFACE_PROTOCOL 0 // Keyboardto#txhais USB_CFG_INTERFACE_PROTOCOL 0x01 // Keyboard
Optionally koj tseem tuaj yeem hloov chaw tsim khoom thiab lub npe khoom hauv cov lus hauv qab no:
#define USB_CFG_VENDOR_NAME
#define USB_CFG_DEVICE_NAME
B) hloov kho UsbKeyboard.h:
hloov:
PORTD = 0; // TODO: Tsuas yog rau USB pins? DDRD | = ~ USBMASK;
rau
PORTB = 0; // TODO: Tsuas yog rau USB pins? DDRB | = ~ USBMASK;
Txhawm rau tso cai cov lej tseem ceeb tshaj li 101 hloov kuj:
0x25, 0x65, // LOGICAL_MAXIMUM (101) rau: 0x25, 0xE7, // LOGICAL_MAXIMUM (231)
thiab
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application) rau: 0x29, 0xE7, // USAGE_MAXIMUM (Keyboard Application)
Tej zaum koj yuav tsum tau kho cov ntaub ntawv 3 no:
usbdrv.husbdrv.cUsbKeyboard.h
thiab txhua lub sijhawm koj pom PROGMEM ntxiv "const" ua ntej hom sib txawv lub npe (ex: PROGMEN char usbHidReportDescriptor [35] ==> PROGMEM const char usbHidReportDescriptor [35])
Yog tias qhov no tsis meej tuaj ntsib
Koj tuaj yeem zam txhua qhov kev hloov pauv no yog tias koj tsuas yog rub lub tsev qiv ntawv txuas nrog (Kuv tau ua txhua qhov kev hloov pauv kuv tus kheej) thiab tsuas yog rho nws tawm hauv koj lub tsev qiv ntawv sketchbook:
UsbKeyboard teeb tsa rau attiny85
Kho kom raug: tsis ntev los no kuv tau pom tias Alejandro Leiva (https://github.com/gloob) tau raug saib xyuas ntawm lub tsev qiv ntawv no thiab zoo li ua haujlwm tau zoo ib yam. Koj kuj tseem tuaj yeem sim nws cov ntawv nrog qhov hloov pauv tsim nyog uas kuv tau ua kom nws ua haujlwm nrog kev txiav txim siab, yog li yog tias koj xav tshuaj xyuas qhov no tsuas yog rho nws tawm hauv koj lub tsev qiv ntawv sketchbook.
UsbKeyboard teeb tsa rau attiny85 (Alejandro Leiva version)
Kauj Ruam 6: Kev teeb tsa Attiny-IR thiab Tinytuner Libraries
A) Attiny-IR lub tsev qiv ntawv:
rub tawm nws los ntawm https://drive.google.com/open?id=0B_w9z88wnDtFNHlq… ces unzip nws mus rau hauv koj lub tsev qiv ntawv sketchbook.
B) Tinytuner lub tsev qiv ntawv:
Qhov no tsuas yog xav tau yog tias koj tsis siv 16Mhz siv lead ua, tab sis ntseeg kuv, txawm tias nws ua haujlwm kuj tsis muaj siv lead ua, nws ruaj khov dua nrog nws thiab lawv raug nqi ob peb xees, yog li ua kom yooj yim, siv cov siv lead ua thiab hla lub tsev qiv ntawv no.
Tseem tsis ntseeg? ok, rub lub tsev qiv ntawv los ntawm https://storage.googleapis.com/google-code-archive … tom qab ntawd zaws nws mus rau hauv koj phau ntawv teev cov duab sketchbook.
Peb tau ua tiav nrog cov tsev qiv ntawv, tam sim no peb txav mus rau nruab bootloaders.
Kauj Ruam 7: Kev teeb tsa thiab teeb tsa ntawm Bootloaders
Peb tab tom yuav nruab ob lub bootloaders Mellis ib qho raws li kuv qhov kev paub ruaj khov dua thiab peb yuav siv nws hauv qhov kos duab zaum kawg. Lwm qhov tsim los ntawm Rowdy Dog Software yog qhov tseem ceeb txaus, me me thiab nrog kev sib xyaw ua ke muaj, tab sis kuv cov chaw taws teeb poob tom qab qee lub sijhawm nrog nws yog li peb yuav siv lub bootloader no txhawm rau ntsuas lub attiny85 lub moos sab hauv thiab txiav txim siab peb cov chaw taws teeb. khawm.
Kuv paub tias muaj cov tsev qiv ntawv muab rau attiny85 muaj peev xwm ua tau, tab sis tom qab ntawd koj yuav tsum tau hloov kho cov tsev qiv ntawv uas siv cov khoom sib txuas … Kuv nyiam qhov txheej txheem no zoo dua.
Cia peb pib nrog kev teeb tsa:
A) Mellis bootloader:
tsuas yog qhib Arduino IDE nyiam thiab ntxiv hauv Tus Thawj Saib Xyuas Ntxiv URLs:
raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
Tom qab ntawd qhib Arduino IDE tus thawj tswj hwm pawg thawj coj thiab tshawb nrhiav attiny, teeb tsa cov laug cam los ntawm Mellis Tam sim no koj yuav tsum pom Arduino ID tus ATtiny25/45/85 thiab ATtiny24/44/84 boards.
B) Rowdy Dog Software me me bootloader:
rub lub bootloader los ntawm
Unzip cov ntawv thiab luam cov ntawv me me hauv koj daim duab kos/kho vajtse (tsim cov ntawv no yog tias nws tseem tsis tau muaj). tom qab ntawd txav mus rau daim nplaub tshev sketchbook/kho vajtse/me me/avr/thiab:
1) luam theej duab Cov Txheej Txheem Boards.txt rau hauv cov ntawv board.txt
2) hloov cov ntaub ntawv platform.txt thiab hloov qee qhov:
Tsis suav nrog qhov sib txawv compiler.path thiab tso nws taw mus rau daim nplaub tshev kho vajtse/cuab yeej/avr/bin/sab hauv koj daim ntawv teeb tsa arduino:
compiler.path = {PATH_TO_YOUR_ARDUINO_FOLDER}/kho vajtse/cuab yeej/avr/bin/
hloov alsocompiler. S.flags = -c -g -assembler-with-cpptocompiler. S.flags = -c -g -x assembler-with-cpp
Tom qab ntawd hloov cov kev hloov pauv hauv qab no kom ntseeg tau tias txhua yam nyob hauv nws qhov chaw (cov ntaub ntawv yuav tsum muaj, txwv tsis pub taw qhia qhov hloov pauv mus rau txoj hauv kev yog):
tools.avrdude.cmd.path = {runtime.ide.path}/kho vajtse/cuab yeej/avr/bin/avrdude
tools.avrdude.config.path = {runtime.ide.path} /hardware/tools/avr/etc/avrdude.conf
tools.avrdude.cmd.path.linux = {runtime.ide.path}/kho vajtse/cuab yeej/avr/bin/avrdude
tools.avrdude.config.path.linux = {runtime.ide.path} /wareware/tools/avr/etc/avrdude.conf
3) kho cov ntaub ntawv cores/me me/core_build_options.h thiab hloov:
#define TIMER_TO_USE_FOR_MILLIS 1 rau#txhais TIMER_TO_USE_FOR_MILLIS 0
Qhov no tseem ceeb heev, txwv tsis pub IR tus txais yuav tso zeros rau txhua khawm. Cov lus no teeb tsa lub sijhawm 0 rau millis () ua haujlwm tawm ntawm lub sijhawm 1 muaj rau IR lub tsev qiv ntawv. Qhov kos duab zaum kawg yuav ua rau lub sijhawm timer 0 li cas los xij koj yuav tsis muaj ob lub millis () thiab ncua () ua haujlwm. Tej zaum koj yuav muaj sijhawm qeebMicroseconds () ua haujlwm xwb.
Qhov bootloader no tsawg heev, tab sis tau suav nrog cov khoom txhawb nqa Serial:
Attiny85 PB2 (pin7) yog TX thiab PB0 (pin5) yog RX
Koj tuaj yeem muaj kev teeb tsa nrog ISP programmer (arduino) thiab cov lej rau usb adapter txuas nrog tib lub sijhawm yog li koj tsis tas yuav hloov xov hlau ntau zaus:
Tam sim no peb muaj ob lub tsev qiv ntawv thiab lub bootloaders tau teeb tsa thiab teeb tsa kom raug, kev ua haujlwm nyuaj tshaj plaws tau ua tiav thiab peb tuaj yeem pib sim cov khoom.
Kauj ruam 8: Hlawv Bootloaders thiab Upload Sketches
Kuv ntseeg cov lus qhia kom qhib cov lus hais tawm hauv Arduino IDE nyiam yog li koj tuaj yeem txheeb xyuas txhua qhov teeb meem tshwm sim.
Txhawm rau hlawv lub bootloader rau hauv Attiny85 koj yuav tsum xa ISP piv txwv mus rau Arduino thiab tom qab ntawd xaiv tus programmer Arduino ua ISP.
Tam sim no tso 10uF capacitor nruab nrab ntawm kev rov pib dua thiab hauv av pins ntawm arduino (nws tsis xav tau rau txheej txheem hlawv, tab sis nws yog txhawm rau rub cov duab kos mus rau attiny85).
Tam sim no arduino tau npaj los hlawv bootloaders thiab thauj cov duab kos. Koj tsuas yog yuav tsum xaiv lub rooj tsav xwm zoo sib xws nrog koj qhov kev xav thiab hlawv nws.
Txhawm rau thauj cov duab kos rau hauv Attiny85, thauj nws mus rau hauv arduino IDE thiab nyem rau ntawm "Upload siv programmer".
TSEEM CEEB: thaum xa cov duab kos muaj 3 kauj ruam, muab tso ua ke, sau thiab txheeb xyuas qhov tseeb. Yog tias kev sau ua ke thiab sau ntawv tau ua tiav, tab sis qhov txheej txheem txheeb xyuas tsis ua tiav, nws muaj peev xwm tias daim duab kos yuav ua haujlwm ib yam nkaus.
Kauj Ruam 9: Calibrate Attiny85 Internal Clock (hla Qhov No Yog Koj Siv Crystal)
Yog tias koj txiav txim siab tsis siv lub 16Mhz siv lead ua koj yuav tsum ntsuas koj lub attiny85 moos, yog li peb yuav xav tau lub bootloader nrog tus lej sib txuas muaj thiab peb yuav siv lub tinytuner lub tsev qiv ntawv kom tau txais qhov ntsuas tau raug.
Ua raws cov kauj ruam tom ntej
- xaiv hauv qab cov cuab yeej Arduino ua ISP programmer
- xaiv pawg thawj coj "ATtiny85 @ 8MHz (sab hauv oscillator; BOD xiam oob qhab)"
- Kuv xav tias koj muaj ISP kev twb kev txuas npaj tau raws li tau piav ua ntej txuas lwm yam ua qhov sib txuas
- hlawv bootloader
- lub bootloader no tau teeb tsa tus pin sib txawv rau cov lej sib txuas, siv qhov kev teeb tsa no tsuas yog rau lub bootloader tam sim no
- PB4 (pin3 RX) rau TX hauv FT232RL attiny85 - PB3 (pin2 TX) rau RX hauv FT232RL attiny85 - GND (pin4) rau GND ntawm FT232RL txij li attiny85 twb tau siv los ntawm arduino koj tsis tas yuav txuas 5v ntawm FT232RL, txwv tsis pub txuas: attiny85 VCC (pin8) rau 5V ntawm FT232RL
- upload qhov piv txwv tinytuner rau attiny85
- qhib qhov kev tshuaj ntsuam los saib xyuas kev sib txuas lus txuas: tshuaj ntsuam /dev /ttyUSB0 9600
- rov pib dua attiny85 txuas RESET tus pin (pin1) rau GND (ib pliag xwb), Cov lus txais tos yuav tsum tso tawm ntawm lub vijtsam qhov rai
- Txuas ntxiv xa ib tus 'x' cim (tsis muaj carriage-rov; tsis muaj kab-pub) kom txog thaum calibration tas
- annotate qhov chaw tus nqi ntawm kev ntsuas (OSCCAL = 0x). Nov yog tus nqi uas koj yuav tsum tau tshaj tawm txog qhov kos duab zaum kawg
Kauj Ruam 10: Txiav Txim Koj Cov Khawm Tej thaj chaw deb
Tam sim no nws yog lub sijhawm los txiav txim siab peb cov nyees khawm nyob deb thiab muab lawv rau qhov tseem ceeb tshwj xeeb strokes hauv PC, ua li ntawd ua raws cov kauj ruam tom ntej:
- xaiv lub rooj tsav xwm "ATtiny85 @ 16MHz (sab hauv PLL; 4.3V BOD)" yog tias koj tsis siv cov siv lead ua, "ATtiny85 @ 16 MHz (siv sab nrauv; 4.3 V BOD" tsis li ntawd, tom qab ntawd hlawv nws
- thauj cov duab kos:
- Yog tias koj tsis siv tus siv lead ua, tsis pom zoo cov kab uas muaj OSCCAL sib txawv thiab muab nws rau tus nqi uas koj pom thaum koj ua qhov ntsuas ntawm lub moos
- Kuv xav tias lub sensor txuas nrog raws li tau piav ua ntej, txwv tsis pub txuas nrog nws
- Kuv xav zoo li tias FT232RL cov ntawv txuas rau usb adapter txuas nrog, txwv tsis pub txuas nws
- rov pib dua attiny85 txuas RESET tus pin (tus pin1) rau GND (ib pliag xwb)
- ntaus cov nyees khawm ntawm koj cov chaw taws teeb thiab txheeb xyuas lub vijtsam qhov rai, koj yuav tsum sau cov lej kawg rau txhua qhov ntaub ntawv, txhua lub pob tuaj yeem tsim 2 tus lej sib txawv
Piv txwv:
RECEIVED D44 3396 YOG 544 1348
Sau cov lus 3396 thiab 1348 hauv kev koom nrog lub pob koj nyuam qhuav ntaus, tom qab ntawd koj yuav tsum txiav txim siab tias koj xav ua dab tsi nrog lub pob ntawd. Piv txwv li kuv tuaj yeem xav khawm ntawd xa cov xov xwm multimedia keycode "Volume up", tom qab ntawd kuv yuav tsum nrhiav tus lej rau tus lej ntawd. Txhawm rau ua qhov no, rub tawm PDF:
Saib rau seem "Keyboard/Keypad Page" nplooj 53 thiab siv tus lej hauv kab lus Siv Tus lej (Kaum Ob Hlis) los khi koj cov nyees khawm nyob deb rau cov lej keyboard. Hauv peb qhov piv txwv peb tuaj yeem pom tias tus lej cim rau "Volume up" yog: 128.
Kho cov ntaub ntawv cov ntaub ntawv UsbKeyboard.h sab hauv UsbKeyboard lub tsev qiv ntawv los ntawm pob v-usb uas peb tau teeb tsa ua ntej thiab ntxiv rau cov kev txhais uas twb muaj lawm yog tias nws tsis tau muaj:
#define KEY_VOL_UP 128
Thaum peb ua tiav nrog tag nrho peb cov chaw taws teeb/s nyees khawm thiab txhua qhov txhais hauv cov ntawv UsbKeyboard.h tau npaj tiav peb tuaj yeem txav mus rau kauj ruam kawg.
Kauj Ruam 11: Thauj Khoom Kawg Kawg thiab Cia Siab Rau Qhov Zoo Tshaj
Tam sim no peb muaj tag nrho cov nyees khawm nyob deb tau txiav txim siab, cov ntaub ntawv UsbKeyboard.h tau ntim nrog peb cov lej lej, yog li tam sim no peb tuaj yeem thauj mus rau hauv arduino IDE qhov kos duab tseeb los ntawm:
github.com/venumz/ATtiny85-USB-IR-receiver…
Cov ntaub ntawv no yog cov ntaub ntawv tseeb uas kuv siv rau kuv tus txais, thiab nws ua haujlwm rau 2 qhov sib txawv, yog li koj yuav tsum tau hloov kho nws kom ua haujlwm nrog koj cov chaw taws teeb/s.
Yog tias koj tsis siv tus siv lead ua, tsis pom zoo cov kab uas muaj OSCCAL sib txawv thiab muab nws rau tus nqi uas koj pom thaum koj ua qhov ntsuas ntawm lub moos
Nco tseg tias hauv kev ua haujlwm voj muaj ntau nqe lus zoo li qhov no:
yog (results.value == 3405 || results.value == 1357) {// xub nce
yog (lastStroke! = results.value) UsbKeyboard.sendKeyStroke (KEY_ARROW_UP);
}
Koj yuav tsum tsim koj tus kheej cov lus, ib lub pob hauv koj lub chaw taws teeb. Hauv qhov "yog" qhov xwm txheej koj yuav tsum muab tso rau hauv qhov txiaj ntsig. Ntsuas tus nqi uas koj tau pom los txiav txim siab koj cov chaw taws teeb thiab raws li kev sib cav ntawm UsbKeyboard.sendKeyStroke txoj kev koj yuav tsum tso ib qho ntawm cov ntsiab lus tau teev tseg hauv cov ntawv UsbKeyboard.h.
Qhov xwm txheej "yog (zaum kawg! = Results.value)" xav tau vim tias qee qhov kev xa ntawv xa tib txoj cai ob zaug ib zaug, thiab qhov no tiv thaiv kev ntaus thib ob. Kuv tsis paub meej thiab Nws yuav yog nyob ntawm IR raws tu qauv uas tau ua haujlwm rau hauv koj lub chaw taws teeb (Kuv tsis yog tus kws tshaj lij hauv IR raws tu qauv) tab sis raws li kuv tau paub nrog kuv tus kheej kev nyob deb, txhua lub pob tuaj yeem tsim 2 tus lej sib txawv thiab thaum koj nias thiab tuav lub pob, nws xa tib txoj cai, tab sis yog tias koj ntaus lub pob dua nws xa lwm tus. Yog li nws zoo li tias cov lej raug xa mus rau lwm txoj hauv kev, kuv kwv yees nws yog hom qauv kom paub tias pes tsawg zaus koj yeej tsoo lub pob.
Ok, peb yuav luag tiav, tsuas yog xa daim duab kos zaum kawg, txuas nws mus rau PC thiab saib nws mus li cas.
Rau cov kauj ruam no, yog qhov zoo dua yog tias koj tshem tawm ob qho tib si ntawm arduino thiab usb rau cov txuas txuas thiab tsuas yog tom qab ntawd, ntsaws USB rau hauv koj lub PC chaw nres nkoj (yog tias muaj qee yam tsis raug koj lub Circuit Court yuav yooj yim dua rau kev debug).
Yog tias txhua yam ua haujlwm tau zoo, thaum koj qhib lub davhlau ya nyob twg thiab xa cov lus txib dmesg koj yuav tsum pom qee yam zoo ib yam li thawj daim duab ntawm theem no. Yog tias muaj teeb meem, koj yuav tsum muaj qhov yuam kev zoo li cov uas pom hauv daim duab thib ob thiab koj yuav tsum pib debug koj lub Circuit thiab/lossis software. Ib qho ntawm qhov pib ua tsis raug uas kuv tau muaj yog USB hub uas yuav tsis ua haujlwm nrog kuv tus neeg txais IR (lwm tus ua haujlwm txawm hais tias) … yog li nws zoo dua rau cov kauj ruam kawg no los ntsaws IR tus txais ncaj qha rau koj lub PC chaw nres nkoj. Qhov yuam kev tshwm sim tuaj yeem nyuaj nrhiav, tab sis thaum kawg, zoo li kuv, koj yuav kawm ntau yam thiab tus nqi them yog tsim nyog nws, Kuv paub tseeb koj.
Qhov ntawd yog txhua tus neeg, qhia rau kuv paub yog tias koj pom ib qho ua yuam kev hauv cov lus qhia no thiab txaus siab rau koj lub npe tshiab IR USB tus txais!
Pom zoo:
Txhua Tus Txais Txais Nrog SI4732 / SI4735 (FM / RDS, AM thiab SSB) Nrog Arduino: 3 Kauj Ruam
Txhua Tus Txais Txais Nrog SI4732 / SI4735 (FM / RDS, AM thiab SSB) Nrog Arduino: Nws yog txhua txoj haujlwm txais xov tooj cua. Nws siv Si4734 Arduino Library. Lub tsev qiv ntawv no muaj ntau dua 20 qhov piv txwv. Koj tuaj yeem mloog FM nrog RDS, chaw AM (MW) chaw nres tsheb, SW thiab cov chaw mloog xov tooj cua nyiam (SSB). Tag nrho cov ntaub ntawv ntawm no
ARUPI - Tus Nqi Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: 8 Kauj Ruam (nrog Duab)
ARUPI - Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi Tus Nqi Uas Tau Txais Tus Nqi/Tus Kheej Tus Kheej (ARU) rau Soundscape Ecologists: Cov lus qhia no tau sau los ntawm Anthony Turner. Txoj haujlwm tau tsim los nrog ntau qhov kev pab los ntawm Shed hauv Tsev Kawm Ntawv ntawm Kev Suav, University of Kent (Mr Daniel Knox tau pab zoo!)
BIQUAD Kav hlau txais xov Sab hauv, Ua los ntawm tooj liab thiab Ntoo rau Txais Txais HDTV Raws Hauv UHF Band (CHANNELS 14-51): 7 Cov Kauj Ruam
BIQUAD Kav hlau txais xov Sab hauv, Ua los ntawm tooj liab thiab Ntoo rau Txais Txais HDTV Raws Hauv UHF Band (CHANNELS 14-51): Hauv khw muaj ntau yam antennas rau TV. Cov neeg nyiam tshaj plaws raws li kuv tus qauv yog: UDA-YAGIS, Dipole, Dipole nrog cov duab ci, Thaj thiab Logarithmic antennas. Nyob ntawm qhov xwm txheej, qhov nrug deb ntawm kev kis tus kab mob
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: 5 Kauj Ruam (nrog Duab)
8 Relay Tswj Nrog NodeMCU thiab IR Txais Txais Siv WiFi thiab IR Chaw Taws Teeb thiab Android App: Tswj 8 qhov hloov pauv hloov siv nodemcu thiab ir tus txais tshaj wifi thiab ir chaw taws teeb thiab hauv app.the ir tej thaj chaw deb ua haujlwm ywj pheej ntawm wifi txuas. NTUJ
Txhim Kho Qhov Txais Txais Koj Li IPod's ITrip Nrog Qhov Txaus Txaus Ntshai!: 11 Cov Kauj Ruam
Txhim Kho Kev Txais Koj Tus IPod's ITrip Nrog Qhov Txaus Txaus!: Qhov chaw thau khoom ua los ntawm cov ntaub ntawv nyob ib puag ncig lub tsev yuav txhawb nqa kev txais tos ntawm koj li iTrip- tso cai rau koj tshaj tawm koj lub suab nkauj hauv xov tooj cua kom meej los ntawm txhua txoj kev hla ib chav! Rau txoj haujlwm no, koj yuav xav tau: 1 Daim Ntawv Phuam Yob lossis 2 Daim Ntawv Toilet