I’ve started down yet another road, this is something I was doing a couple of years ago back when I first started putting R/C into trains. But after getting my DCC output code working, I decided to revisit this and try something different.
What I’m doing is taking the R/C servo output, which is a pulse that varies between 1000 uS and 2000 uS, and using that to send DCC messages to a DCC sound decoder. In this case an Econami Diesel decoder I picked up at the local hobby shop. I’ve got the firmware up and running and everything working, some details are here:
For now, I’m just taking the pulse width and turning that into DCC throttle outputs. As you increase the servo throw, the notches go up on the sound. But there is no reason I can’t take specific pulse widths and turn them into discrete DCC commands.
Next step is to refactor the output stage, I’m currently using an expensive motor driver so I need a new design there. But all the code fits into an 8 pin Attiny85 so I should be able to shrink it down pretty far.
After that, the base firmware needs a bit of refactoring so this can be setup external to the device rather than it all be hardcoded. But anyhow, just throwing it out here if anyone is interested…