====== Smile Decoder (DSdecR3) ====== News! [[DS Smile Decoder R4]]を2016年4月よりリリースしました。\\ News! [[http://web.nucky.jp/|ぬっきぃさんのワンコインデコーダ]]はさらに安いです!(300円~!)\\Nucky's one coin decoder is very cheap! check [[http://web.nucky.jp/|web nucky]]! このページでは、DCCデコーダ「スマイルデコーダ」について回路から使用方法、ソフト、販売までが書かれています。 このデコーダはArduinoをベースとしており、完全なオープンソース・オープンハードになっており、様々な方がサウンドデコーダを実装したり、メロディを奏でたり、VVVF音をモーターから出したり、ポイントを動かしたりなどしています。1個あたり材料費で1000円弱でZゲージにも(ギリギリ)入るDCCデコーダを作成できます。 This page describes our original DCC decoder "Smile Decoder". This decoder has a compatibility with Arduino. You can easily customize this decoder. This decoder supports turnouts and locomotive, specialized feature. {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_8-thumbnail2.jpg}} ===== index / 目次 ===== * [[Smile Writer]] (Programmer for smile decoder) * [[Sound Option]] 簡易サウンド機能追加方法 * [[DSdecR3 Know how list]] (Soldering instruction) * [[Decoder Development Board]] デコーダ開発ボード * [[CV read and write via Software Serial]] ===== Parts list / 部品表 ===== ^Parts No ^Parts ^Package ^ url ^Parts ID^ Price^ |D1-D5 | Rohm RB160M-30TR, 1A\\ Panjit SS2040FL | SOD-123| [[http://akizukidenshi.com/catalog/g/gI-01398/|url]]\\ [[http://akizukidenshi.com/catalog/g/gI-02073/|url]] |I-01398\\ I-02073 | @15JPY | |C1,C2,C3 | 1uF 25V or 50V MLCC, |2012size| [[http://akizukidenshi.com/catalog/g/gP-07525/|url]] | P-07525 | @10JPY | |C4,C5 | Option, 1uF 25V or 50V MLCC, |2012size| [[http://akizukidenshi.com/catalog/g/gP-07525/|url]] | P-07525| @10JPY | |R1,R2 | 100kOhm, |1608size | [[http://akizukidenshi.com/catalog/g/gR-06104/|url]] | R-06104| @0.05JPY | |IC1 | ATMEL ATMEGA328P-AU, |QFP32 | [[http://akizukidenshi.com/catalog/g/gI-04386/|url]] | I-04386| @280JPY | |IC2 | Rohm BD6231F-E2 |SOP8 | [[http://akizukidenshi.com/catalog/g/gI-05088/|url]] | I-05088| @180JPY | |IC3 | Toshiba TA78L05F, | SOT-89 | [[http://akizukidenshi.com/catalog/g/gI-00494/|url]] | I-00494| @25JPY | |X1| Murata Ceralock 16MHz,CSTCE16M0V53 | 3 pins, SMD | [[http://akizukidenshi.com/catalog/g/gP-09679/|url]] | P-09679 | @40JPY | |- | SmiTube 10mm | | [[http://akizukidenshi.com/catalog/g/gP-08986/|url]]| P-08986 | - | ===== Schematics ===== {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_2_2-thumbnail2.png}} {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_2_1-thumbnail2.png}} {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/ProMiniDCCDecoder_R3.PNG?500}} ===== Features 特徴 ===== * Very small size (30 x 12.5mm)\\ 小型サイズ * keep alive capacitor is available to add.\\ コンデンサ追加端子あり。瞬断に強い。 * Arduino based software, open source. You can use Arduino IDE to program.\\ Arduinoベース。ソフト書き換え可能。オープンソース。 * Easy to program. Card edge connector is available. Program Writer is very cheap!\\ カードエッジコネクタ搭載で書き換えが簡単。 * Locomotive and turnouts, sound and melody functions are supported.\\ 機関車やポイント、サウンドにヘッドライトやファンクションのデコーダを同一のボードでソフト書き換えにより実現。 ===== Pin Assignment ===== ^Pin No. ^Function ^Notes ^ |D3 | Sound, PWM, generic use | We often use for sound option. | |A5, A4| I2C, Analog input pins | | |D9, D10| Motor PWM pins | If not soldered Motor Driver, you can use this pin freely. | |IN| DCC input pins. | Connect to rail side wire.| |OUT| Motor output pins. | Connect to motor side wire.| |CAP| Keep alive capacitor pins.| DO NOT MISUNDERSTAND plus(+) pin. See + mark.| ===== Decoder Comparison ===== {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/DecoderComparison_20150704-thumbnail2.jpg}}\\ [[http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/DecoderComparison_20150704.jpg|Large image]] ===== Download (sketches) ===== 以下は、Arduino IDE用のポイントと機関車デコーダ等のソースコード(スケッチ)例や、DCCデコーダ機能のベースとなるNMRA DCCライブラリの転載(ミラー)です。\\ This decoder sketches are based on [[http://mrrwa.org/ | NMRA DCC library]]. Please install the library before use. ^File ^Version ^url ^Notes ^ |Locomotive decoder sketch\\ (車両用デコーダスケッチ) | R4 | [[http://desktopstation.net/decoder/DSDCCDecoder_R4.ZIP | download]] | Improve maximum speed stop problem. | |Locomotive decoder VVVF sketch\\ (VVVF音対応車両用デコーダスケッチ) | K7(2015/6/15) | [[https://desktopstation.net/wiki/lib/exe/fetch.php/dsdccdecoder_vvvf_k7.zip | download]] | Improved by [[http://fujigaya2.blog.so-net.ne.jp/|Fujigaya-san]]. Required [[https://github.com/PaulStoffregen/TimerOne|TimerOne Library]].\\ Detail description is [[http://fujigaya2.blog.so-net.ne.jp/2015-06-15-1|here]] (written in Japanse)| |Locomotive decoder with VVVF and melody sketch | K9(2015/8/1) | [[https://desktopstation.net/wiki/lib/exe/fetch.php/dsdccdecoder_vvvf_k9_melody.zip | download]] | produced by [[http://fujigaya2.blog.so-net.ne.jp/|Fujigaya-san]]. Required [[https://github.com/PaulStoffregen/TimerOne|TimerOne Library]] and [[http://kamide.b.osdn.me/pwmdac_synth_lib/|PWMDAC_Synth]].\\ Detail description is [[http://fujigaya2.blog.so-net.ne.jp/2015-06-21|here]] (written in Japanse)| |Turnout decoder sketch\\ (ポイント用スケッチ) | R1 | [[http://desktopstation.net/decoder/DSDCCAccessoryDecoder_R1.ZIP | download]] | first version | |Headlight decoder sketch\\ (ヘッドライト用スケッチ) | R1 | [[http://desktopstation.net/decoder/DSDCCHeadLightDecoder_R1.ZIP | download]] | first version | |NMRA DCC Library 2014-10-15\\ (共通ライブラリ) | R1 | [[http://desktopstation.net/decoder/MRRwA-2014-10-15.zip | download]] | このライブラリは必ずArduino IDEのlibrariesフォルダにインストールしてください。Mirror from [[http://mrrwa.org/ | mrrwa.org]]| サウンド関連スケッチは[[Sound Option]]を参照ください。\\ Sound related sketches are described in [[Sound Option]] ===== Programming using Arduino IDE ===== If first time setup([[Smile writer]]) is finished, please see the following instruction. \\ スマイルライタの作成作業([[Smile writer]])を完了した後に、以下の手順でスケッチをスマイルデコーダに書き込みます。 - Run Arduino IDE.\\ Arduino IDEを起動します。 - Select the board as Arduino UNO.\\ マイコンボードはArduino/Geuino UNOを選びます。 - Check serial port.\\ スマイルライタが装着されているシリアルポートを確認し選択します。 - Select programmer as "Arduino as ISP".\\ 書き込み装置を「Arduino ISP」にします。 - Open your decoder sketch or examples.\\ 書き込みたいスケッチを開きます。 - Burn the bootloader at tool menu.\\ Note: 1st time may fail to program a bootloader. Please retry.\\ ツールメニューからブートローダを書き込みます。なお、一回目は失敗する場合があります。失敗した場合はもう一度、書き込み操作をしてください。 - Click "**Upload using programmer**" at the file menu. **DO NOT USE upload button and upload menu**.\\ 「書き込み装置を使って書き込む]を押して、スケッチを書き込みます。なお、「アップロード」ボタンは絶対に使用しないでください。スマイルライタのArduino ISPスケッチが書き換えられてしまいます。 - No error happens, that's all!\\ エラーが発生していなければ成功です。 {{::uploadwithprogrammer.png?300|}} ===== Implementing to locomotive and turnouts ===== This chapter describes how to implement the decoder to turnouts and locomotive.\\ ここでは、ポイントと車両にデコーダを組み込んだ例をお見せします。 ==== Turnouts ==== I use Kato 2-301 HO turnout with solenoid. This turnout doesn't support DCC. Then I implement smile decoder to this turnout internal. {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_1-thumbnail2.jpg}}\\ [[http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_1.jpg| Large image]] {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_2-thumbnail2.jpg}}\\ [[http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_2.jpg| Large image]] {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_4-thumbnail2.jpg}}\\ [[http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_4.jpg| Large image]] {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_3-thumbnail2.jpg}}\\ [[http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/Kato_ho_turnout_dcc_3.jpg| Large image]] ==== Locomotive ==== {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_NEM8_1-thumbnail2.jpg}} {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_NEM8_2-thumbnail2.jpg}} {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_NEM8_3-thumbnail2.jpg}} {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_NEM8_4-thumbnail2.jpg}} {{http://buin2gou.sakura.ne.jp/sblo_files/powerele/image/SDR3_NEM8_5-thumbnail2.jpg}} ===== Download (PCB layouts, etc.) ===== 基板の回路図、ガーバーデータなど一式は以下です。 回路図エディタは[[http://www.suigyodo.com/|水魚堂様]]の[[http://www.suigyodo.com/online/schsoft.htm|BSCH]]、基板エディタは[[http://www.suigyodo.com/online/mbe/mbe.htm|mbe]]を使用しております。 ^ファイル^バージョン ^url ^備考 ^ |Schematic for BSCH | R3e | [[http://desktopstation.net/decoder/ProMiniDCCDecoder_R3d.ZIP|url]] | first version | |Layout for mbe | R3e | [[http://desktopstation.net/decoder/DecoderR3e.ZIP|url]] | first version | |Gerber file | R3e | [[http://desktopstation.net/decoder/DecoderR3e_gerber.ZIP|url]] | available to upload to PCB manufacture.\\ 基板業者にそのまま渡せるZIPファイルになっています。ご自分で発注できます。 | ===== CV設定方法 ===== 以下に、主なスケッチの初期設定(主にCV)の方法を記載しています。 ===== Accessory(Turnout) decoder / アクセサリデコーダの場合 ===== CV1(LSB)とCV9(MSB)がアドレス設定用です。\\ CV1(LSB) and CV9(MSB) means turnout address value. CV9は0、CV1を1とすると、初期値(アクセサリアドレス1)となります。CV1に10と書き込むと、アクセサリアドレスは10になります。CV9は上位ビットをあらわすので、255超の場合はCV9に上位ビット分を書き込んでください。\\ If CV9 sets 0 and CV1 sets 1, turnout address means 1. If you want to set the address 255 or more, you need to write CV9 the upper bit value. ===== Distribution / 頒布 ===== 不定期に頒布中。以下の価格は参考価格で、部品調達状況により常に変動します。 また、デコーダキットについては頒布価格を下げるため秋月電子で購入出来る部品は頒布しませんので、ご了承下さい。お手数ですが、各自で入手下さい。 * デコーダ開発ボード 3000円 * スマイルライターキット 1000円 * デコーダキット 1000円(基板10枚くらい、1608サイズ100kΩ抵抗必要個数分のセット。残りは秋月電子で買ってください) * 基板大量購入 要問い合わせ * 送料 200円 お問い合せ・購入は、[[http://desktopstation.net/distribution_jp.html|公式オンラインショップ]]の注文フォームの備考欄か、メールでどうぞ。 {{http://desktopstation.net/images/tegamimoji.png}} ※完成品はありません。全て自分でハンダ付け&ソフト書き込み願います。