# Serial Decoding DCC



## ncrc5315 (Jan 25, 2014)

I have a PicoScope, (www.picotech.com), that I use for work, and one of the features of this oscilloscope, is the ability to decode serial packets, of certain communications protocols. I see that in the latest software update, it will now serial decode DCC packets. The problem is, that it decodes the packets in hex. Anybody, know where I can find out what these packet codes mean? Or, how to interpret them?


----------



## Brakeman Jake (Mar 8, 2009)

Try visiting NMRA's website,under "Standards" the DCC section.You may find what you're asking for or at least understand the language...it's Chinese to me.


----------



## wvgca (Jan 21, 2013)

dcc packet codes are in binary as far as I remember ...
You will have to convert ...
I [think] preamble is something like ten "1" in a row ..if that helps you?


----------



## ncrc5315 (Jan 25, 2014)

Doh, didn't think of the NMRA site.

What I'm used to working with, is RS485, where the Preamble is in hex here is an example of what I would see:

55 - First Header Byte (always 55 for MSTP)
FF - Second Header Byte (always FF for MSTP)
00 - Frame Type - 00 = Token
00 - Destination MAC (MAC Address = Infinet ID)
1B - Source MAC (MAC Address = Infinet ID; in this case = 27)
00 - Length (always 00 for a token)
00 - First byte of checksum
06 - Second byte of checksum

This weekend, I need to download the new software, and try it out, and see what I get. If I get it working, I will try to post some pictures, for kicks and giggles.


----------



## Cycleops (Dec 6, 2014)

I understand different manufacturers decoders value s are different. I know Digitrax work in hex. I have a PDFs of Tsunamis technical reference guide and the bits are shown broken down but I don't know if any others do A similar manual.


----------



## ncrc5315 (Jan 25, 2014)

Cycleops said:


> I understand different manufacturers decoders value s are different. I know Digitrax work in hex. I have a PDFs of Tsunamis technical reference guide and the bits are shown broken down but I don't know if any others do A similar manual.


We may be talking apples and oranges here. I'm refering to packets of information, going between the command station, and the decoder, I think you are refering to the CV values. If following the NMRA standard, for DCC, the packets of information going between command station and decoder, would look the same, regardless of the manufacturer. In other words, the command to turn on the front head light, will be identical for each and every manufacturer.


----------



## Cycleops (Dec 6, 2014)

Shows how much I know!


----------



## mopac (Feb 24, 2011)

Cycleops, You do keep saying that you have to do hex with digitrax. That is just not true.
I have digitrax DCC and all I have to do is hit program button, dial up CV number and
enter the value. No different than your darling NCE system. If I had to know hex I would
never have got digitrax. I know nothing about hex and don't want to. Maybe it was that way 30 years ago I don't know. Digitrax systems are not hard to do or I would be in big
trouble.

I forgot, you do have to hit enter after doing the value.


----------



## Brakeman Jake (Mar 8, 2009)

I suspect it has been done...just in case...Google under "DCC protocol"......


----------



## EMD_GP9 (Jun 19, 2012)

Hi all.
DCC like all digital systems only uses two values, 0 and 1 called BITS or Binary Digits.
The values of the bits are 1, 2 , 4, 8, 16 etc.
Hex is a group of 4 BITS which can represent in binary any value from 0 to 15 which can be described as 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
Groups of more than 4 BITS are grouped together like A5 , or F6 etc to describe the bit pattern in an easier form than just 0s or 1s.
So a Hex number just describes a pattern of bits.
RS485 is a transmission standard which states the voltage requirements to indicate a 0 or 1 and has no standard for what patterns of 0s or 1s that are transmitted.
In my working life I used RS485 in many applications with custom communications protocols ( Bit patterns).
RS422 is another standard and RS232 is what computers used before USB for mice and printers etc.
Hope this helps. Regards, Colin.


----------



## ncrc5315 (Jan 25, 2014)

EMD_GP9 said:


> Hi all.
> DCC like all digital systems only uses two values, 0 and 1 called BITS or Binary Digits.
> The values of the bits are 1, 2 , 4, 8, 16 etc.
> Hex is a group of 4 BITS which can represent in binary any value from 0 to 15 which can be described as 1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.
> ...


You're correct, I should have been more clear, what I'm used to working with, is BACnet, and Modbus on a RS485 MS/TP network.


----------



## EMD_GP9 (Jun 19, 2012)

Thanks ncrc5315.
What I should have added for clarification is that "RS" means "Recommended Standard".
In my working days with industrial "Fieldbus" I often used RS485 which is used for "Profibus" originally designed by Siemens and RS422 which is used with Interbus-S as far as I can remember.
Regards Colin


----------



## gregc (Apr 25, 2015)

ncrc5315 said:


> where I can find out what these packet codes mean? Or, how to interpret them?


See S-9 for the DCC Standards

It looks like S-9.2 and S-9.2.1 should cover the packet format and messages.

rs-485 is typically used for the cab-bus between the controllers and command-station and proprietary. DCC is on the track and implements the above standard.

I'm always surprised when I here people talk about data being in hex, binary or decimal. Is DCC data in time?


----------



## mopac (Feb 24, 2011)

When DCC first came to model railroading it seems like operators did have to do
hex calculations. I know absolutely nothing about hex, but many years ago 
people did have to do calculations rather than just entering a cv value. That would
have kept me from doing DCC.


----------



## Lemonhawk (Sep 24, 2013)

My favorite was split-octal, used in describing 8080 machine language which neatly fit into 3 bit sets. It's still all just binary and now we have calculators that swap back and forth, but it could all be done using paper and pencil. Only conversion to decimal was complicated and required a calculator. Some times you would get really good at doing math in octal or hex, so good one programmer was having great difficulty getting his check book to balance... until he realized he was doing octal arithmetic! The old days of machine language programming....


----------



## ncrc5315 (Jan 25, 2014)

For those that are interested, I have included a picture, of the DCC signal, from my Picoscope, along with the serial decoding. I also included a link to a video that I took of the signal.


----------

