Cov txheej txheem:

Yuav Siv Dragon Rider 500 Nrog Koj Li AVR Dragon: 10 Kauj Ruam
Yuav Siv Dragon Rider 500 Nrog Koj Li AVR Dragon: 10 Kauj Ruam

Video: Yuav Siv Dragon Rider 500 Nrog Koj Li AVR Dragon: 10 Kauj Ruam

Video: Yuav Siv Dragon Rider 500 Nrog Koj Li AVR Dragon: 10 Kauj Ruam
Video: Только стакан этого сока ... Обратное забивание артерий и снижение высокого кровяного давления 2024, Hlis ntuj nqeg
Anonim
Yuav Siv Dragon Rider 500 Nrog Koj Li AVR Dragon li cas
Yuav Siv Dragon Rider 500 Nrog Koj Li AVR Dragon li cas

Cov lus qhia no yog chav kawm sib tsoo yuav siv qee yam ntawm Dragon Rider 500 los ntawm Ecros Technologies. Thov nco ntsoov tias muaj cov ncauj lus kom ntxaws Tus Neeg Siv Qhia muaj nyob hauv Ecros lub vev xaib.

Zaj Rider yog lub rooj sib tham sib tham rau siv nrog AVR microcontroller programmer hu ua AVR Dragon los ntawm Atmel. Yog xav paub ntxiv: Atmel's Wesite: https://www.atmel.com/ AVR Zaj txuas: https://www.atmel.com/dyn/products/tools_card.asp? Tool_id = 3891 Dragon Rider 500 los ntawm Ecros Technology: https://www.ecrostech.com/AtmelAvr/DragonRider/index.htm Dragon Rider 500 sib dhos Qhia: https://www.instructables.com/id/Assembling-the-Dragon-Rider-500-for-use-with- the-A/Kawm txhua yam txog AVR microcontrollers: https://www.avrfreaks.net Cov lus qhia no tuaj yeem loj hlob nrog lub sijhawm yog li rov qab saib dua tam sim no!

Kauj ruam 1: AVR Dude

Koj xav tau qee lub software software txhawm rau siv AVR Dragon rau kev ua haujlwm. Kuv siv AVRdude nrog Ubuntu kev ua haujlwm (linux) thiab kuv zoo siab heev nrog cov txiaj ntsig. Yog tias koj tsis paub yuav teeb tsa lossis siv software software li cas, txheeb xyuas cov lus qhia no kom coj koj mus nrawm: https://www.instructables.com/id/Getting-started-with-ubuntu-and-the- AVR-zaj/Kuv kwv yees yog tias yog koj tau yuav thiab sib sau ua Dragon Rider 500 koj twb paub yuav ua li cas txhawm rau txhim kho lub nti nrog AVR Dragon….. mus ntxiv!

Kauj Ruam 2: ATtiny2313 - ntsais cov LEDs

ATtiny2313 - ntsais cov LEDs
ATtiny2313 - ntsais cov LEDs
ATtiny2313 - ntsais cov LEDs
ATtiny2313 - ntsais cov LEDs
ATtiny2313 - ntsais cov LEDs
ATtiny2313 - ntsais cov LEDs

Cia qhov program ATtiny2313 uas yog 20-pin microcontroller. Qhov Dragon Rider 500 muaj qhov nyob rau ntau qhov sib txawv me me AVR microcontrollers. Cov no suav nrog: 8, 20, 28, thiab 40 tus pin ntsaws. Nyob ntawm seb lub qhov (socket) twg koj siv, cov dhia ntawm Dragon Rider board yuav tsum tau teeb tsa sib txawv.

Jumper Chaw

Teem cov dhia ntawm Dragon Rider kom cov shunts txuas cov pins hauv qab no. (tus pin4 yog tus pin nruab nrab rau J22 -J -24) Pins: J5 - 23J6 - 23J7 - 12J16 - 23J22 - 41J23 - 41J24 - 41This yog kev teeb tsa yooj yim uas tso cai rau ISP (Hauv Qhov Txheej Txheem).

Blinky Blinky

Programming tsis zoo tshwj tsis yog tias koj muaj qee yam rau program. Kuv tau sau ib qho piv txwv tus lej luv kom ntsais tus Dragon Rider's LED ib zaug. Ua ib txoj hlua txuas los txuas lub LED header (J29) mus rau PortB header (J2).

Programming

Kuv tau suav nrog C cov ntaub ntawv ntxiv rau cov ntaub ntawv tsim thiab cov ntawv hex. Zoo li kuv tau hais hauv cov lus qhia, Kuv tsis tuaj yeem npog sab software ntawm kev ua haujlwm hauv Cov Lus Qhia. Txoj haujlwm zoo li koj xav tau rau AVR Dragon, raws li Dragon Rider tsis hloov kho software sab ntawm txhua yam.

