dcc-lokdecoder

Public

@gyuritill

Download board files

Files for version 1. Pick what you came for.

Share dcc-lokdecoder

Check access before sharing the link.

Who can open this board

Anyone can open this board. No sign-in is required.

This link opens the latest version. Copying it does not grant additional access.

Loading…

README

DCC-Lokdecoder

Description

DCC multifunction decoder for H0 locomotives

Features

  • 1 motor H-bridge output
    • 3.6 A peak current
    • PWM frequency configurable (1-40 kHz)
    • overcurrent and temperature protected
  • 10 function outputs
    • 115 mA per output
    • F0f, F0r, AUX1 and AUX2 are dimmable todo
    • mappable to F0-F12 function keys
  • DCC asymmetry can be detected (for automatic brake control) todo

Hardware

  • 4-layer PCB esigned in KiCAD
  • fairly standard components (available from Digi-Key, Farnell, Mouser, etc...)
  • hand solderable (I did it too)
  • 4 debug LEDs (red, yellow, green and blue)
top sidebottom side

Firmware

  • Arduino compatible programming (behaves like an UNO)
  • DCC decoding by NmraDcc library

JMRI integration

BasicMotorBasic speed controlSpeed tableFunction mapAdvanced

Install guide

  1. Get the PCB (e.g. JLCPCB) and the components (e.g. mouser, digikey)
  2. Solder the components. The SOIC with exposed pad is a bit tricky, it can be soldered from the other side with a big tip and a lot of flux.
  3. Install the Arduino bootloader using the pads 5V, GND, SCK, MISO, MOSI, RST and an Arduino. Arduino as ISP
  4. Uncomment the line #define RESET_FACTORY_DEFAULTS to fill the EEPROM with the default CV values
  5. Upload the code using the pads 5V, GND, RX, TX, DTR and a USB TTL UART cable like this
  6. Re-comment the line #define RESET_FACTORY_DEFAULTS to avoid resetting to factory defaults every time.
  7. Upload the code again.
  8. Add the decoder XML file to JMRI. In DecoderPro select "File-> Import Decoder File..." and browse to the decoder XML. It will take some time, then adds the decoder definition to the database.
  9. Connect the T1 and T2 pads to the programming track of your DCC system.
  10. Add new locomotive with the "New Loco" button and then "Read type from decoder". It should detect the correct type:
  11. If everything is fine, you can install the decoder into your locomotive!

Pinout

PadFunction
M1Motor 1
M2Motor 2
T1Track 1
T2Track 2
V+Positive common for function outputs (keep-alive capacitor positive)
F0fF0 function output forward (open drain)
F0rF0 function output reverse (open drain)
1-8AUX function output n (open drain)
5Vinternal microcontroller +5V supply
GNDground (keep alive capacitor negative)
SCKISP programming clock (connect to ISP SCK)
MISOISP programming read (connect to ISP MISO)
MOSIISP programming write (connect to ISP MOSI)
RSTISP programming reset (connect to ISP reset output)
RXserial programming receive (connect to TTL UART TX)
TXserial programming transmit (connect to TTL UART RX)
DTRserial programming reset through a 100 nF capacitor (connect to TTL UART DTR)

Todo list

  • CV15, CV16 decoder locking
  • CV65 kick start
  • CV67-94 speed table
  • CV27 automatic brake control
  • function output dimming
  • motor fault check
Comments

No comments yet. Be the first to ask about this board.

Ask about this board

Sign in to BoardRepo

New here? Signing in creates your account; there is no separate sign-up.