26.10.2014 Views

Fก AVR-USB-Arduino F - ThaiEasyElec.net

Fก AVR-USB-Arduino F - ThaiEasyElec.net

Fก AVR-USB-Arduino F - ThaiEasyElec.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> <br />

<br />

กก DuinoThumb V2 กกก<br />

กก !!!<br />

ก <br />

<strong>AVR</strong> ก <br />

กก ก ..<br />

ก ก ก กก <br />

ก ก DuinoThumb.com<br />

1<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

2<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

<br />

<strong>Arduino</strong> 4<br />

DuinoThumb 4<br />

V-<strong>USB</strong> 4<br />

folder CD 5<br />

ก DuinoThumb V2 5<br />

DuinoThumb V2 6<br />

DuinoThumb V2 7<br />

กก <strong>AVR</strong> ก <strong>AVR</strong> <strong>USB</strong> Device 8<br />

• กก <strong>AVR</strong> ก 8<br />

• ก <strong>AVR</strong> <strong>USB</strong> Device 8<br />

กก <strong>Arduino</strong> ก Driver 8<br />

ก Driver <strong>Arduino</strong> <strong>USB</strong> 10<br />

• Setup DuinoThumb WindowsXP 10<br />

• Setup DuinoThumb Linux Ubuntu 10<br />

• Setup DuinoThumb OSX 11<br />

• ก <strong>Arduino</strong> IDE ก DuinoThumb 13<br />

• ก <strong>Arduino</strong> ก !!! 14<br />

ก 15<br />

DuinoThumb 17<br />

• AVATAR Macro Key 17<br />

• <strong>USB</strong> 2 Serial Converter 17<br />

18<br />

3<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

<strong>Arduino</strong><br />

<strong>Arduino</strong> (Opensource Platform) microcontroller ก <strong>AVR</strong> <br />

กก microcontroller ก microcontroller <br />

MCU ก register <br />

ก MCU กกก <br />

ก computer ก platform กกก<br />

open platform <strong>Arduino</strong> platform library<br />

กกก <strong>Arduino</strong><br />

http://www.arduino.cc<br />

DuinoThumb<br />

DuinoThumb ก <strong>Arduino</strong> กก (<br />

) กก <strong>Arduino</strong> Standard DuinoThumb Bootloader<br />

<strong>Arduino</strong> ( Serial Port) <strong>USB</strong>aspBootloader ( <strong>USB</strong> Port) <strong>AVR</strong><br />

ก ก PC Serial232 <strong>USB</strong> ก download <br />

Flash กก <strong>Arduino</strong> DuinoThumb <br />

ก DuinoThumb PC driver กก กก<br />

DuinoThumb กกกก opensource project V-<strong>USB</strong><br />

DuinoThumb ก กก <strong>USB</strong> <br />

V-<strong>USB</strong><br />

V-<strong>USB</strong> library opensource microcontroller ก <strong>AVR</strong> กก<br />

Protocal <strong>USB</strong> ( 1.1) ATmega8/88/168 ก ก port<br />

ATTiny2313 ก project<br />

ก <strong>AVR</strong> <br />

- <strong>USB</strong>2Serial<br />

- <strong>USB</strong>Mouse, <strong>USB</strong>Keyboard (HID)<br />

- <strong>USB</strong> BootLoader<br />

- <strong>USB</strong> Sensor <br />

- <br />

DuinoThumb กก V-<strong>USB</strong> (<br />

code ก) กก source code<br />

V-<strong>USB</strong> http://www.obdev.at/products/vusb/index.html<br />

4<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

folder CD<br />

• \Original_Src ก project <strong>AVR</strong>-<strong>USB</strong> กก<br />

<strong>USB</strong> <br />

• \<strong>Arduino</strong> ก <strong>Arduino</strong> IDE ( java ก) unzip กก<br />

• \<strong>USB</strong>asp\ pin layout <br />

• \Software\ ก ก PDF (FREE)<br />

ก DuinoThumb V2<br />

DuinoThumb V2 microcontroller ก <strong>AVR</strong> 8 bit ก <strong>AVR</strong> <br />

ATMega168 <br />

- DuinoThumb V2<br />

o <strong>AVR</strong> ATmega168<br />

<br />

• 16KByte Flash, SRAM 1KByte, EEProm 512 Byte<br />

• Digital GPIO 14 <br />

• Analog GPIO 10 <br />

• Port ISP กก<br />

• ก <strong>USB</strong> ( 3.3V) <br />

Jumper ก<br />

• Reset<br />

• LED Hardware<br />

o Crystal 12Mhz ก <strong>USB</strong> <strong>Arduino</strong><br />

