Well, I didn’t like some things about the DCC output state machine in the last post, the one with the (wrong) zero bit on the end so I refactored it and now it works mucho better. I took the background scan timer down to nothing so it would spit out DCC as fast as possible, this is the trace. The top trace is the rebuilt DCC, the bottom is the output of the Prodigy with just the default 003 loco address, albeit set to 128 step mode. Aside from the lesser number of preamble bits I’m sending they are the same, well within a microsecond or two. I am running this on an Attiny1634R-SU which is the 2% clock. Costs a few pennies more but worth it over the regular vanilla chip which is 10%, a bit loose.
I think the diagram in the last post caused a bit of confusion. Suffice to say I am just breaking apart the components of DCC and the subsequent ‘decoders’. I find the term ‘decoder’ somewhat problematic, I would refer to them as ‘clients’ with the DCC ‘booster’ or ‘cab’ as the ‘master’.
Anyhow, one of the things I do not like about DCC is the power aspect. DCC is sort of a bastard child of both power and data packets which makes messing with it more difficult. I realize that is really important when you carry power on the track but I don’t want to do that. I want the compatibility with DCC accessories and JMRI but I want to run battery power (or maybe steam one day) So I am chopping the power part out and siphoning off the data packets, sending the data out via xbee and rebuilding them on the client. The client takes the battery power, injects that into the data part and out comes DCC. I don’t need much in the locomotive that requires DCC per se, except possibly sound but I am interested in choosing routes via something (JMRI?) and setting turnouts (accessory decoders?) and signals and things like that too so I want all this to work.
Oh yeah, another aspect of DCC I’m finding I don’t like is the slam-bam sort of thing. Well, ‘not like it’ is relative I suppose, it’s probably the easiest one and most ‘organic’ of the protocols. Constantly send everything as fast as possible and you are at least sure some are getting there, right? So I’ve also, sort of, modified this at least over the air. This keeps network traffic low. I currently have only one priority queue in the master, I think I may have to expand this to two later one. A ‘hi’ priority for the locomotive situations and a ‘low’ for other things? Dunno yet.