GP2X Model Railway Dcc Throttle


palloyd-jones

Still Fresh
Joined
Oct 13, 2006
Messages
6
Hi

Newbie here - I am thinking of making a DCC throttle. Has any one done it yet? One problem will be directing output to the serial port. Will that he difficult?

Thanks

Peter
 
Peter L-J posted on Oct 17 2006 at 09:18 AM said:
Hi

Newbie here - I am thinking of making a DCC throttle. Has any one done it yet? One problem will be directing output to the serial port. Will that he difficult?

Thanks

Peter

Yeah Trains!
Well the GP2X is mini PC. First you will need somthing to convert the rs232 signal to the correct levels. There are a couple ways to do it.
1. Get a prebuilt samsung cable (this is in the wiki
2. Use BOB
3. Build your own cable (circuit drawing is on wiki)

EDIT - You dont have to do the above if your going straight to micro. In the end just make the levels are the same.

The next problem you will have is the DCC signal. Do you have DCC controller that your currently controling it with? Basically the DCC supplies the power and the signal to the train, and its not the same wavform as DCC.
I think to get this to work you need something to generate the DCC and you use the serial to talk to that device to encode your speed.

Its been a little while since I looked DCC stuff, i ended up getting the fairly new bachmann DCC controller. Its pretty cheap and works pretty good.
 
Last edited by a moderator:
i just noticed this is in the gp32 section, sorry my idea above was with the Gp2x in mind.

http://home.cogeco.ca/~rpaisley4/DCCvolts.html

Check out this site, it has a ciruit you can use to generate the waveform and still supply power. You can see the input for the 0-5v signal, which could be your serial signal.
I do not have a gp32 to know how or if you can get a serial line off it.
 
Thanks Pickle

Yes you have hit the mail on the head.I have a (purchased) computer interface which sits between my Linux computer and my DCC command station (It alters the normal serial out put into stuff the command Station understands).One only has to direct a stream of ASCI to the serial port. From my computer I can do all Sorts of magic things on the layout.

It runs JMRI which uses Java. Unfortunately the code uses Swing a lot which I understand is not supported by our machine so I suppose I will be looking at Python.

I have purchased the BOB

And I should have put this in the GP 2X area _ indeed I thought I had. !!

Peter
 
Peter L-J posted on Oct 17 2006 at 10:58 AM said:
Thanks Pickle

Yes you have hit the mail on the head.I have a (purchased) computer interface which sits between my Linux computer and my DCC command station (It alters the normal serial out put into stuff the command Station understands).One only has to direct a stream of ASCI to the serial port. From my computer I can do all Sorts of magic things on the layout.

It runs JMRI which uses Java. Unfortunately the code uses Swing a lot which I understand is not supported by our machine so I suppose I will be looking at Python.

I have purchased the BOB

And I should have put this in the GP 2X area _ indeed I thought I had. !!

Peter

Another thing you should know is the GP2X dumps data onto the serial line as well. Most comes out on boot. You may have a situation where the gp2x just happens to send a command.

I assume your trying to port the Java app? Is the Java yours, come with the DCC controller, or an open source project (just curious)?
You dont nessecarily have to use Python. Serial of your is standard and the gui could be done through SDL. But its whatever your comfortable with.
 
Last edited by a moderator:
If you have a breakout board, you might consider just buying a USB<->Serial adapter - this will solve both the gp2x sending console text to the output, as well as giving you a standard +-12V serial port voltage, which may be easier to interface depending what you connect it to.

The only issue is making sure there's a driver for it, but I doubt it would be hard for one of the devs to put one on the filesharing if there isn't already one built in.
 
BradN posted on Oct 17 2006 at 12:26 PM said:
If you have a breakout board, you might consider just buying a USB<->Serial adapter - this will solve both the gp2x sending console text to the output, as well as giving you a standard +-12V serial port voltage, which may be easier to interface depending what you connect it to.

The only issue is making sure there's a driver for it, but I doubt it would be hard for one of the devs to put one on the filesharing if there isn't already one built in.

Good idea, but the driver might be a problem. I dont think theres going to be an open source driver, rarely is for many devices in linux, but maybe some wrote one.
Also you may still need the BOB, since the those USB ports are the only host enabled ports.
 
Last edited by a moderator:
Hi

You have given me a lot to think about. JMRI (Java Model Railroad Interface) is an open-source effort to produce software for the model railroad hobby. I think the problem with trying to port it is that As I understand it the JVM which I can download for the GP 2X does not support swing. Also running under Linux we have a lot of problems with RxTx.

I am a little confused about the serial port on the BOB, I get the impression from some of the posts that all output is sent to it. When it arrives (tomorrow?) I will have a play.

I have a KEYSPAN USB to serial converter for my windows lappy . I will try that.

I will have a look at SDL it is something I have never used.

Thanks for your interest.

Peter
 
Peter L-J posted on Oct 17 2006 at 03:59 PM said:
Hi

You have given me a lot to think about. JMRI (Java Model Railroad Interface) is an open-source effort to produce software for the model railroad hobby. I think the problem with trying to port it is that As I understand it the JVM which I can download for the GP 2X does not support swing. Also running under Linux we have a lot of problems with RxTx.

I am a little confused about the serial port on the BOB, I get the impression from some of the posts that all output is sent to it. When it arrives (tomorrow?) I will have a play.

I have a KEYSPAN USB to serial converter for my windows lappy . I will try that.

I will have a look at SDL it is something I have never used.

Thanks for your interest.

Peter

Never heard of swing before, but I know some java runtime is currently being ported, you really should look into it. There should be a thread on the boards.

What i meant by the serial was, when the gp2x boots it sends ascii messages like it is a terminal window. You will see it looking for something to boot and setting up devices and modules. If one of the ascii message contains characters that are same as your DCC commands then youll see your DCC do something you didnt tell it to do. Most likely the commands are very unique, but you never know.

The USB to serial would interesting, but its beyond me. I have never coded anything for USB.

Look at this for SDL, it game based but it will show you how to draw and display text through TTF library
http://lazyfooproductions.com/SDL_tutorials/index.php
 
Last edited by a moderator:
Pickle posted on Oct 17 2006 at 03:52 PM said:
The USB to serial would interesting, but its beyond me. I have never coded anything for USB.

No, it would be interfaced with in linux exactly as if it were a hardware serial port. Linux handles the driver for USB.
 
Last edited by a moderator:
well, you can allways compile uboot and open2x with serial console disabled, or ask someone nicely to do so.
Or just plug it in after the gp2x has booted.
 
BradN posted on Oct 18 2006 at 02:19 PM said:
Pickle posted on Oct 17 2006 at 03:52 PM said:
The USB to serial would interesting, but its beyond me. I have never coded anything for USB.

No, it would be interfaced with in linux exactly as if it were a hardware serial port. Linux handles the driver for USB.

Thats cool, I wasnt sure if the gp2x linux kernel would handle it.
 
Last edited by a moderator:
Back
Top