Arduino Unoを使ってATtiny85にスケッチを書き込む際のエラー

未分類

最近、Arduino UNOのセットを買いまして、LEDをいろいろ点滅させて遊んでいます。

いい感じに出来たら、ATtiny85に書き込んでいるんですが、書き込みの際に、しょっちゅうエラーが起こります。

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03
Failed programming: uploading error: exit status 1

エラーが起きると、線を指し直したり、リセットしたり、ググって出て来るいろいろをやってみるんですがぜんぜん駄目。

そして、Arduino IDEを再インストールすると何故かうまく書き込めるようになるけど、日にちを空けて使おうとするとまたエラー。

再インストールで使えるという事は、一度書き込むことによって生成される何らかのファイルの所為でそれを探し出して削除すればいいと思いながら見つけられず、使うたびに再インストールしていたのですが、先日、とうとう再インストールしてもエラーに。

ということは、そういう問題ではなかったのか。

ネットにICの破損というの事例も載っていたので、ここへ来て漸くハード障害を疑います。

IC(ATMEGA328P)だけ買って試しても良かったのですが、2つあってもいいだろうと、もうひとつArduinoを買って試したらあっさりOK。

ああ、ハードの故障だったのね。

毎回再インストールしていた時間を返して欲しい。。。

それから、今度ATMEGA328Pを買って交換して試してみよう。

という事で、そんなに高い物でもないし、ハードの故障というのは疑ってみてもいいのかと思います。

(2023.02.02)

痛恨の後日談

2023.03.17追記

ハードウェア原因説は全く違っておりました。原因はお恥ずかしい。

一連の捜査でATtiny85にスケッチをアップロードした後、別のスケッチをArduino UNOにアップロードして色々実験した後、そのまま、ATtiny85にスケッチをアップロードしたからエラーになったのでした。

もちろん、BoadやPortは変更していましたが、ArduinoISPをアップロードしていなかったのです。

お恥ずかしい。Arduino UNOをAVRライタにする訳ですから、何かしらのスケッチを書き込んだ後で、ATtinyに書き込むときは、再度Arduino UNOをArduinoISPで書き換えないといけないのでした。

コメント