ユーザ用ツール

サイト用ツール


mobiledecoder2:firmupdate:arduino

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
mobiledecoder2:firmupdate:arduino [2021/07/02 16:28] ytsuruimobiledecoder2:firmupdate:arduino [2022/12/09 13:09] (現在) – [はじめに] ytsurui
行 1: 行 1:
 ====== ファームウェア更新方法 (Arduino版) ====== ====== ファームウェア更新方法 (Arduino版) ======
  
-このページでは、サークル「MT40」で頒布している、「[[:mobiledecoder2|Nゲージ向けDCCデコーダ (第二世代)]]」のファームウェアを更新する方法についてご案内しております。+このページでは、サークル「MT40」で頒布している、「[[:mobiledecoder2:top|Nゲージ向けDCCデコーダ (第二世代)]]」のファームウェアを更新する方法についてご案内しております。
  
 これ以外の機種の場合は、該当の機種のページをご参照ください。 これ以外の機種の場合は、該当の機種のページをご参照ください。
行 17: 行 17:
  
 ^ デコーダの型番 ^ 対応するスケッチ ^ ^ デコーダの型番 ^ 対応するスケッチ ^
-| K3066RA | [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/download/v1.0.2/motordecoder2-arduino-v1.0.2.zip|motordecoder2]] |+| K3066RA | [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/download/v1.0.5/motordecoder2-arduino-v1.0.5.zip|motordecoder2-arduino-v1.0.5.zip]] |
 | K3057RA | ::: | | K3057RA | ::: |
 | K3057RA-S | ::: | | K3057RA-S | ::: |
-| K3057-T | [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/download/v1.0.2/funcdecoder2-arduino-v1.0.2.zip|funcdecoder2]] |+| K7012RA | ::: | 
 +| T-EC215RA | ::: | 
 +| M02F0RA | ::: | 
 +| M02F7RA | ::: | 
 +| K3057-T | [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/download/v1.0.5/funcdecoder2-arduino-v1.0.5.zip|funcdecoder2-arduino-v1.0.5.zip]] |
 | K3057-ST | ::: | | K3057-ST | ::: |
 +| T-EC215Tc | ::: |
 +| T-EC215F | ::: |
  
 ---- ----
行 115: 行 121:
  
 線路電源の端子については、ワニ口クリップで線路電源 (コマンドステーション出力やDC12V) 、またはArduino上から供給する+5V電源に接続します。 線路電源の端子については、ワニ口クリップで線路電源 (コマンドステーション出力やDC12V) 、またはArduino上から供給する+5V電源に接続します。
 +
 +<WRAP group>
 +<WRAP half column>
 +{{ :mobiledecoder2:k3066ra:k3066ra_progconn.jpg?400 |}}
 +</WRAP>
 +
 +<WRAP half column>
 +{{ :mobiledecoder2:k3057ra:k3057ra_progconn.jpg?400 |}}
 +</WRAP>
 +</WRAP>
 +
  
 もっとも単純な接続事例を下記写真で示しますので、参考にしてください。 もっとも単純な接続事例を下記写真で示しますので、参考にしてください。
行 128: 行 145:
  
 K3057シリーズは構造上、線路端子の裏側に別のパターンが存在しており、そのままワニ口クリップで基板を挟むとはんだレジストが損傷し、意図せず短絡してデコーダ焼損が発生するケースがあります。 \\ K3057シリーズは構造上、線路端子の裏側に別のパターンが存在しており、そのままワニ口クリップで基板を挟むとはんだレジストが損傷し、意図せず短絡してデコーダ焼損が発生するケースがあります。 \\
-そのため、下記例のように厚紙やプラ板などを挟み、線路端子の反対側を保護するように接続してください。+そのため、下記例のように適当な厚紙やプラ板などを挟み、線路端子の反対側を保護するように接続してください。
  
 {{:mobiledecoder2:firmupdate:jtag2updi:k3057-warning.jpg?400|}} {{:mobiledecoder2:firmupdate:jtag2updi:k3057-warning.jpg?400|}}
 {{:mobiledecoder2:firmupdate:jtag2updi:k3057-warning-2.jpg?400|}} {{:mobiledecoder2:firmupdate:jtag2updi:k3057-warning-2.jpg?400|}}
 +
 +----
 +
 +====== Arduino IDEへボード情報を追加する ======
 +
 +先ほど用意したスケッチをビルド・書き込みできるようにするため、Arduino IDEにボード情報を追加します。
 +
 +[[https://github.com/SpenceKonde/megaTinyCore|megaTinyCore]]を使用し、ATtiny1606 / ATtiny806に対応したバイナリのビルド・書き込みを行えるようにします。
 +
 +===== megaTinyCoreの追加方法 =====
 +
 +==== ボードマネージャのURL追加 ====
 +
 +ファイル -> 環境設定と開き、「追加のボードマネージャのURL」に、「http://drazzy.com/package_drazzy.com_index.json」を入力します。
 +
 +{{:mobiledecoder2:firmupdate:arduino:add-boardinfo.png?400|}}
 +{{:mobiledecoder2:firmupdate:arduino:add-boardinfo2.png?400|}}
 +
 +==== ボード情報のインストール ====
 +
 +ツール -> ボード -> ボードマネージャを開き、「megaTinyCore」をインストールします。
 +
 +{{:mobiledecoder2:firmupdate:arduino:add-boardinfo3.png?400 |}}
 +{{:mobiledecoder2:firmupdate:arduino:add-boardinfo4.png?400|}}
 +
 +ボード情報のダウンロードに少し時間がかかりますが、これでmegaTinyCoreの追加は完了です。
 +
 +==== MacOSをお使いの場合 ====
 +
 +一部のメニュー表示が異なります。 \\
 +Arduino -> Preferencesを開くと、環境設定が開きます。
 +
 +{{:mobiledecoder2:firmupdate:arduino:macos-add-boardinfo.png?400|}}
 +
 +また、2021/7/4現在、最新版のmegaTinyCore (2.3.2)でスケッチの書き込みを行おうとすると、EEPROM関連のライブラリでエラーとなり先に進めない不具合がありますので、バージョン2.2.9を選択してインストールを行ってください。
 +
 +{{:mobiledecoder2:firmupdate:arduino:macos_megatinycore_version.png?400|}}
  
 ---- ----
行 139: 行 193:
 [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/tag/v1.0.2|こちら]]のページから、使用しているデコーダに適合するスケッチをダウンロードしてください。 [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/tag/v1.0.2|こちら]]のページから、使用しているデコーダに適合するスケッチをダウンロードしてください。
  
