Welcome to the forum   
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post in this topic Go to first unread post in this topic
Offline eindhoven  
#1 Posted : 15 May 2011 00:34:04(UTC)
eindhoven


Joined: 30/01/2010(UTC)
Posts: 5
Location: Atlanta
I have a 6021/6050 connected to a PC running XP. I have written some BASIC programs to test out my layout and I can control locs and operate turnouts and signals. But I am using "No Flow Control".

I need Flow Control if I am going to use any of the commercial train control programs. I have tried two different train control programs but I can't seem to get either one working with RTS/CTS.

6050 DIP switches-
For example, if I set the 6050 dip switches to the recommended ON ON OFF OFF (Flow Control mode), commands do not get through the 6021. Locs don't move, turnouts don't respond and signals don't change.

If I set the 6050 dip switches to ON ON ON OFF, then programs work but only in "NO Flow Control" mode. This implies that the 6021 is correctly passing the commands. However, without flow control, some commands can get lost (for example, loc reverse doesn't work because usually the stop and reverse commands are sent one after the other and the reverse command gets lost).

I don't think the problem is with the 6021 dip switches as I have tried all 16 combinations.

I have made my own DB9 to DIN6 cable wired according to the "6051 interface" article on this user net. However, I have added a breakout cable to try different wiring combinations. For example, the original Marklin website stated that for a PC one needs to wire pins 1-4-6 together. I have testing with and without that bridging.

The port settings on Com1: (in the Device Manager) are 2400bps, 8 data, no parity, 2 stop, and flow control set "None" or "Hardware" as appropriate.

How do I get Flow Control working? I have been on this problem for weeks. I must be doing something wrong Confused. Any help would be GREATLY appreciated Crying.

John H.
Offline clapcott  
#2 Posted : 16 May 2011 13:41:35(UTC)
clapcott

New Zealand   
Joined: 12/12/2005(UTC)
Posts: 2,448
Location: Wellington, New_Zealand
Hi John,

If there is any flow control I gave up on it last century.
I found that all commands required a rest/delay before you sent another command. However the delay required for any particular type of command was reliably consistent.

As per your observation reverse and function codes require a longer wait than the most basic speed and accessory commands. s88 reads even longer.

If its any consolation, once you have worked out the delay and added a margin of error the system is very reliable.

I would suggest a little loop and observation. start with a second delay and flash the lights or set a route and slowly degrease the time until the command is ignored. From memory you will probably find the number is between 20 and 100ms (I'm running on memory here)

Peter

P.S. when you start getting into accessories don't forget to finish with an OFF command.
Peter
Offline Webmaster  
#3 Posted : 16 May 2011 20:27:07(UTC)
Webmaster


Joined: 25/07/2001(UTC)
Posts: 11,165
The trouble is that the 6050/51 buffer is only 2 bytes long and very easy to overrun without RTS/CTS unless you have a delay of about minimum 80ms inserted between the double-byte commands.

If you want to have RTS/CTS working (for 6051, don't know if 6050 is different) you should implement a write buffer queue to the serial port and let the RS232 hardware control the writes to the 6050/51.
I did my programming in VB 3.0 in the 90:s, and you could set up a write queue within the RS232 serial comm component. Worked quite well when I had understood to use write-to-buffer-queue instead of writing directly to the port... The cable must of course also be "correct" so it can signal RTS/CTS. I used the cable supplied with the 6051.

I also helped Juergen Freiwald with the RTS/CTS testing for the 6021/51 combo for his early versions of the Railroad & Co software and that really helped up the performance of the software in those very early days... Especially with setting DIP 1,2 and 3 up on the 6021 (Motorola "new" only + 6021 fast pacing of commands without sending them twice all the time) but that of course only worked for the newer decoders back then, from 6090 and onwards.

Then I moved on to the IntelliBox...

The 6021 + 6050/51 combo is maybe nowadays seen as "obsolete", but they are still rock-solid performers for running M digital trains if you don't need to address the new fancy stuff like eg 93 different sound functions, self-registration of locos and such...


Ehhh... Just remembered, 6051 was just a 6050 with a cable and a diskette with sample programs... Actually says "6050" on the bottom of my old unit - so they should be the same... Age, you know.... BigGrin
Juhan - "Webmaster", at your service...
He who asks a question is a fool for five minutes. He who does not ask a question remains a fool forever. [Old Chinese Proverb]
Offline nevw  
#4 Posted : 17 May 2011 03:01:09(UTC)
nevw

Australia   
Joined: 27/08/2005(UTC)
Posts: 11,071
Location: Murrumba Downs QLD
Originally Posted by: Webmaster Go to Quoted Post
Then I moved on to the IntelliBox...


Age, you know.... BigGrin


Are you trying to get admitted to the OLD F*rts Society ?? Get on with it. You are only a youngster,... 21 for the 32nd time
NOt wearing the Pink Pinny, which is hard to see and now I have a white Pinny which also is hard to see against MY pure white Skin Still have 2 new shiny tin Hips that is badly in Need of Repair matching rusting tin shoulders
and a hose pipe on the aorta
Junior member of the Banana Club, a reformist and an old Goat with a Bad memory, loafing around
Offline DaleSchultz  
#5 Posted : 19 May 2011 02:37:55(UTC)
DaleSchultz

United States   
Joined: 10/02/2006(UTC)
Posts: 3,997
Flow control definitely works fine with the 6050. I do recommend that you use full CTS and also check device ready (DTR) before writing every byte. That way you never have to do any waiting - which is very inefficient. You are already up against a low baud rate and a small buffer so the last thing you want is wait loops!

Checking wiring of the pins again.

Check that the FiFo buffering is switched OFF in the advanced properties of the com port under Windows when having serial port problems.

Are you using a USB to serial port adapter ? Those are fraught with driver problems and every problem I have ever heard of in that situation was solved by updating the USB adapter driver.


Dale
Intellibox + own software, K-Track
My current layout: https://cabin-layout.mixmox.com
Arrival and Departure signs: https://remotesign.mixmox.com
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

| Powered by YAF.NET | YAF.NET © 2003-2025, Yet Another Forum.NET
This page was generated in 0.550 seconds.