- Acrylics Case กก <br />

- CD ก<br />

5<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

DuinoThumb V2<br />

กก DuinoThumb กกก ก ก<br />

V2 ก<br />

กกก (ก)<br />

DuinoThumb V2<br />

กกก ก <br />

- A. กก 5V ก short D1,D2 <br />

ก ก <strong>AVR</strong> , ก 3V ก short ก<br />

- B. 5V ก R<br />

- C. <strong>Arduino</strong> LED ก (^_^)<br />

- D. ก metaboard ISP ( metaboard ISP) <br />

ก<br />

- E. กกกก 1 ก ก<br />

ก SMD ก ก<br />

ก ก <br />

- F. reset ก <strong>USB</strong>aspLoader <strong>Arduino</strong> <br />

6<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

( !! (^_^))<br />

DuinoThumb V2<br />

7<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

กก <strong>AVR</strong> ก <strong>AVR</strong> <strong>USB</strong> Device<br />

DuinoThumb DuinoThumb V2 ก port ISP ก<br />

ก compiler ก Basic (Bascom<strong>AVR</strong>) , C/C++ (<strong>AVR</strong>-GCC) <br />

- กก <strong>AVR</strong> ก<br />

กกก <strong>AVR</strong> ISP ก ก<br />

DuinoThumb กกก compiler ก compile <br />

.hex .hex DuinoThumb port ISP<br />

- ก <strong>AVR</strong> <strong>USB</strong> Device <br />

กกก กกกก <br />