-現在の最新バージョン: Version 2021.07.02 (v1.0.2)+現在の最新バージョン: Version 2021.07.02v2 (v1.0.2)
  
 {{:mobiledecoder2:update:jtag2updi:download-firmware.png?400|}} {{:mobiledecoder2:update:jtag2updi:download-firmware.png?400|}}
行 149: 行 203:
 | K3057-T | [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/download/v1.0.2/funcdecoder2-arduino-v1.0.2.zip|funcdecoder2]] | | K3057-T | [[https://github.com/ytsurui/dcc-decoder2-firmware/releases/download/v1.0.2/funcdecoder2-arduino-v1.0.2.zip|funcdecoder2]] |
 | K3057-ST | ::: | | K3057-ST | ::: |
 +
 +zipファイルを展開すると、中にinoファイルが入っていますのでこれをArduino IDEで開きます。
 +
 +{{:mobiledecoder2:firmupdate:arduino:open-arduinofile.png?400|}}
  
 ---- ----
  
-====== Arduino IDEへボード情報を追加する ======+====== ボードの設定 ======
  
-先ほど用意したスケッチをビルド・書き込みできるようため、Arduino IDEボード情報を追加します。+Arduino IDE側の書き込み設定を、デコーダ搭載されていマイコン合わせます。
  
-[[https://github.com/SpenceKonde/megaTinyCore|megaTinyCore]]を使用し、ATtiny1606 / ATtiny806に対応したバイナリビルド・書き込みを行えるようにします。+設定が下表および画像と同じになるように変更します。
  
-===== megaTinyCoreの追加方法 =====+^ 設定名 ^ 設定内容 ^ 
 +| ボード | ATtiny3226/3216/1626/1616/1606/826/816/806/426/416/406 \\ (ツール -> ボード -> megaTinyCore) | 
 +| Chip or Board | ATtiny1606 (motordecoder2場合) \\ ATtiny806 (funcdecoder2の場合) | 
 +| Clock | 20MHz internal | 
 +| millis()/micros() Timer | Enabled (default timer) | 
 +| Startup Time | 8ms \\ 64ms \\ ※どちらでも動きます。 | 
 +| BOD Voltage Level | 1.8V (5 MHz or less) | 
 +| BOD Mode when Active/Sleeping | Enabled/Sampled (1 kHz) | 
 +| Save EEPROM | EEPROM not retained | 
 +| UPDI/Reset Pin Function | UPDI (no reset pin) | 
 +| Voltage Baud Correction | Ignore (saves flash, almost always fine) |
  
-==== ボードマネージャのURL追加 ====+{{:mobiledecoder2:firmupdate:arduino:arduino-board-config.png?400|}}
  
-ファイル -> 環境設定と開き、「追加のボードマネージャのURL」に、「http://drazzy.com/package_drazzy.com_index.json」を入力します。+----
  
-{{:mobiledecoder2:firmupdate:arduino:add-boardinfo.png?400 |}} +====== 書き込み装置の選択 ======
-{{:mobiledecoder2:firmupdate:arduino:add-boardinfo2.png?400|}}+
  
-==== ボード情報のインストール ====+ール -> 書込装置で、「jtag2updi」を選択します。
  
-ツール -> ボード -> ボードマネージャを開き、「megaTinyCore」をインストールします。+{{:mobiledecoder2:firmupdate:arduino:arduino-select-writer.png?600|}}
  
-{{:mobiledecoder2:firmupdate:jtag2updi:add-boardinfo3.png?400 |}} +ツール -> シリアルポートで、jtag2updiとして接続されているArduinoのCOMポートも選択します。
-{{:mobiledecoder2:firmupdate:jtag2updi:add-boardinfo4.png?400|}}+
  
 +{{:mobiledecoder2:firmupdate:arduino:arduino-select-commport.png?400|}}
  
 ---- ----
  
-====== ファームウェアのスケッチをArduinoで開く ======+====== ファームウェアの書き込み ======
  
-ダウンロードしてきたスケッチをArduinoで開きます。+スケッチ -> 書き込み装置使って書込むを選び、デコーダにファームウェアを書き込みす。 
 + 
 +{{:mobiledecoder2:firmupdate:arduino:arduino-write-board.png?400|}} 
 + 
 +問題なく書き込みが完了すれば、書き込みは完了です。
  
 ---- ----
 +
 +
mobiledecoder2/firmupdate/arduino.1625243314.txt.gz · 最終更新: 2021/07/02 16:28 by ytsurui

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki