2013年11月1日金曜日

AVRプログラマ自作(1) Ubunutu + avrdude + 自作回路 + RS232C USB変換ケーブル

前回、aitendoのAVRプログラマでAtmega8-16PUにプログラム転送できることは確認した。

したんだけど、いちいちWindows起動してプログラム転送するのが面倒。

なんとかLinuxでプログラム転送できないかなぁということで調べてみた。

で、RS232Cと簡単な回路でできそうなことがわかった。


  1. Serial programmer
  2. Simple Serial Programmer for AVR

1.と2.では微妙に回路が違うんだけど、2.の方は~RESETになってるので1.の回路をブレッドボードに作成。

RS232Cの方はUSB変換ケーブルを持っていたのでそれを使用。

回路全体

回路拡大

RS232C変換ケーブル

そして2.のサイトを参考に以下のコマンドを実行したところ、無事転送成功。
$ avrdude -p m8 -c ponyser -P /dev/ttyUSB0 -U flash:w:blink2.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.58s
avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "blink2.hex"
avrdude: input file blink2.hex auto detected as Intel Hex
avrdude: writing flash (104 bytes):
Writing | ################################################## | 100% 20.37s
avrdude: 104 bytes of flash written
avrdude: verifying flash memory against blink2.hex:
avrdude: load data flash data from input file blink2.hex:
avrdude: input file blink2.hex auto detected as Intel Hex
avrdude: input file blink2.hex contains 104 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 19.97s
avrdude: verifying ...
avrdude: 104 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done.  Thank you.
動作確認は出来たのでユニバーサル基板に本番回路を実装しよう。


0 件のコメント:

amazonアソシエイト