reprogram DCC decoder v2

Use this forum to discuss our various DCC decoders.
Post Reply
colin.christian
Posts: 4
Joined: Fri Nov 29, 2024 2:34 am

reprogram DCC decoder v2

Post by colin.christian »

I am awaiting delivery of 2 decoder and an iProbe
My question really is what is the best way to reprogram the decoder to change loco number and other CVs , thinking of lights and possible other functions.
I am guessing some additional code would be required for the functions to work.
I have put together a decoder based on the original circuit with a Raspi Pico board as the processor. Obviously this is easy to reprogram via the USB , I did manage to change the loco number (CV1) using JMRI. although this did produce an error as there is no provision on the hardware to acknowledge the programmer.
So back to the main question:
to change CVs do I change the CV.h file and recompile and download the new soft/firmware to the decoder or is there a cleverer way to do it?

any comments or recommendations welcomed

Colin
Pontus
Site Admin
Posts: 49
Joined: Wed May 22, 2024 10:06 pm
Location: Östra Ingelstad
Contact:

Re: reprogram DCC decoder v2

Post by Pontus »

Hi Colin,

Changing CV's can easily be done through JMRI. You need to have a motor connected to the decoder though as this is used in the circuitry generating feedback from the decoder. If no motor is connected you will get the error that you see.

You do not need to reflash the unit just for programming CV's.

But if you want to change the default setting for a particular CV you need to change the value in CV.h and recompile the firmware. This will ensure that the new value is loaded into the CV file when a DCC reset is performed by writing 8 to CV 8.
colin.christian
Posts: 4
Joined: Fri Nov 29, 2024 2:34 am

Re: reprogram DCC decoder v2

Post by colin.christian »

Hi
thanks for the info.
decoders just arrived so will start to experiment soon
regards
Colin
Ps
Just got it hooked up to a little can motor - works a treat, managed to change loco address so far
have now read all CVs and can write back new ones
really impressed with this nice little machine
I hadn't released how the decoder responded to requests etc - i was confused with Xpressnet which I have been playing with
my aim is to set up a bluetooth control something like hornby that is why I have been playing with raspy pico-w with the ble addition
Anyway all good fun and much intriguing
sonny
Posts: 1
Joined: Tue Oct 15, 2024 4:09 am

Re: reprogram DCC decoder v2

Post by sonny »

Hi Collin,

I agree that these decoders are great to use, if you are interested with pico w, I have some ble demo using this board as function decoder, I strip the source code for my own purpose and make it easier for me to understand. Youtube link below for the function decoder demo and also link for my other ble dcc demo. Hope this helps. I have used the version 1 of this decoder for several of my trains and they work excellent. Most of my youtube demo has the source code in the description. I also on order version 2 of this board. Hope this helps.

youtube function decoder demo https://www.youtube.com/watch?v=4MvgJCYxS-U

my youtube channel lots of dcc demos https://www.youtube.com/@sonnybalut

github https://github.com/sonnny?tab=repositories

source codes https://pinoysa.us/codes/

Sonny
colin.christian
Posts: 4
Joined: Fri Nov 29, 2024 2:34 am

Re: reprogram DCC decoder v2

Post by colin.christian »

Hi Sonny
thanks for the info - I do think Ble is the way to go so will investigate
By the way do you know which is the latest code for the decoder V2
I am using the code from: https://github.com/PontusO/RP2040-Decoder

just wondering if that is correct

best regards

Colin
Pontus
Site Admin
Posts: 49
Joined: Wed May 22, 2024 10:06 pm
Location: Östra Ingelstad
Contact:

Re: reprogram DCC decoder v2

Post by Pontus »

Hi, yes that is the correct repo (I am PontusO =).

With regards to a BLE DCC decoder I am playing around with this in our lab.
Image

It is an ESP32C3 based decoder with an external I/O processor for handling lighting and effects. We have prototypes available if anyone is interested in taking a stab at it.
colin.christian
Posts: 4
Joined: Fri Nov 29, 2024 2:34 am

Re: reprogram DCC decoder v2

Post by colin.christian »

Hi PontusO
Thanks for confirming that - I am feeling brave and soon to play around modifications and reprogramming so wish me luck
I have found the decoder to be really good and even works with some very old open frame motors which a lot of decoders will not do

The Ble does look interesting and I would be keen to try one out when ready
I do have a Ble transmitter and receiver pair working based on Pico boards. So I have a throttle and motor driver working. It doesn't hook into DCC, but just uses DCC as a power source - seems to work ok, but yours would be much cleverer as it uses the DCC as well

once again thanks for info

regards

Colin
Post Reply