12 pre-configured decoder variations —10 reconfigurable per pin
Hopefully (for me) this will be the last release (for a while) of this decoder series. The original details can be found here: https://forum.mrhmag.com/post/sma12-17-channel-configurable-multifunction-5-dcc-decoder-for-servos-12198051 ), and an update here: https://forum.mrhmag.com/post/sma-13-update-to-the-17-pin-configurable-multi-function-decoder-accessory-decoder-version-added-12198262 . This is a good example of why a modeler might get interested in using the cheap Arduino Pro Mini’s—with NO change in the hardware, you can make many interesting variations to suit your modeling needs. This project(s) has taken me beyond where I originally wanted to go. The great interest on the part of many modelers all over the world has spurred this work on, rather than leave the many, great, suggested changes as “an exercise to the reader!”
What is new here is a slightly different kind of Accessory decoder that you can also access as a “mobile” or “multifunction” decoder so you can configure the functions at each pin, but as an accessory decoder these will respond to DCC Switch commands not DCC Function set commands. You have six of each provided, preconfigured. This is not an original idea, just a little different one.
The new libraries and examples can be downloaded from here: http://mrhpub.com/files/users/geoffbfiles/new-dual-multifunction-decoderv5_4.zip
and are also be made available on the Model Railroading with Arduino website: http://mrrwa.org/
(If you download from http://mrrwa.org/ make sure the file date is after Dec. 21, 2014).
Installation is the same as described previously. Delete your previous version and simply replace it with the new NMRADcc folder (Old examples will not necessarily work with this edition).
There are 12 preconfigured Decoders in the examples ready to roll:
Mobile/Multifunction Decoders: Accessory Decoders w/Dual Addresses for CV Programming:
Decoder_15_Servos_1LED_4Function AccessoryDecoder_15Servos_2LED_4Function
Decoder_13Serv_4LED_4Function AccessoryDecoder_13Servos_4LED_4Function
Decoder_10Serv_7LED_4Function AccessoryDecoder_10Servos_7LED_4Function
Decoder_7Servos_10LED_4Function AccessoryDecoder_7Servos_10LED_4Function
Decoder_17LED_4Function AccessoryDecoder_17LED_4Function
These 2 Configurations are simpler LED drive per pin only:
Decoder_17LED_1Function AceesoryDecoder_17LED_1Function
The servos are preconfigured on the lower numbers of pin, contiguously, followed by the “LED” drivers. The name of the files says it all, so pay attention. Remember you can set each pin to do to what function you would like, including a 19 servo driver. Load them into your Pro Mini and you are good to go! If you haven’t read the earlier entries in the series, they will tell you how to build and load the Arduino Pro Mini (which when last I checked were still going for $2.25 quantity one -- http://www.ebay.com/itm/230795578198 ).
Included below is a brief description of a detailed working example for a 7 servo 10 LED configuration that may help people configure their own versions for their particular modeling needs. Before changing the CV settings take a look at the initial settings and make small changes first to observe the effects. This should give modelers a starting point, and a better understanding for customizing their decoders.
I doubt very much that I would have pursued all these variations, especially the accessory decoder variants, without the interest and enthusiasm shown by scores of modelers, literally, around the world. To all of you—many sincere thanks! And special thanks to Alex Shepherd for his work on the original NMRADcc library!
One last thing, for those with DC layouts I will soon release a low cost, fascia panel, pushbutton operated servo/switch controller for turnout operation via servos. No commitment yet for ETA though!
Comments and appropriate suggestions are always encouraged.
Have Fun. Best regards, and Merry Christmas,
Geoff Bunza
Decoder Configuration Details
The multfunction decoder examples all for 4 functions to be assigned to any of the 17 available pins: on/off control, single line blinking with variable rate, servo control with start position/stop position/transit rate CV setting and end to end control via the function (on/off), and paired line blinking with variable rate.
When first loaded the decoder is set to short DCC Mobile address 24 and/or Acecessory decoder address 40. The decoder can be reset to the original parameters by loading CV 120 with 120 (decimal). This will reset everything including the decoder address, when the pushbutton on the Pro Mini is pushed (reset) or by powering the decoder off then on. You will know when the default CV setting are being reset as the decoder will flash Digital Pin 14 (A0) for one second. The multifunction decoder address can be changed to another short DCC address by changing CV 1. The accessory decoders have 2 addresses: the Accessory range start Address is in CV1 and the multifunction address (with which you can program CV's for the Accessory decoder functions) in CV 121 and 122
The 7 Servo 10 LED decoder configuration
Arduino Pro Mini Pins are set as follows: 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
Pro Mini Pin Function
3 F0 Servo
4 F1 Servo
5 F2 Servo
6 F3 Servo
7 F4 Servo
8 F5 Servo
9 F6 Servo
10 F7 Single LED Blink
11 F8 Single LED Blink
12 F9 Single LED On/Off
13 F10 Single LED On/Off
14 F11 Single LED Blink
15 F12 Single LED Blink
16 F13 Double LED Blink F13 and F14 LEDs (Pins 16 & 17)
17 F14 Single LED Blink (Ignored because of F13)
18 F15 Double LED Blink F15 and F16 LEDs (Pins 18 & 19)
19 F16 Single LED Blink (Ignored because of F15)
(Blink rates are set differently for demonstration purposes)
Correspondingly, for the 7 Servo 10 LED decoder configuration, CV’s are initially set to the following:
{CV number, Value} Description
{1, 24} Decoder Initial Address
{30, 2}, //F0 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{31, 1}, //F0 Rate Blink=Eate,PWM=Rate,Servo=Rate
{32, 28}, //F0 Start Position F0=0
{33, 140}, //F0 End Position F0=1
{34, 28}, //F0 Current Position
{35, 2}, //F1 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{36, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{37, 28}, // Start Position Fx=0
{38, 140}, // End Position Fx=1
{39, 28}, // Current Position
{40, 2}, //F2 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{41, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{42, 28}, // Start Position Fx=0
{43, 140}, // End Position Fx=1
{44, 28}, // Current Position
{45, 2}, //F3 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{46, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{47, 28}, // Start Position Fx=0
{48, 140}, // End Position Fx=1
{49, 28}, // Current Position
{50, 2}, //F4 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{51, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{52, 28}, // Start Position Fx=0
{53, 140}, // End Position Fx=1
{54, 28}, // Current Position
{55, 2}, //F5 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{56, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{57, 28}, // Start Position Fx=0
{58, 140}, // End Position Fx=1
{59, 28}, // Current Position
{60, 2}, //F6 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{61, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{62, 28}, // Start Position Fx=0
{63, 140}, // End Position Fx=1
{64, 28}, // Current Position
{65, 1}, //F7 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{66, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{67, 1}, // Start Position Fx=0
{68,35}, // End Position Fx=1
{69, 1}, // Current Position
{70, 1}, //F8 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{71, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{72, 1}, // Start Position Fx=0
{73, 100}, // End Position Fx=1
{74, 1}, // Current Position
{75, 0}, //F9 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{76, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{77, 1}, // Start Position Fx=0
{78, 10}, // End Position Fx=1
{79, 1}, // Current Position
{80, 0}, //F10 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{81, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{82, 1}, // Start Position Fx=0
{83, 5}, // End Position Fx=1
{84, 1}, // Current Position
{85, 1}, //F11 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{86, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{87, 1}, // Start Position Fx=0
{88, 5}, // End Position Fx=1
{89, 1}, // Current Position
{90, 1}, //F12 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{91, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{92, 1}, // Start Position Fx=0
{93, 20}, // End Position Fx=1
{94, 1}, // Current Position
{95, 3}, //F13 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{96, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{97, 1}, // Start Position Fx=0
{98, 35}, // End Position Fx=1
{99, 2}, // Current Position
{100, 0}, //F14 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{101, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{102, 1}, // Start Position Fx=0
{103, 4}, // End Position Fx=1
{104, 1}, // Current Position
{105, 3}, //F15 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{106, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{107, 1}, // Start Position Fx=0
{108, 60}, // End Position Fx=1
{109, 20}, // Current Position
{110, 0}, //F16 Config 0=On/Off,1=Blink,2=Servo,3=Double LED Blink
{111, 1}, // Rate Blink=Eate,PWM=Rate,Servo=Rate
{112, 1}, // Start Position Fx=0
{113, 4}, // End Position Fx=1
{114, 1}, // Current Position
{120, 0} Master Reset CV When set to 120 and Power cycled resets all CV’s
Each Function is controlled by a maximum of 5 CV’s.
For example F0 is initially set for servo control:
{30, 2}, // F0 Pin Function Configuration 2=Servo
{31, 1}, // F0 Rate Blink=Rate, Servo=Rate
{32, 28}, // F0 Start Position F0=0 Initially 26
{33, 140}, // F0 End Position F0=1 Initially 140
{34, 28}, // F0 Current Position or State
F7 is initially set for single LED blinking control:
{65, 1}, // F7 Pin Function Configuration 1=Blink
{66, 1}, // Rate Blink 1= Slowest
{67, 1}, // Start Count Set to 1 or 0
{68,35}, // End Count 2-255 -- 255 = Slow Blink
{69, 1}, // Current State of LED
F13 is initially set for double LED blinking control of F13 and F14 LED Pins:
{95, 3}, // F13 Pin Function Configuration 3=Double LED Blink
{96, 1}, // Rate Blink 1= Slowest
{97, 1}, // Start Count Set to 1 or 0
{98, 35}, // End Count 2-255 -- 255 = Slow Blink
{99, 2}, // Current State of LED
F9 is initially set for single LED On/Off control:
{75, 0}, // F9 Pin Function Configuration 0=On/Off
{76, 1}, // Ignored
{77, 1}, // Ignored
{78, 10}, // Ignored
{79, 1}, // Ignored