Cov txheej txheem:

Telnet rau Koj Arduino/AVR!: 4 Kauj Ruam
Telnet rau Koj Arduino/AVR!: 4 Kauj Ruam
Anonim
Telnet rau Koj Arduino/AVR!
Telnet rau Koj Arduino/AVR!

Lwm hnub kuv xav tshuaj xyuas ib qho ntawm kuv tus AVR tab sis kuv tau nyob sab saud thiab vaj tswv paub tias nws muaj teeb meem ntau dhau mus rau hauv qab daus mus rau qhov uas lub microcontroller nyob qhov twg. Tab sis, muaj ob lub khoos phis tawj tsis ua haujlwm zaum saum toj ib sab ntawm kuv lub taub qab tub nkeeg, yog li kuv muaj ib nrab hnub los ntawm kev ua haujlwm thiab txiav txim siab sau daim ntawv thov uas khi ob lub chaw nres nkoj: chaw nres nkoj txuas mus rau Arduino/AVR thiab TCP/IP chaw nres nkoj uas kuv tuaj yeem telnet los ntawm kuv lub wireless network lossis hauv Is Taws Nem. Daim ntawv thov tom qab ntawd ua tus sawv cev ntawm TCP/IP network thiab AVR. Txhawm rau pom cov vis dis aus zoo dua, nyem ob zaug thiab coj nws mus rau hauv nws lub qhov rais thiab nthuav dav. Txwv tsis pub, squint thiab koj tuaj yeem pom dab tsi raug ntaus. Yog li, Kuv tau xaus qhov hloov kho AVR Terminal cov ntawv thov txuas txuas uas kuv tau sau lawm, thiab kuv ntxiv TCP/IP txhawb rau nws. Txhawm rau mus nrog nws, Kuv tau sau qee qhov firmware uas muab qee yam zoo li UNIX lub plhaub, muab kev nkag mus rau kuv rau txhua tus pin, fuse teeb tsa, thiab lwm yam. Koj tuaj yeem tig LED thiab txhua yam khoom ntawd nyob deb. Nws txawm txhawb kev kho lub moos nrawm hauv lub sijhawm tiag tiag thiab muaj lub pseudo-password system uas muab lub hauv paus rau Kev Nkag Mus Nkag Lists lossis txheeb xyuas qhov tseeb rau hauv paus-qib cov lus txib (zoo li txhawb lub zog qis, thiab lwm yam). Nov yog qee yam uas nws tuaj yeem ua tau:

  • Zaub koj lub cpu zaus
  • Teem ib tus pin rau kev tawm tswv yim lossis tso tawm
  • Nyeem lub xeev ntawm tus pin
  • Xa cov laj thawj 1 thiab 0 rau ib tus pin kom qhib LED, thiab lwm yam
  • Fais fab thiab txhawb nqa SPI, TWI, USART, thiab ADC cov khoom siv ib puag ncig
  • Nyeem cov fuse qis, fuse siab dua, fuse sab nraud thiab xauv cov khoom hauv lub sijhawm tiag
  • Pib timers rau lub sijhawm ua ntu zus thiab cov khoom.
  • Lub hauv paus rau kev lees paub qhov tseeb rau hauv EEPROM
  • Tsim kom muaj txhua lub sijhawm prescaler hauv lub sijhawm tiag tiag
  • Sau hauv C ++ thiab muab tso ua ke rau ATmega328P

Cov lus qhia qhia no yuav ua li cas koj tuaj yeem rub tawm cov software (thiab firmware, yog tias koj nyiam), teeb nws, thiab pib nkag mus rau koj AVR los ntawm koj lub wireless wireless network lossis hauv Is Taws Nem.

Kauj ruam 1: Yam Koj Yuav Tsum Tau

  • Ib leeg nyob ib leeg AVR lossis Arduino/clone (rau cov lus qhia ntxaws ntxaws txog yuav ua li cas thiaj ua rau koj tus kheej, ua kom tiav ib leeg nyob ib leeg AVR system suav nrog cov siv sab nrauv, txiav cov capacitors, thiab tswj lub zog qhov chaw, saib kuv lwm cov lus qhia).
  • Ib qho txuas lossis USB txuas rau koj lub PC host
  • AVR Terminal version uas muaj qhov kos TCP/IP server
  • Xaiv tau, AVR Plhaub (avrsh) yog tias koj xav khiav lub khoos phis tawj ntawm koj lub hom phiaj AVR/Arduino kom tau txais kev nkag mus rau koj cov khoom siv hluav taws xob.

