initial useable status

This commit is contained in:
2026-07-18 16:28:15 +02:00
parent 88a0e83578
commit d4c50abb70
2 changed files with 613 additions and 1 deletions
+63 -1
View File
@@ -1,3 +1,65 @@
# DCCMFL-Firmware
Firmware to all our DCC Multi-Functional Locomotive Controllers.
Firmware to all our DCC Multi-Functional Locomotive Controllers.
## Prerequisits
- Arduino IDE 2
- megaTinyCore library: can be installed from Arduino IDE boards manager by adding this URL to the "Additional boards manager URLs": http://drazzy.com/package_drazzy.com_index.json or for manual install you can find the git-repository here: [https://github.com/SpenceKonde/megaTinyCore](https://github.com/SpenceKonde/megaTinyCore)
- NmraDcc library: can be installed from Arduino IDE library manager or from the git-repository at [https://github.com/mrrwa/NmraDcc](https://github.com/mrrwa/NmraDcc)
- Arudino Uno or Mega (or a compatible clone) with [JTAG2UPDI programmer](https://github.com/ElTangas/jtag2updi) burned onto it
- some jupmer wires to connect the decoder to the Arduino Uno
## Compilation
### DCCMFL1616 series - ATtiny1616 based decoders
- In the Arduino IDE go to the Tools-menu and select Board -> megaTinyCore -> ATtiny3226/3216/1626/1616/1606/826/816/806/426/416/406
- In the Arduino IDE go to the Tools-menu and select BOD-voltage -> 4.2V (20MHz or less)
- In the Arduino IDE go to the Tools-menu and select Chip -> ATtiny1616
- In the Arduino IDE go to the Tools-menu and select Clock -> 20 MHz internal
- To build the sketch go to Sketch-menu and select Verify Compile
- Wait for the firmware to compile
- After successful compilation you are ready to [upload](#upload) the firmware to your decoder
## Upload
### DCCMFL1616 series - Connect the decoder with the Arduino
- disconnect decoder and the Arduino UNO from any power sources (USB, power supply, track power, ...)
- Connect the GND pin of the decoder programming-interface with the GND pin on the Arduino
- Connect VCC pin on the decoder with the 5V pin on the Arduino
- connect the UDPI pin on the decoder with digital pin 6 on the Arduino
- connect the Arduino to your computer
#### Upload firmware
- In the Arduino IDE go to the Tools-menu and select Port -> Serial Port of the connected Arduino
- In the Arduino IDE go to the Tools-menu and select Programmer -> jtag2updi
- In the Arduino IDE go to the Sketch-menu and select Upload Using Programmer
- Wait for the firmware to compile and upload to the decoder
- Disconnect your Arduino from your commputer
- Disconnect your decoder from the Arduino
## Setup decoder
- Assemble your decoder on your loco
- Put your loco onto the programming track and activate the programming track power
- Programm your decoder using your DCC programming tools (Standard-DCC-Address is 3 but it might not be properly assigned when the decoder is flashed for the first time)
## Functionaly implemented
- motor control (speed & direction) with start and maximum PWM values defined in CV2 & CV5
- integrated acceleration / deceleration profile controlled by CV3 & CV4
- exterieur lighting (F0 white head lights, F1 red rear lights, in combination with F5 white head and rear lights) in regards to driving direction
- direction related cabin light
- defined default Decoder address: 3 (according to NMRA & NEM standard)
- factory reset by setting CV8 to 255
- debugging on UART (TX) can be activated (may slow down reaction of the decoder to updated controls)
## Functionality planned but NOT implemented yet:
- analog DC driving mode --> DCC-timeout?
## Adapting the firmware to your needs
Just as the electronics design, the firmware is free to use and modify. So if you need any specific functions driven by the decoder you can easily add this to the firmware.
Pretty much all of the firmware (other than the libraries) is found in the DCCMFL1616.ino sketch. The firmware is based on an example of the NmraDcc library. It was heavily altered though to realize a much more functional decoder. There are plenty of comments in the sketch so you should be able to understand how it is working if you have at least some basic programming skills.
So you added a new feature to the firmware? Why don't you let us know about it. Create a fork of the [official repository](https://git.schauaus.at/Fahrzeugsteuerungen/DCCMFL-Firmware.git), add your changes and leave us a message on the fedivers (@modellbau@schauaus.at).
If we think your feature may be useful to others as well, we will test it and probably add it to the official repository eventually. Credits will be granted to you in this case of course!
## Feature request
In case you do not have the programming skills needed and you would like to see an additional feature added to the standard-firmware feel free to reach out to us on the fediverse (@modellbau@schauaus.at) and tell us about what you would like to see added.
There is no guaranty though that or when a new feature may be added.