NMRA-DCC mini decoder for model railroad
PIC12CE519

The mini decoder for analog motor is built for: Programmable and readable with DIR, PAG, REG, BIT mode and programming on the main.

Tested with Franken DCC-Zentrale from Oliver Spannekrebs with RKDCC from Rainer Keil and with TMWDCC software
also testet with the TMWDCC project from Lars Lundgren and Intellibox from Uhlenbrock.

List of known problems


The PIC12CE519 has no interrupts and only a 2 step deep stack, therefore I must program in polling mode to decode the DCC signal. One loop needs 25µs. The PWM has 256 speed steps and is 12800µs/78Hz long. It varies because I am using the 1 bit of the DCC signal to calibrate the PIC.

The burned in speed curve for 28 speed steps can build with this EXCEL work sheet and tested with a EPROM-PIC.
On this worksheet you can find the analog spreadsheet and the lin spreadsheet.
With the analog spreadsheet you can define your own speed curve by click and move in the graphic and then copy the yellow marked cells colum H-K via clipboard and paste in case of the SPDTAB subroutine in the *.asm file.
The lin worksheet is for people who are familiar with EXCEL and is for experience modifying curve by calculating (I don't describe this worksheet - test it)

The PIC12CE519 has a 16 byte build in EEPROM, so the configuration variables can be changed.



Based on PIC12C509 I have built a switching decoder for pointing devices. For me the code for the PIC-processors was simple and easy to learn. Then I build a decoder for stepper motor and also for analog motor.

I am using MPLAB as programming environment.

I want to build 4 versions as mini decoder: This programs are in build construction, if you want more information please mail.

Source of supply: Electronic parts or complete sets of decoder you can order from Andreas Bergmann or Joachim Katzer (Web).