Lub qhov rooj TCP/IP ua haujlwm nrog lub khoos phis tawj twg koj tuaj yeem siv lossis xav sau ntev npaum li nws sib txuas lus ntawm UART mus rau PC. Hmoov tsis zoo, tsis muaj Java version, yog li AVR Terminal tsuas yog ua haujlwm ntawm Windows tam sim no.

Kauj ruam 2: Rub tawm thiab Nruab AVR Terminal thiab TCP/IP Server

Rub tawm thiab Nruab AVR Terminal thiab TCP/IP Server
Rub tawm thiab Nruab AVR Terminal thiab TCP/IP Server

AVR Terminal yog daim ntawv thov windows uas kuv tau qhia hauv cov lus qhia ua ntej. Nws tuaj yeem tham nrog koj tus AVR ntawm RS232 USART ntxiv rau mloog hauv TCP/IP sib txuas thiab xa lawv hla RS232 kev txuas rau cov lus teb los ntawm koj tos AVR. Nws tsis yog qhov ua tiav tab sis muab thawj zaug ncig xyuas ntawm cov ncauj lus kom ntxaws ntawm no thiab hauv kuv lwm cov lus qhia. Qhov hloov tshiab tshaj plaws tuaj yeem rub tawm ntawm no. Lub software tsis siv tag nrho nruab; koj tuaj yeem khiav cov software los ntawm nws cov npe. Lub thawv ntawv hauv lub cuab yeej uas hais tias YOG LI CAS yog tus IP chaw nyob uas yuav tsum tau mloog. Ib qho twg yuav khi ib qho thiab txhua tus IP chaw nyob, lossis xaiv tau koj tuaj yeem sau ib qho los khi rau tshwj xeeb. Lub thawv ntawv rau sab xis ntawm tus IP chaw nyob yog tus IP chaw nyob uas tus neeg rau zaub mov yuav raug khi. Default yog 23232 tab sis koj tuaj yeem hloov qhov no mus rau yam koj nyiam.

Kauj Ruam 3: Nruab Koj Lub Plhaub

Ua ntej koj AVR tuaj yeem sib txuas lus rov qab nrog koj, koj yuav tsum muaj qee yam kev ua haujlwm lossis lub plhaub ntawm lub hom phiaj AVR. Muaj ob peb qhov muaj txiaj ntsig suav nrog kuv AVR Plhaub thiab Bitlash plhaub.

Hloov pauv, siv qhov kev paub dhau los no yog lub sijhawm los sau koj tus kheej lub plhaub tsawg.

Kauj Ruam 4: Telnet thiab Txaus Siab

Telnet thiab Txaus Siab
Telnet thiab Txaus Siab

Nco ntsoov koj cov ntaub ntawv teeb tsa lossis koj tuaj yeem khaws nws ntawm qhov tsis raug. Hauv kuv daim duab piv txwv, Kuv nyob ntawm tus tswv hu ua "newton" thiab telnet rau lub tshuab uas kuv AVR txuas nrog, tus tswv hu ua "quadcpu1." Koj tuaj yeem pom tus qauv tso tawm telnet. Yog li, yog tias koj tau khaws nws ntawm qhov tsis yog, koj tuaj yeem nkag mus rau koj AVR/Arduino los ntawm koj li TCP/IP network nrog: telnet 23232

lossis yog tias koj nyob hauv tib lub npov: telnet localhost 23232

Tsuas yog nco ntsoov siv lub teeb tsa koj hloov nws mus, yog tias koj hloov nws. Qhov ntawd yuav tsum yog nws. Qhov chaws rau ob tus neeg rau zaub mov telnet thiab AVR firmware tau pub dawb raws li qhib qhov chaw thiab yuav tsum muab koj cov ntaub ntawv zoo txaus los qhia rau koj hloov kho lossis sau koj tus kheej ntawm ob qho tib si. Cov kauj ruam tom ntej yuav yog sau Java lossis Qt kev siv TCP/IP server kom cov neeg siv Mac thiab Linux tuaj yeem tau txais txiaj ntsig.

Pom zoo: