Arduino+A4988でGrblができない
前回ArduinoのUSBのシリアル通信がおかしくなってしまった。。
頓挫したところから、
avrdudeでusb通信まわりのhexを焼き直してみるというのをやってみた。
※以下は解決できなかった方法です。
※環境などが違えば問題が発生します
avrdudeのインストールは、自分で頑張ってビルドとかしようとすると、
やんややんやって時間がかかってしまうので、
WinAVR download | SourceForge.net
からインストーラでサクッと入れて、
cmdで
Arduinoをインストールしたパス
\Arduino\hardware\arduino\avr\firmwares\atmegaxxu2
に移動して、
avrdude -c avrisp2 -P usb -p m328p -U flash:w:Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex:i
とコマンドすると、
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e950f
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 "Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex"
avrdude: writing flash (15668 bytes):
Writing | ################################################## | 100% 2.66s
avrdude: 15668 bytes of flash written
avrdude: verifying flash memory against Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex:
avrdude: load data flash data from input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex:
avrdude: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex contains 15668 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 5.07s
avrdude: verifying ...
avrdude: 15668 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
となって書き込めたっぽい。
で、適当なスケッチをArduino IDEから「マイコンボードに書き込む」と、
はい。ダメ~~~~~。
状況は変わらず、mk-Ⅱからシリアル通信する適当なスケッチを書き込んで確認してみる。
シリアルモニタから何か送信すると、ArduinoのRXは点灯して文字で分岐したif内にある処理は実行されるけど、
その分岐にSerial.print(~
と書いていても、ArduinoのTXが点灯しない。シリアルモニタには何も表示されない。
PCからみて受信が、完全にぶっ壊れていました。
ああああああああああああああああああ。
というわけで、またArduinoを発注するしかなさそうです。
orz....
ま、経験ない奴がむちゃくちゃやってる訳だからこういう事もあるよ。
ぶっ壊さずに経験積もうなんてはなっから思ってないから!!。
という謎のカッコつけを自分の中でした後、ふと思った。
自分で互換機を作成していたら、ぶっ壊れた箇所だけ直して使い続けるみたいな、
スマートなことができるんだろうなぁ。。
いつか手を出すと思います。
では!!