Hey everyone,
I need some advice on where to start my little project and would be greatly appreciative if you could help point me in the right direction. I realize that people have done work in this area before, but I have two issues with that.
The first is that I use a competing digital system, where as the most common information is for DCC, my system is Marklin's digital system (They do support DCC, yes, but a lot of my current decoders are Marklin's format and so I'm not keen on spending the cash to displace those for newer DCC models). The second issue is that a lot of the work has already been done, but isn't explained. I want to know how it works. And so that's the difficulty I'm facing. I'm not really sure where to look for information to learn more about how to interface with a digital system like this. I can find information on the digital protocols, but don't know where to go to learn about how to read that in to the Arduino and how to handle it. I think that's the key point for me.
I've done programming before, to some small extent. I built a train controller application for a touchpad (For a dcc system), but it used a library that I had found on the internet, so I didn't really gain knowledge in the way of interfacing with the system I was using. That work had been done for me, essentially.
I was thinking perhaps I could start by looking at some of the work people have done on the dcc side, like this, http://www.mynabay.com/arduino/2-uncategorised/14-arduino-dcc-monitor , but my issue with this is that he shows how to put it together, throws some code at you, but it's not really explained. The what/where/why. And this is what I find frustrating about some of this stuff. It's a lot of do this, but they don't explain why we're doing that. I did get the parts I'd need though, so at the least I can play with it and see if I can make sense of it. I've looked over the code some, but since it's a little advanced compared to what I know now, I don't really know how to hack it for my needs. I get parts of it, but not the important parts.
I did find one fella that did an accessory decoder for the Marklin system, but his code is written out in C and is flashed to the chip rather than using Arduino's IDE (Or rather, it's a similar microchip, but it isn't Arduino?) I'm not really sure how to translate that information. Maybe that'd be a better place to start? I don't know. GitHub - daspilker/uncoupler-decoder-firmware: Contains the source code of the firmware for an decoder for the Märklin Digital system.
I did consider another approach. Marklin's CS2 broadcast it's message over the network, over UDP. It uses CAN-Bus. I'd like to learn about this too, but I don't know if this is the right group to ask about that. The basic idea is that I could have a program listening in on a computer and then send commands to a Arduino via wireless, or something. There are other reasons I'd like to learn about this too (so I can adjust my existing program to work with Marklin's system). If anyone would have information about how to interface with a CAN-Bus over UDP using C#? I've heard one guy say it was easy, but he never gave any details.
This all might be over my head. I don't know. You guys know a lot more than I do, and so that's why I'm coming to you for advice. I have this basic knowledge, but this is getting into a few areas that are a little beyond what I've learned. I'm going at this alone too, so I don't really know where to look for information, or what the keywords are to find the information I am looking for. What I want to do seems basic in theory, but in practice it seems a little more advanced for a noob. To take in a digital signal, a packet, and interrupt it.
My end goal here is to build an accessory decoder based around the setup that was shown in the first link I posted, the dcc monitor, and to use that to switch things, whatever tickles my fancy. Lights, switches, track power, signals, whatever. My big issue is that it's DCC and I'd like it to play with Marklin's Motorola protocol.
Thanks in advance to anyone that can help. I've looked around a lot, but feel like I've exhausted what I can do/find.