Login
Register
Forum
Help
JNSwiki
May 24, 2012, 04:59:25 am
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Entire Site
Entire Forum
This board
This topic
Members
Search for
Japanese Modelling & Japan Rail Enthusiasts Forum
>
Forum
>
Platform 4 - (The Dark Side of) Modeling
>
DCC and Electrical
> Topic:
Need help debugging Arduino Command Station
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Need help debugging Arduino Command Station (Read 1329 times)
0 Members and 1 Guest are viewing this topic.
CaptOblivious
Philosopher-Engineer
Administrator
Offline
485系「あいづライナー」
Need help debugging Arduino Command Station
«
on:
December 11, 2010, 08:40:28 pm »
I wonder if anyone else here has an Arduino and a spare DCC booster and would be willing to help me out a bit? I've got some preliminary code for generating DCC waveforms on my Arduino, but it isn't working and I can't tell why. The waveform itself looks correct, and as near as I can tell, it's transmitting legal packets, but my loco isn't moving and I can't tell why. Could someone have a look and perhaps help me see where I've gone wrong?
http://devices.artificial-science.org/2010/12/10/dcc-waveform-generation-arduino-sketch-v-1/
Logged
A miniature slice of geekdom,
Akihabara Station
inobu
Offline
Re: Need help debugging Arduino Command Station
«
Reply #1 on:
December 11, 2010, 10:17:55 pm »
Don,
Your best bet is to get a DCC packet sniffer so you can see and interpret the data.
http://www.opendcc.de/elektronik/dcc_sniffer/sniffer_sw_e.html
NCE has one you can buy.
Trying to translate HEX is going to be a challenge.
Inobu
Logged
CaptOblivious
Philosopher-Engineer
Administrator
Offline
485系「あいづライナー」
Re: Need help debugging Arduino Command Station
«
Reply #2 on:
December 12, 2010, 12:31:41 am »
Inobu,
Thanks, I'd thought about bgetting one of those, but they're a bit more than I can afford right now. I am getting a 16-channel logic probe for Christmas that would work as well: I'm quite comfortable staring at raw binary or hex (I don't even see the code any more. All I see is: F7 here, DD51 there...). I just didn't want to have to wait that long, esp if the solution is obvious to someone else ;)
Logged
A miniature slice of geekdom,
Akihabara Station
Martijn Meerts
Administrator
Offline
Gender:
Re: Need help debugging Arduino Command Station
«
Reply #3 on:
December 12, 2010, 11:43:39 am »
I'm so used to Objective-C by now, that the code you've got seems totally weird =)
Logged
Mixed Japanese N-scale:
http://www.jr-chiisai.net
Era III German 0-scale:
http://blackforest.jr-chiisai.net
CaptOblivious
Philosopher-Engineer
Administrator
Offline
485系「あいづライナー」
Re: Need help debugging Arduino Command Station
«
Reply #4 on:
December 13, 2010, 04:23:35 pm »
A fellow on the OpenLCB mailing list found the bug for me; it was a pretty silly mistake, as I expected. Fresh, working code will be posted to my blog later today.
Logged
A miniature slice of geekdom,
Akihabara Station
stevenh
Tetsudo Staff
Offline
Gender:
Re: Need help debugging Arduino Command Station
«
Reply #5 on:
December 13, 2010, 10:16:51 pm »
Don't leave us hanging :) What was the reason?
Meanwhile, I've wanted to tinker with DCC and the Arduino for a while (I even have decoders floating around my proto-layout), but I just haven't found the motivation to hack up another locomotive... all my DCC-enabled jobs are back in another part of the country.
Logged
Steven Hoefel.
Model Railroading/DCC Blog/Japanese trains
CaptOblivious
Philosopher-Engineer
Administrator
Offline
485系「あいづライナー」
Re: Need help debugging Arduino Command Station
«
Reply #6 on:
December 13, 2010, 10:41:26 pm »
The error was this:
Because the two halves of a zero-bit can be of different lengths (to enable "stretched-zero" DC operation), I check to see if, first, the interrupt was called for the /first/ half of the bit, and if the bit is currently a zero; in which case I switch the zero counter. I had only intended to do any other processing during the /second/ half of the bit, but because of the structure of the conditional statement, I was doing all other processing twice over, once at the first half (but only if the current bit is a '1'), and once at the second half. Which meant that every other '1' bit was effectively disappearing into the void, instead of appearing on the rails. D'oh!
Working up a full-fledged command station Arduino library now; I hope to have a preliminary working version up by week's end.
Logged
A miniature slice of geekdom,
Akihabara Station
stevenh
Tetsudo Staff
Offline
Gender:
Re: Need help debugging Arduino Command Station
«
Reply #7 on:
December 14, 2010, 12:13:34 am »
Is the Arduino to have a myriad of inputs/buttons/switches/rotary-switches/potentiometers/LCDs/force-feedback/realistic-throttle-handles or will a computer program/RS232 control it?
Logged
Steven Hoefel.
Model Railroading/DCC Blog/Japanese trains
CaptOblivious
Philosopher-Engineer
Administrator
Offline
485系「あいづライナー」
Re: Need help debugging Arduino Command Station
«
Reply #8 on:
December 14, 2010, 03:05:26 am »
Steven,
None of the above. I might have a pot and a couple of buttons, maybe, just for testing. But the code I'm writing is supposed to only generate the DCC signal from commands received—where those commands come from is immaterial. So you could use this library to build a Zephyr-alike, a computer interface, or whatever. I intend to take it in the direction of working with OpenLCB, as the OpenLCB project doesn't have a command station yet. Or a cab<->CS protocol.
Logged
A miniature slice of geekdom,
Akihabara Station
CaptOblivious
Philosopher-Engineer
Administrator
Offline
485系「あいづライナー」
Re: Need help debugging Arduino Command Station
«
Reply #9 on:
December 18, 2010, 04:09:21 pm »
Update, looking for folks interested in contributing to my new software project:
https://github.com/Railstars/CmdrArduino
http://devices.artificial-science.org/2010/12/18/introducing-cmdrarduino-a-library-for-building-dcc-command-stations-with-arduino/
Logged
A miniature slice of geekdom,
Akihabara Station
CaptOblivious
Philosopher-Engineer
Administrator
Offline
485系「あいづライナー」
Re: Need help debugging Arduino Command Station
«
Reply #10 on:
December 27, 2010, 09:15:46 pm »
The software is alive! I just drove my EF65 back and forth and worked its headlights using only my Arduino and a booster. I've put up a new page to track progress on the library:
http://devices.artificial-science.org/cmdrarduino/
Logged
A miniature slice of geekdom,
Akihabara Station
KenS
Offline
Gender:
Re: Need help debugging Arduino Command Station
«
Reply #11 on:
December 28, 2010, 05:39:03 am »
Now that's an accomplishment. Congratulations.
Logged
Sumida Crossing
An N-Scale Japanese-Themed Urban Railroad
Pages: [
1
]
Go Up
Print
Japanese Modelling & Japan Rail Enthusiasts Forum
>
Forum
>
Platform 4 - (The Dark Side of) Modeling
>
DCC and Electrical
> Topic:
Need help debugging Arduino Command Station
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Platform 1 - Birth and Death of a Forum
-----------------------------
=> Welcome Guest!
=> Welcome
=> Forum Announcements
=> The Agora, General Administrative Discussions
-----------------------------
Platform 2 - Japanese Model Railroading
-----------------------------
=> N Gauge
=> Other Gauges and Scales
=> Trams and Trolleys
-----------------------------
Platform 3 - Products and Retailers
-----------------------------
=> New Releases and product Announcements
=> Suppliers
=> Hobby Shops - Where are they?
-----------------------------
Platform 4 - (The Dark Side of) Modeling
-----------------------------
=> The Train Doktor
=> DCC and Electrical
=> Layout Computer Control & Automation
=> The Tool Shed
=> Scenery
-----------------------------
Platform 5 - Layouts, Clubs and Projects
-----------------------------
=> Personal Projects
=> Club News
=> Archived Project Parties
===> September 2009 Project Party
===> Summer 2010 Project Party
===> Summer 2011 Project Party
-----------------------------
Platform 6 - Japan and Japan Rail
-----------------------------
=> Japan Rail, news and announcements
=> Prototypes, pictures and videos
=> Japan, travel tips and memories
-----------------------------
Platform 7 - International Modelling and Railroading
-----------------------------
=> Non-Japanese Modelling
=> Non-Japanese Prototypes
=> Non-Japanese Travelling
-----------------------------
Platform 8 - Other Destinations and Hobbies
-----------------------------
=> Train Related Software, Games and Simulations
=> Other Hobbies
=> Off Topic
TinyPortal v.1.0.6 beta 2 ©
Bloc
Problems? Simply email "help" at "jnsforum" dot "com"!
Loading...