Library Obdev (http://www.obdev.at/products/vusb/index.html) <br />

Obdev ก config <strong>USB</strong> ก<br />

D+ D- ( usbconfig.h) 2 4 ()<br />

กก <strong>Arduino</strong> ก Driver<br />

DuinoThumb V2 กก Firmware ก<br />

<strong>Arduino</strong> กก <strong>Arduino</strong> ก compile upload กก<br />

<strong>USB</strong> Port PC 5v ก<br />

กกก microcontroller Firmware ก<br />

<strong>Arduino</strong> กกก DuinoThumb <strong>Arduino</strong> IDE ก<br />

(ก Avr-Osp II ก)<br />

ก burn BootLoader<br />

8<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

1. ก Auto Detect MCU <br />

2. ก Browse Firmware ก (กก Xtal )<br />

3. ก Program Burn ก<br />

burn FuseBit ก <br />

MCU ก fusebit ก Avr-Osp II กกกก Program ก<br />

ก FuseBit<br />

1. ก Tab FustBit<br />

2. กก MCU ก ATmega168 กก<br />

3. ก Program <br />

** <strong>AVR</strong> ATmega8 High Bit = C0, Low Bit = 9F<br />

** <strong>AVR</strong> ATmega88/168 Ext = 00, High Bit = D6, Low Bit = DF<br />

ก DuinoThumb <strong>Arduino</strong> !! กกก<br />

9<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

ก Driver <strong>Arduino</strong> <strong>USB</strong> <br />

Setup DuinoThumb WindowsXP<br />

Burn ก ( PC ก ก<br />

ก) ก firmware กก BootLoader Jump D7 GND ก<br />

reset PC ก Jump D7 GND ก กกก<br />

reset ก <strong>USB</strong>asp Driver กก Driver<br />

ก<br />

** Win<strong>AVR</strong> version 20080512 ก libusb_0.1.12.1.<br />

** กก libusb_0.1.10.1<br />

Setup DuinoThumb Linux Ubuntu<br />

artchula@gmail.com<br />

http://www.duinothumb.com/articles/linux-ubuntu-duinothumb-setup<br />

Terminal <br />

<br />

$ apt-get install sun-java6-jre<br />

$ apt-get install build-essential<br />

ก<br />

$ apt-get install sdcc<br />

<strong>AVR</strong><br />

$ apt-get install avr-libc<br />

GNU <strong>AVR</strong><br />

$ apt-get install gcc-avr<br />

<strong>AVR</strong>DUDE<br />

$ apt-get install avrdude<br />

brltty<br />

$ apt-get remove brltty<br />

usb<br />

$ apt-get install libftdi-dev<br />

10<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

<strong>Arduino</strong> http://www.arduino.cc/en/Main/Software<br />

$ cd<br />

<br />

$ wget http://www.arduino.cc/files/arduino-0016-linux.tgz<br />

กก<br />

$ tar -xvzf arduino-0016-linux.tgz<br />

ก OS opensource open hardware <br />

Setup Duinothumb OSX<br />

artchula@gmail.com<br />

http://www.duinothumb.com/articles/duinothumb_osx<br />

Duinothumb Macintosh OSX communication port <br />

upload Duinothumb <br />

1. System Preference --> Bluetooth ก Advance <br />

11<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

2. ก + <br />

3. ก type Serial ก Modem RS-232<br />

12<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

4. <strong>Arduino</strong> IDE menu --> Tools -->Serial port ก /dev/tty.Serial-Port-1<br />

<strong>Arduino</strong> ก OSX Duinothumb <br />

ก <strong>Arduino</strong> IDE ก DuinoThumb<br />

ก ก driver <strong>Arduino</strong> ก<br />

DuinoThumb กก <strong>Arduino</strong> ก DuinoThumb ก ก<br />

1. x:\_Path_\arduino-0015\hardware\boards.txt<br />

2. กก save <br />

duinoThumb8.name=DuinoThumb8 12Mhz<br />

duinoThumb8.upload.protocol=usbasp<br />

duinoThumb8.upload.maximum_size=7168<br />

duinoThumb8.upload.speed=19200<br />

duinoThumb8.build.mcu=atmega8<br />

duinoThumb8.build.f_cpu=12000000L<br />

duinoThumb8.build.core=arduino<br />

duinoThumb168.name=DuinoThumb168 12Mhz<br />

duinoThumb168.upload.protocol=usbasp<br />

duinoThumb168.upload.maximum_size=14336<br />

duinoThumb168.upload.speed=19200<br />

duinoThumb168.build.mcu=atmega168<br />

duinoThumb168.build.f_cpu=12000000L<br />

duinoThumb168.build.core=arduino<br />

ก board.txt save ก<br />

13<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

ก <strong>Arduino</strong> ก !!!<br />

ก Board.txt ก <strong>Arduino</strong> IDE D7 <br />

DuinoThumb GND ก Reset <strong>Arduino</strong> IDE ก<br />

ก Board ก DuinoThumb ก ()<br />

(กกก DuinoThumb)<br />

ก compile กกก upload กก<br />

DuinoThumb !!<br />

14<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

ก<br />

ก <br />

กก ก <br />

ก <br />

<br />

http://www.duinothumb.com/duinothumb-problem-and-how-to-fixed<br />

:<br />

- DuinoThumb ก ก reset ก<br />

- jump D7 GND ก reset<br />

:<br />

กก DuinoThumb กก 2 กก<br />

<strong>Arduino</strong> ก BootLoader Firmware ก<br />

BootLoader กก (ก D7 GND ) ก<br />

DuinoThumb BootLoader ก R <br />

10K reset <br />

ก :<br />

DuinoThumb <strong>USB</strong> jump ก D7 GND <br />

กก ก reset ก reset<br />

ก<br />

กก : ( ก)<br />

- R 10K<br />

- reset <br />

:<br />

- DuinoThumb ก <br />

- ก ISP กก<br />

:<br />

ก กก ISP ก <br />

ก Crystal ก capacitor 2 27-30 pf กก<br />

ก <br />

ก :<br />

delay ก 1 ก กก<br />

15<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

กก : ( ก)<br />

- C (ก )<br />

- ATMega , crystal , capacitor ก <br />

Microcontroller กก prototype ( soldermask) กก<br />

Flux ก IC <br />

"" ก กกกก<br />

ก <br />

:<br />

- port I/O <br />

- input/output <br />

:<br />

ก input output port I/O ก<br />

<br />

ก :<br />

probe interface I/O Led, 7 Segment <br />

code ก ( CD)<br />

กก : ( ก)<br />

- ATMega , crystal , capacitor ก <br />

Microcontroller ก Flux กกก <br />

ก Probe IC "" <br />

กก กกกก ก<br />

<br />

16<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

DuinoThumb <br />

AVATAR Macro Key<br />

DuinoThumb Keyboard Mouse Macro ก<br />

ก !!! <br />

http://www.duinothumb.com/showcases/avatar-avr-usb-macro-keyboard-and-mouse-programmable<br />

<strong>USB</strong> 2 Serial Converter<br />

DuinoThumb <strong>USB</strong> Serial ก <br />

10 !!! <br />

http://www.duinothumb.com/showcases/homemade-diy-avr-usb2serial-converter<br />

17<br />

http://www.DuinoThumb.com


ก <strong>AVR</strong>-<strong>USB</strong>-<strong>Arduino</strong> DuinoThumb V2<br />

<br />

ก ก <br />

URL : http://www.DuinoThumb.com<br />

Email : Manager@DuinoThumb.com<br />

กก<br />

DuinoThumb.com<br />

18<br />

http://www.DuinoThumb.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!