忍者ブログ
趣味+メモ用のブログです。 GNU/Linux関連、OSS関連情報、調査事項になるでしょうが、何を書くか分かりません。
[45] [44] [43] [42] [41] [40] [39] [38] [37] [36] [35]
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

 大人の科学 Vol.27(Arduinoが開いたテクノ工作新時代)が到着。
22b53196.JPG










組み立てて、PCと接続するとこんな感じ。 
DSC_0152_mini.jpg









■ 環境
学研のサイトには、当然GNU/Linux版はないので、
Arduino本家から、GNU/Linux 32bit版をダウンロード。

■ IDEの展開と起動
Arduino本家から落としてきたアーカイブを展開し、
起動する。
$ tar -xf arduino-0022.tgz
$ cd arduino-0022
$ ./arduino
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

■ ボードタイプの設定
8ビットマイコン Japanino(ジャパニーノ) まとめ @wiki 学研 大人の科学マガジン Vol.27
によると、CPUは、ATMEL MEGA 168V or 168P/V - AVRマイコン(8bit) とのこと、
ボードタイプ設定を行う。
メニュ→「Tools」→「Board」→「LilyPad Anduino w/ ATmega168」を選択。
Screenshot.jpeg










■ コードを書く
Exsamplesや、学研のサイトのスケッチなどをコピーするなどで
コードを作成する。

■ コンパイル
「Verifiy」のアイコンを押下することでコンパイル可能。
Screenshot2.jpeg










※キーボードの「Shift」を押しながら、Verifyすることで、実行jコマンドを確認できる。
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /tmp/build327257572530850969.tmp/Blink.cpp -o/tmp/build327257572530850969.tmp/Blink.cpp.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/wiring_analog.c -o/tmp/build327257572530850969.tmp/wiring_analog.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/wiring_digital.c -o/tmp/build327257572530850969.tmp/wiring_digital.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/wiring.c -o/tmp/build327257572530850969.tmp/wiring.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/WInterrupts.c -o/tmp/build327257572530850969.tmp/WInterrupts.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/pins_arduino.c -o/tmp/build327257572530850969.tmp/pins_arduino.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/wiring_pulse.c -o/tmp/build327257572530850969.tmp/wiring_pulse.c.o 
avr-gcc -c -g -Os -w -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/wiring_shift.c -o/tmp/build327257572530850969.tmp/wiring_shift.c.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/WString.cpp -o/tmp/build327257572530850969.tmp/WString.cpp.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/WMath.cpp -o/tmp/build327257572530850969.tmp/WMath.cpp.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/Tone.cpp -o/tmp/build327257572530850969.tmp/Tone.cpp.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/Print.cpp -o/tmp/build327257572530850969.tmp/Print.cpp.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/main.cpp -o/tmp/build327257572530850969.tmp/main.cpp.o 
avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega168 -DF_CPU=8000000L -DARDUINO=22 -I/home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino /home/sakaihdt/Arduino/arduino-0022/hardware/arduino/cores/arduino/HardwareSerial.cpp -o/tmp/build327257572530850969.tmp/HardwareSerial.cpp.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/wiring_analog.c.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/wiring_digital.c.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/wiring.c.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/WInterrupts.c.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/pins_arduino.c.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/wiring_pulse.c.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/wiring_shift.c.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/WString.cpp.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/WMath.cpp.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/Tone.cpp.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/Print.cpp.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/main.cpp.o 
avr-ar rcs /tmp/build327257572530850969.tmp/core.a /tmp/build327257572530850969.tmp/HardwareSerial.cpp.o 
avr-gcc -Os -Wl,--gc-sections -mmcu=atmega168 -o /tmp/build327257572530850969.tmp/Blink.cpp.elf /tmp/build327257572530850969.tmp/Blink.cpp.o /tmp/build327257572530850969.tmp/core.a -L/tmp/build327257572530850969.tmp -lm 
avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/build327257572530850969.tmp/Blink.cpp.elf /tmp/build327257572530850969.tmp/Blink.cpp.eep 
avr-objcopy -O ihex -R .eeprom /tmp/build327257572530850969.tmp/Blink.cpp.elf /tmp/build327257572530850969.tmp/Blink.cpp.hex 
Binary sketch size: 1014 bytes (of a 14336 byte maximum)
 
■ 焼きこみ(アップロード)
ボードへの焼きこみは、「Upload」ボタンを押下する。
81423334.png










※キーボードの「Shift」を押しながら、Verifyすることで、実行jコマンドを確認できる。
Binary sketch size: 1014 bytes (of a 14336 byte maximum)
/home/sakaihdt/Arduino/arduino-0022/hardware/tools/avrdude -C/home/sakaihdt/Arduino/arduino-0022/hardware/tools/avrdude.conf -v -v -v -v -patmega168 -cstk500v1 -P/dev/ttyUSB0 -b19200 -D -Uflash:w:/tmp/build327257572530850969.tmp/Blink.cpp.hex:i 

avrdude: Version 5.4-arduino, compiled on Oct 22 2007 at 13:15:12
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/home/sakaihdt/Arduino/arduino-0022/hardware/tools/avrdude.conf"
         User configuration file is "/home/sakaihdt/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/ttyUSB0
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 19200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         AVR Part              : ATMEGA168
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PC2
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no        512    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware

・・・省略・・・
avrdude: verifying ...
avrdude: 1014 bytes of flash verified
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.
 

PR


トラックバック
この記事にトラックバックする:


忍者ブログ [PR]
カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
フリーエリア
最新コメント
最新トラックバック
プロフィール
HN:
一乗寺 又兵衛
性別:
男性
職業:
コンパイル
趣味:
コンパイル
バーコード
ブログ内検索