SMA12 - 17 Channel Configurable Multifunction $5 DCC Decoder For Servos
One of my earlier entries: SMA10 – Build a 17-Function DCC Decoder for about $5 ( http://model-railroad-hobbyist.com/node/19070 ) generated a considerable amount of interest regarding the possible enhancement for controlling Servomotors (Servos). This is my next version of a 17 Channel Multifunction DCC Decoder based on a low cost $2.56 Arduino Pro Mini. This version supports configuring each of the 17 function pins for On/Off (LED/TTL) Control, or Configurable Blinking Control, or Configurable Servo Control, or Configurable Pairs Blinking Control. Yes, that does mean it can support 17 servos, each with rate, start point, and end point setting via DCC CV’s, per pin, as well as new LED configurable functions. Read On. Additional doc found here: http://model-railroad-hobbyist.com/node/19775 There is another decoder version added herein. Look for "New Decoder Version to Control Lighting Groups" in Page 12 of the Comments: http://model-railroad-hobbyist.com/node/19446?page=11 The most recent Update can be found here: SMA20 New Low Cost 17 Channel DCC Decoders with PC Boards & Dual Motor, LED, & Servo Control http://model-railroad-hobbyist.com/node/24316
>> Posts index
Navigation
Journals/Blogs
Recent Blog posts:
Comments
CV_DECODER_MASTER_RESET = 120;
@Geoff,
first of all thanks for the mighty DCC source examples. They are really awesome. As a newbie I started with your example of "Production 17 Function DCC Decoder Version 5.4 ". Everything works like a charm. The only problems i have are:
1. after changing a CV and storing a 120 in CV120 the system does not restart
2. I am fully lost in understanding the notifyCVResetFactoryDefault. I don't know how to realise it.
Thanks for a short note.
@Starbug re: CV Master Reset
Hi Starbug (name?),
You are most welcome! I'm glad you find them useful for your modeling.
{CV_MULTIFUNCTION_PRIMARY_ADDRESS, This_Decoder_Address},
{CV_ACCESSORY_DECODER_ADDRESS_MSB, 0},
{CV_MULTIFUNCTION_EXTENDED_ADDRESS_MSB, 0},
{CV_MULTIFUNCTION_EXTENDED_ADDRESS_LSB, 0},
{CV_DECODER_MASTER_RESET, 0},
{30, 5}, //F0 Config 0=On/Off,1=Blink,2=Servo,3=DBL LED Blink,4=Pulsed,5=fade
{31, 1}, //F0 Rate Blink=Eate,PWM=Rate,Servo=Rate
{32, 0}, //F0 Start Position F0=0
// ******** AFTER THE INITIAL DECODER LOAD REMOVE THE "//" IN THE FOOLOWING LINE!!
//#define DECODER_LOADED
If you want to change ALL CV's back to the saved CV's in the FactoryDefaultCVs list, you can load 120 into CV 120, and then power off then on again, and the original CV list will be restored after power up, and CV 120 will be cleared.
Geoff Bunza's Blog Index https://model-railroad-hobbyist.com/node/42392
More Scale Model Animation videos at https://www.youtube.com/user/DrGeoffB
Home Page: https://www.scalemodelanimation.com/
CV Master Reset
@Geoff
Wow !!!! What a fast answer. I am very much obliged to you. Thanks a lot.
My misunderstanding was that i thought writing a 120 to CV120 would automatically reset the system and come up with the newly loaded values. I did not power off and on. Is there no way to update the CVs ? As the reaction on a CV change is not always successful (changing a Blink Rate or Servo Rate) i was thinking of a CV update.
See other thread
There are few steps to do before setting CVs by Ops programming,
Now you can connect it to your DCC buss on the layout and set the CVs by Ops programming and setting CV120 to 120 will reset the CVs to the FactoryDefaultCVs provided in the sketch.
For further help Geoff has already provided a good explanation in the other thread, at least I think so. So go read SMA20 New Low Cost 17 Channel DCC Decoders & Dual Motor,LED, & Servo Control Updated: 6 Ftns/Pin & New Features and scroll down under the first comment to: Decoder CV Configuration Details, and see if that makes sense, and if not ask the question there.
EDIT: fixed link address.
@Starbug re:Changing CV's
Hi Starbug (name?),
The explanation I gave (and which Jim repeated) is for the master reset of all CV's to original programmed values. You should note that you can edit all the values in the list before loading to make them all what you want the "original" CV's to be reset to.
With regard to updating CV's via Ops Mode Programing: the way the decoder works is to copy all CV's into a working list once at power on, and all the functions including servo positions, LED timing, servo rates, etc. are then determined by the working list named ftn_queue[i] with its five elements. The reason for this was that DCC command stations repeat the DCC command packets to decoders an unspecified number of times to guarantee reception by decoders on dirty track. The EEPROM in the Pro Mini chip has a limited lifetime of reads and writes before memory failure (and this is where the CV values are stored to keep them around after power goes off. There is a way to capture the reprogramming of a CV and then reset the decoder operation but with 17 randomly selected functions in the middle of operations, I didn't enjoy the opportunity and complexity to add onto the decoder programming. Also, in a very real way, I didn't have any great need for this myself, nor did I think this was that important.
You can always force the update of all previously Ops mode programmed CV's by hitting reset on the Pro Mini or power cycling (power off then on) the decoder. Address changes to CV 1 will take effect immediately.
Geoff Bunza's Blog Index https://model-railroad-hobbyist.com/node/42392
More Scale Model Animation videos at https://www.youtube.com/user/DrGeoffB
Home Page: https://www.scalemodelanimation.com/
@Jim B the link: SMA20 New
@Jim B
the link: SMA20 New Low Cost 17 Channel DCC Decoders & Dual Motor,LED, & Servo Control Updated: 6 Ftns/Pin & New Features is not working for me. I get a Page not found.
Fixed link
@Starbug, I fixed the link in my original post, had an extra character in the link, but here is the fixed link as well:
SMA20 New Low Cost 17 Channel DCC Decoders & Dual Motor,LED, & Servo Control Updated: 6 Ftns/Pin & New Features
Single Stepper Motor Control
@Geoff
I read in the March 2017 about your Arduino DCC Project 18 and was searching the source of the Dec_Stepper_8Ftn Single Stepper Motor Control Sketch. Is the source available ?
Meanwhile my SMA12 is working like a charm. Thanks again.
Thanks for some help.
@Starbug re:Stepper motor Sketch
Hi Starbug (name?),
I'm really happy to hear things are working well for you!
Geoff Bunza's Blog Index https://model-railroad-hobbyist.com/node/42392
More Scale Model Animation videos at https://www.youtube.com/user/DrGeoffB
Home Page: https://www.scalemodelanimation.com/
servo speed
Hi. I builded decoder using a arduino nano, everything works perfectly (15 servos version)but I tried to change servo rate ( speed) without an a success. In the description you mentioned that a higher value will speed up the servo travel. Could you tell me what is the highest value ( quickest travel speed I can use) or what I am doing wrong. I am complete noob with dcc++ but I am finding the topic very interesting. Thank you for your help