Kauj Ruam 3: Siv LCD Ntxiv-on

Siv LCD Ntxiv-on
Siv LCD Ntxiv-on

Nov yog txoj hauv kev yooj yim los siv LCD Ntxiv-on. Qhov no yuav sau "Dragon Rider" rau ntawm lub vijtsam LCD.

Kho vajtse:

  • Tias 2313
  • R/W Jumper: R/W yuav tsum txuas nrog "BIT1" ntawm Dragon Rider Board (Saib cov lus piav qhia hauv Rooj Sib Tham Qhia)
  • J23: Lub jumper no yuav tsum tau teeb tsa rau ISP cov phiaj xwm tab sis tom qab ntawd tshem tawm rau LCD kom ua haujlwm tau zoo.
  • Txuas LCD rau PORT B siv kab hlua (J31 rau J2)

Software

Kuv tab tom siv Peter Fleury's LCD tsev qiv ntawv los tsav lub LCD hauv 4-ntsis hom. Txheeb xyuas Peter's Homepage txhawm rau rub lub tsev qiv ntawv.

Peb tab tom siv sab hauv RC oscillator yog li XTAL xav tau teeb tsa rau 1MHz:

#define XTAL 1000000

  • Cov chaw nres nkoj yuav tsum tau hloov kho rau PORTB:
  • #define LCD_PORT PORTB

  • Pinout rau 4 cov ntaub ntawv kab yuav tsum tau yoog raws:
  • #define LCD_DATA0_PIN 4 #define LCD_DATA1_PIN 5 #define LCD_DATA2_PIN 6 #define LCD_DATA3_PIN 7

  • Pinout rau RS, RW, thiab E yuav tsum tau yoog raws:
  • #define LCD_RS_PIN 3 #define LCD_RW_PIN 1 #define LCD_E_PIN 2

    Txoj haujlwm tseem ceeb yog yooj yim heev ua tsaug rau txoj haujlwm Peter Fleury tau ua hauv nws lub tsev qiv ntawv LCD. CODE:

    #include #include "lcd.h" int main (void) {lcd_init (LCD_DISP_ON); // Initialize LCD nrog tus cursor tawm lcd_clrscr (); // Tshem lub vijtsam LCD lcd_gotoxy (5, 0); // Tsiv tus cursor mus rau qhov chaw lcd_puts ("Zaj"); // Muab txoj hlua no tso rau ntawm LCD lcd_gotoxy (6, 1); // Txav tus cursor mus rau qhov chaw no lcd_puts ("Rider"); // Muab txoj hlua no tso rau ntawm LCD rau (;;) {// Tsis muaj dab tsi nyob mus ib txhis (Cov lus twb tau tshwm sim ntawm LCD)}}

    Txoj Cai Txuas

    Cov cai txuas nrog Peter Fleury lub tsev qiv ntawv LCD (lcd.c thiab lcd.h) nrog nws tso cai. Ua tsaug Peter! Qhov kev hloov pauv nkaus xwb kuv tau ua rau nws yog teeb tsa tus pin kom raug hauv Cov Lus Txhais. Thov mus ntsib nws lub vev xaib txhawm rau rub pob: https://www.jump.to/fleuryI kuv kuj tau suav nrog cov ntaub ntawv uas kuv siv sau los ntawm Eric B. Weddington thiab, Jorg Wunsch. Kuv xa PM mus rau Jorg dhau ntawm avrfreaks.net tab sis yeej tsis tau txais lus teb los ntawm nws. Muaj qee qhov kev hloov pauv hauv cov ntawv tsim los txiav rau siv Linux thiab Zaj. Ua tsaug rau koj ob leeg, thov teem sijhawm paub kuv qhov kev nyiam rau kuv qhia koj li haujlwm.

    Kauj Ruam 4: 28-pin UC ISP Programming (ATmega8)

    28-pin UC ISP Programming (ATmega8)
    28-pin UC ISP Programming (ATmega8)
    28-pin UC ISP Programming (ATmega8)
    28-pin UC ISP Programming (ATmega8)

    Txoj haujlwm tshem tawm tom ntej yuav siv ATmega8 uas yog 28-pin avr. Nov yog qhov yooj yim jumper teeb tsa rau ISP cov phiaj xwm 28-pin microcontrollers.

    Jumper Chaw

    Teem cov dhia ntawm Dragon Rider kom cov shunts txuas cov pins hauv qab no. (pin4 yog tus pin nruab nrab rau J22 -J -24) Pins: J11 - 23J12 - 23J13 - 12J16 - 23J22 - 42J23 - 42J24 - 42

    Cov Ntaub Ntawv Qhia Txog

    • Txuas J11 thiab J12 hauv qhov kev zam no tso cai rau koj siv cov pins li I/O pins. Lwm txoj hauv kev yuav yog taug cov pins no los ua kev sib txuas nrog cov siv lead ua sab nraud.
    • Txuas J13 hauv qhov kev zam no tso cai rau peb siv nws ua tus pin rov pib dua. Lwm txoj hauv kev yuav hla tus lej no mus rau PORTC lub taub hau rau siv ua tus lej I/O. (qhov no yuav muaj ntau qhov tsis zoo, suav nrog kev tsis muaj peev xwm ua haujlwm rau lub nti siv ISP).
    • J16 & J22-J24 tau txuas nrog txoj hauv kev no txhawm rau txhim kho tus pin tsim nyog (Rov pib dua, MISO, MOSI, thiab SCK) mus rau ISP header ntawm AVR Dragon.

    Kauj Ruam 5: Kev Siv LCD Zoo thiab Khawm Siv: Lub Tsho Loj

    Advanced LCD thiab Khawm Siv: Lub Sijhawm Loj
    Advanced LCD thiab Khawm Siv: Lub Sijhawm Loj

    Nov yog qhov haujlwm lom zem uas ua rau siv lub vijtsam LCD thiab cov nyees khawm. Peb yuav cuam tshuam nrog Lub Sijhawm Sijhawm Tiag thiab cov cim kev cai ntawm LCD. Hauv daim duab hauv qab koj tuaj yeem pom lub sijhawm 7:26:07 teev tsaus ntuj tso tawm kom pom ntau tus lej ntawm lub vijtsam LCD. Txhua tus lej siv 2 x 2 daim phiaj ntawm cov cim tso tawm kom pom tus lej loj. Qhov no siv tus ntawv xub sau los ntawm Xtinus rau XBMC txoj haujlwm. Cov nyees khawm tau siv los teeb tsa lub moos. Sab laug ntxiv cov xuab moos, Ua kom nce ntxiv feeb, Txoj cai toggles nruab nrab ntawm 12 thiab 24-teev sijhawm, thiab Sau rov pib dua lub vib nas this rau xoom. Lub moos tsis khaws lub sijhawm zoo heev raws li peb tab tom siv qhov tsis raug hauv lub oscillator sab hauv, tab sis txoj haujlwm no tuaj yeem hloov pauv tau yooj yim los siv ntau qhov tseeb sab nraud. Saib qhov no hauv kev nqis tes ua hauv video hauv qab no. Kev piav qhia seb txoj cai no ua haujlwm li cas, tab sis kuv tsis muaj sijhawm tam sim no. Txog tam sim no, txuas lub LCD header (J31) rau PORTD (J4) thiab khawm lub pob (J30) rau PORTB (J2). Nco ntsoov tias koj muaj SW1 thiab SW2 nyob rau hauv txoj haujlwm tawm. Txuas AVR Dragon rau lub xov tooj usb thiab ntsaws lwm qhov kawg ntawm txoj hlua ntawd rau hauv koj lub computer. Qhib SW2 thiab teeb tsa ATmega8 nrog rau kev tsim software uas koj xaiv (hex cov ntaub ntawv hauv qab no; fuses hlawv rau lub chaw teeb tsa). NCO TSEG: Txhawm rau siv Sab laug thiab Up cov nyees khawm koj yuav xav tau tshem cov shunts los ntawm J22 thiab J24, ua qhov no thaum lub hwj chim tawm.

    Kauj Ruam 6: Kev Siv Hluav Taws Xob Siab

    Kuv tau siv High Voltage Parallel Programming kom sawv rov los ATtiny2313 uas kuv teeb tsa lub fuse tsis raug teeb tsa. Kuv xav tau nws zaum thib ob thaum ua haujlwm ntawm cov lus qhia no vim kuv yuam kev sau qhov lfuse teeb Kuv xav mus rau hfuse rau npe….. ooops. Kev Siv Hluav Taws Xob Hluav Taws Xob Hluav Taws Xob yog qhov khoom siv tau yooj yim rau koj ntawm kev pov tseg! High Voltage Parallel Programming: ATtiny2313 hauv qhov (socket) U3: SW1 - OFFSW2 - ONJ5, J6, J7 - txuas pin1 thiab pin2XTAL1 - txuas pin1 thiab pin2J16 - Txuas pin1 thiab pin22x5 IDC Cables: PROG_CTRL rau PORT D, PROG_DATA rau PORT B J8-J13, J18, J19, J20, J22-J28, J24) Rau lwm cov chips koj yuav tsum muaj peev xwm txheeb xyuas cov teeb tsa uas koj xav tau los ntawm Atmel cov neeg siv phau ntawv qhia rau lawv STK500.

    Kauj Ruam 7: Nthuav Tawm dhau Pawg Thawj Coj

    Nthuav tawm dhau ntawm Pawg Thawj Coj
    Nthuav tawm dhau ntawm Pawg Thawj Coj

    Kuv pom nws yooj yim heev rau cuam tshuam nrog lub khob cij. Qhov no tso cai rau ntau qhov kev hloov pauv yooj yim hauv kev tsim qauv thiab tsim cov cai nyob rau tib lub sijhawm. Kuv txuas cov kab hlua txuas mus rau cov chaw nres nkoj tsim nyog ntawm ib kawg. Ntawm lwm qhov kuv siv cov xov hlau txuas los txuas rau ICD tus neeg xyuas kom raug nrog lub khob cij.

    Kauj Ruam 8: Xaus

    Muaj ntau yam ntxiv uas tuaj yeem koom nrog hauv Cov Lus Qhia no. Hmo no kuv ua tiav qhov hloov pauv uas tso cai rau koj siv 6-tus lej lub cajmeem lub npe yam tsis tshem tus zaj los ntawm Zaj Rider. Kuv yuav muab cov ntaub ntawv hais txog yuav tsim ib tus kheej li cas … yuav los sai sai. Yog tias koj muaj lwm yam uas koj xav tias yuav tsum tau ntxiv tso tawm cov lus tawm.

    Kauj Ruam 9: Ntxiv 6-Pin ISP

    Ntxiv 6-Pin ISP
    Ntxiv 6-Pin ISP
    Ntxiv 6-Pin ISP
    Ntxiv 6-Pin ISP
    Ntxiv 6-Pin ISP
    Ntxiv 6-Pin ISP

    Kuv ib txwm tsim hauv 6-pin ISP lub taub hau rau txhua qhov ntawm kuv cov phiaj xwm yog li kuv tuaj yeem rov tsim dua lub nti yog tias tsim nyog thiab tsis tas yuav tshem nws tawm ntawm lub phiaj xwm phiaj xwm. Tus neeg caij tus zaj tu siab tsis muaj 6-pin ISP header muaj tab sis kuv tau txiav txim siab yuav ua li cas thiaj muaj ib qho.

    Ceeb toom !

    Qhov no yog hack. Yog tias koj tsis paub xyov qhov no ua haujlwm li cas, tsis txhob ua

    Koj tau ceeb toom Kuv tau tsim kuv tus kheej lub rooj tsav xwm adapter thiab 3-pin jumper txhawm rau txhawm rau muab 6-pin isp header. Koj ua dab tsi yog teeb tsa Dragon Rider mus rau qhov program thiab 8-pin microcontroller. Siv lub qhov 3-tus pin kuv tabtom j8 txuas tus pin 1 thiab 3. Qhov no qhia lub moos teeb liab mus rau PortB txuas. Kuv mam li khiav lub jumper cable los ntawm PortB header rau kuv lub rooj tsav xwm adapter thiab voila! Muaj cov duab hauv qab no…. thov, thov, thov, tsis txhob ua qhov no tshwj tsis yog koj nkag siab qhov koj tab tom ua raws li koj tuaj yeem ua rau koj AVR Dragon puas tsuaj lossis phem dua yog tias koj ua qhov no tsis raug.

    Pinout: PortB ISP1 42 13 34 NC5 NC6 57 NC8 NC9 610 2

    Kauj Ruam 10: RSS Reader Siv Kev Txuas Txuas thiab LCD

    RSS Nyeem Ntawv Siv Kev Txuas Txuas thiab LCD
    RSS Nyeem Ntawv Siv Kev Txuas Txuas thiab LCD
    RSS Nyeem Ntawv Siv Kev Txuas Txuas thiab LCD
    RSS Nyeem Ntawv Siv Kev Txuas Txuas thiab LCD

    Kuv tab tom txuas ntxiv ua si ib puag ncig nrog pawg tswj hwm kev txhim kho no. Lub sijhawm no kuv tau siv ib feem ntawm yav tav su txhim kho RSS nyeem (feem ntau nyob ntawm nab nab sab). Kuv tsis xav tias nws lav nws tus kheej cov lus qhia yog li kuv tau ntxiv rau ntawm no.

    Kho vajtse

    Peb tab tom siv Dragon Rider 500 ua pawg tswj hwm kev txhim kho. Qhov no muab txhua yam khoom siv uas koj xav tau (piv txwv tias koj muaj tag nrho cov khoom siv ntxiv). Uas tau hais tias koj yeej tuaj yeem ua qhov no nrog koj tus kheej teeb tsa kho vajtse:

    • ATmega8 microcontroller (lossis ib qho uas muaj USART thiab tus pin txaus rau txhua qhov kev sib txuas
    • Ib txoj hauv kev rau program microcontroller (Kuv siv AVR Dragon)
    • MAX232 nti rau kev sib txuas lus txuas
    • DB9 txuas
    • HD44780 LCD npo
    • Crystal (Kuv siv 8MHz siv lead ua)
    • Assorted capacitors thiab resistors

    Ib qho txheej txheem tau muab qhia hauv qab no. Ntawm Dragon Rider peb yuav xav tau siv qee qhov kev muaj tswv yim rau Txoj Kev sib txuas. Feem ntau Port D tuaj yeem txuas ncaj qha mus rau lub taub hau LCD. Qhov no tsis yog qhov no vim tias USART xav tau rau kev txuas txuas siv PD0 thiab PD1. Tsis tas li ntawd, Chaw nres nkoj B tsis tuaj yeem siv vim PB6 thiab PB7 tab tom siv rau sab nraud siv lead ua. Kho duab hauv qab no yog kuv qhov kev daws teeb meem no. Kuv ntsaws rau hauv ib txoj kab hlua txuas rau lub taub hau rau LCD, Chaw nres nkoj B thiab Chaw D, tom qab ntawd siv cov xov hlau txuas los ua txoj hauv kev kom raug. Tsis txhob hnov qab mus ntsaws qhov hluav taws xob thiab hauv av rau LCD lub taub hau.

    Software

    Lub software rau txoj haujlwm no los ua ob ntu, lub firmware rau lub microcontroller thiab cov nab hab sej tsab ntawv txhawm rau txhawm rau txhawm rau RSS pub thiab xa lawv hla cov ntawv txuas. /loj). Nws muaj zog thiab sib luag, muaj ntau yam, thiab yooj yim hloov rau koj teeb tsa kho vajtse. Yog tias koj saib cov ntawv header txuas (lcd.h) koj yuav pom tias kuv tab tom khiav hauv 4-ntsis hom nrog Port D raws li cov ntaub ntawv me me, thiab Port B raws li cov khoom tswj.:

    • Thaum siv lub microcontroller qhia "RSS Reader" thiab tom qab ntawd tos rau cov ntaub ntawv xov xwm.
    • Txhua qhov byte ntawm cov ntaub ntawv xov xwm tau txais ua rau muaj qhov tsis zoo ntawm 16 tus cim kom txav mus rau sab laug thiab ntxiv cov byte mus rau qhov tsis, tom qab ntawd tso saib tsis pom.
    • Peb qhov lus txib tshwj xeeb tau txais los ntawm microcontroller: 0x00, 0x01, thiab 0x02. Cov no yog cov ntxaij vab tshaus meej, txav mus rau kab 0, thiab txav mus rau kab 1 feem.

    Python ScryptI tau sau ib tsab ntawv pyton txhawm rau txheeb xyuas cov ntaub ntawv RSS thiab xa nws hla qhov txuas txuas. Qhov no xav tau tus nab npawb nab npawb "pyserial" uas koj yuav zaum yuav tsum tau nruab rau ntawm koj lub cev kom tau qhov no los ua haujlwm. RSS pub tuaj yeem teeb tsa nyob rau sab saum toj ntawm cov ntawv pyton. Daim ntawv ceeb toom tias koj yuav tsum nkag mus rau lub npe rau pub nrog rau cov pub url. Muaj peb qhov piv txwv nyob ntawd, Kuv paub tseeb tias koj tuaj yeem ua raws cov ntawd rau qhov ua kom raug. Ua kom txhua yam ua haujlwm

    • Sib dhos kho vajtse
    • Program microcontroller (dragon_rss.hex tuaj yeem siv tau yog tias koj tsis xav sau qhov no koj tus kheej). Fuse nqis rau ATmega8 siv 8 MHz siv lead ua: lfuse = 0xEF hfuse = 0xD9
    • Hwj chim rau Dragon Rider thiab xyuas kom cov kab txuas txuas tau txuas (LCD yuav tsum nyeem: "RSS Reader")
    • Ua tus txheej txheem nab hab sej (sej serial_rss.py)
    • Txaus siab rau

    Pom zoo: