Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document CV29 output/board addressing mode #31

Closed
chrisridd opened this issue Dec 14, 2019 · 8 comments
Closed

Document CV29 output/board addressing mode #31

chrisridd opened this issue Dec 14, 2019 · 8 comments

Comments

@chrisridd
Copy link

Your extension to CV29 could be better documented!

As far as I can see it just changes two things:

  1. The way the accessory address is computed
  2. Which accessory callback is used i.e. notifyDccAccTurnoutBoard or notifyDccAccTurnoutOutput

Neither of which is very clear - which mode should an accessory implementor use and why?

@MicroBahner
Copy link
Contributor

MicroBahner commented Dec 14, 2019

Well. I don't see any 'extension' to CV29. The meaning of the bits in CV29 is well documented in the Nmra papers. Bit 6 defines whether the decoder uses board adressing or output adressing. And the corresponding callback is used when an accessory packet is received.

Edit: If you implement an accessory decoder and use one of the addressingmodes exclusively you should inhibit changing of bit 6 in CV29.

Regards
Franz-Peter

@gbglacier
Copy link
Contributor

gbglacier commented Dec 21, 2019 via email

@MicroBahner
Copy link
Contributor

Hi Geoff,
the definitions you posted are the definitions for a multifunction (=locomotiv) decoder. This issue is about an accessory decoder. The meaning of the bits in CV29 ist different between these types of decoders. The meaning of the bits for an accessory decoder is defined later in that paper at pages 10/11:

Configuration Variable 29 [541] Accessory Decoder Configurations Supported
Bits 0-2 = Reserved for future use.
Bit 3 = Bi-Directional Communications: "0" = Bi-Directional Communications disabled, "1" = Bi-Directional
425 Communications enabled. See S-9.3.2 for more information.`
Bit 4 = Reserved for future use.S-9.2.2
Copyright 1999-2012 by National Model Railroad Association, Inc. Page 11 of 12
Bit 5 = Decoder Type: ‘0’ = Basic Accessory Decoder; ‘1’ = Extended Accessory Decoder
Bit 6 = Addressing Method: ‘0’= Decoder Address method; ‘1’ = Output Address method
Bit 7 = Accessory Decoder: = "0" Multifunction Decoder (See CV-29 for description of bit Assignments for bits
430 0-6), "1" = Accessory Decoder. If bit 7 = 1, then the decoder may ignore the two most-significant
bits of the CV number in Service Mode only. Using this feature CV513 becomes CV1, etc.
Decoders which perform the translation must clearly

There you can see that Bit 6 defines the adressing method.
Regards
Franz-Peter

@gbglacier
Copy link
Contributor

gbglacier commented Dec 21, 2019 via email

@MicroBahner
Copy link
Contributor

Hi Geoff,
yes, I think we're not going to change this behavior of the library. When initializing the library you can set the default adressing mode as you want. If you don't want it to be changed later, you have to inhibit changing the bit in CV29. That must be done in the sketch.

As I understood, the question in this issue was about a better documentation. But the library complies with the standard - also in this respect. I have therefore pointed out that it is not an extension. In my opinion we cannot describe the standards in the library documentation.

Best regards
Franz-Peter

@chrisridd
Copy link
Author

Like Geoff, I'd only found the definition for CV 29 for locomotive decoders - but now I can see the different CV 29 definitions for accessory decoders I concur that this library's use of bit 6 is quite standard and correct and does not need changing.

However I still do not understand what the mode actually means, which was my main question. Do you have a reference to the NMRA docs that explains it?

@MicroBahner
Copy link
Contributor

MicroBahner commented Dec 22, 2019

Hi,
The difference between output addressing and decoder addressing is described in the same NMRA document (9.2.2). This can be found in the description of the CV's 513 and 521 which define the decoder address (on pages 9/10). But in my opinion the description is a little bit hard to understand..
A graphic, which should make things clearer, can be found here (its on a german website).

Decoder addressing is rather historical. It is based on the first decoders, which could always control 4 turnouts. The decoder was addressed via the 'main address', and the turnouts via a sub-address(0..3). Such decoders still exist.
Output adressing combines both addresses into one accessory-address, and the turnouts/signals are numbered continuously. The decoder itself has no address. This is more flexible. A decoder can control an arbitrary number of accessories. The address in CV513/521(1/9) is usually the address of the first controlled accessory in the line.

@kiwi64ajs
Copy link
Contributor

I don't think there is an issue here apart from the DCC Standards being not precise enough, but I believe the code is doing the right things in terms of handling the Output Addressing Mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants