# DCCMFL1616_660 (21MTC)

The DCCMFL1616_660 is designed according to [NEM standard 660](https://www.morop.org/images/NEM_register/NEM_E/nem660_en_2022.pdf) and to be used with an 21MTC interface.
## Precautions

The decoder has been tested during development for proper functionality. But there have been no ESD, EMI or any product safety tests performed!  
You will use the design in this repository at your own risk! No warranties whatsoever are granted by developers of this design!  
Don't build and run this decoder if you didn't know what you are doing!

## MTC21-connector:
The decoder is equipped with a MTC21-connector. There is no Zugbus nor SUSI available on this decoder though!  
![MTC21-connector](../images/21MTC_connector_Layout.png)  
The motors are connected between pins 18 and 19.  
Light sources need to be connected through transistors on pins 7, 8, 14 and 15. These pins are equipped with 1kOhm series resistors for over-current protection. Don't run any light sources on these pins directly!  
Directional cabin light LEDs can be connected with transistors between pin 7 or 8 and pin 13. Details can be found in the schematics. Don't run any light sources on these pins directly!  
There are additional inputs and outputs available, that can be used by altering the firmware. All of these pins are protected with 1kOhm series resistors! Use these pins as logical pins only! If you need to control any loads by these pins use transistors or darlington arrays.  
We are using the standard pinout according to [NEM 660](https://www.morop.org/images/NEM_register/NEM_E/nem660_en_2022.pdf):
| Pin | Name | Description | 
| --- | ---- | ----------- | 
| 1 | Input1 | Sensor-Input 1, alternate output 7 | 
| 2 |Input2 | Sensor-input 2, alternate output 8 |
| 3 | AUX6 | Output 6 |
| 4 | AUX4 | Output 4 |
| 5 | ZBCLK | Trains Bus Clock, alternate output 9 |
| 6 | ZBDTA | Train Bus Data (TxD, RxD), alt. output 10 |
| 7 | F0r | Light direction rear |
| 8 | F0f | Light direction forward |
| 9 | SPK/A | Speaker Connection A - not connected|
| 10 | SPK/B | Speaker Connection B - not connected |
| 11 | Index | Not used, Orientation |
| 12 | Vcc | Internal Decoder-Voltage 1.8 – 5.7 Volt |
| 13 | AUX3 | Output 3 |
| 14 | AUX2 | Output 2 |
| 15 | AUX1 | Output 1 |
| 16 | V+ | Decoder Plus, referenced at rectifier, port storage capacitor |
| 17 | AUX5 | Output 5 |
| 18 | Motor2 | Motor-connection #2 minus |
| 19 | Motor1 | Motor-connection #1 plus |
| 20 | GND | Decoder Ground minus, referenced ar rectifier |
| 21 | Power | pick-up left Power pick-up left in direction forward |
| 22 | Power | pick-up right Power pick-up right in direction forward |

## Schmeatics and layout

All the schematics and the PCB layout were designed with the OpenSource EDA [KiCAD](https://www.kicad.org/) version 10.0.  
You can modify it to any of your liking.

## Build files

Gerber files as well as BOM and CPL to use with the PCB prototype service of JLCPCB are included. This is because the developers used that service during the development of this decoder. We are not related with that company in any way! Feel free to use whatever PCB prototype service that you prefer. There are plenty of companies out there offering similar services. And there are just as many add-ons available for KiCAD to export the build files in the exact format these companies request.

## Firmware

The firmware to run this decoder is available [in antother repository on our git-server](https://git.schauaus.at/Fahrzeugsteuerungen/DCCMFL-Firmware).
The firmware is fully compliant to NMRA S-9.2 DCC Communication Standard as well as NEM670 and NEM671 DCC standards using the [NmraDcc-Library](https://github.com/mrrwa/NmraDcc).  
Functions are defined according to [NEM608 Assignment of Additional Functions](https://www.morop.org/downloads/nem/de/nem608_d.pdf) under operating mode 1 (F0 to F9).  
More details can be found in the README.md in the firmware's repository.
