Mark DiVecchio's OOK Radio Support

1992 Layout Page

2006 Layout Page

2009 Layout Page

P&LE Postcards by Howard Fogg 

Plasticville Buildings

Portable Layout Page

Train Clubs

Bing Track (help needed)

Remote Train Control (RTC) Program 

YouTube Channel


Technical Videos

Playing clips from .mth sound files

OOK Radio Support for RTC

This Page last updated on .

As I mentioned in the posts on the forum, I am releasing these programs and documentation under the  GNU GENERAL PUBLIC LICENSE Version 3 and GNU Free Documentation License Version 1.3. These licenses permit anyone to use the program and the documentation to produce follow on programs as long as those programs remain covered by the GNU licenses.

The Free Software Foundation web page talks about what "free software" means.

For more information, look on the Open Source Initiative web site which includes a description of what Open Source means and their certification of the GPL version 3.

Here is the copyright notice for those two licenses:

GNU GPL

Remote Train Control Program for Windows
© Copyright 2015 by Mark DiVecchio

Remote Train Control is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Remote Train Control is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Remote Train Control.  If not, see <http://www.gnu.org/licenses/>.

GNU FDL

This is part of the Remote Train Control Manual.
© Copyright 2015 by Mark DiVecchio

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. You should have received a copy of the GNU Free Documentation License along with Remote Train Control. If not, see <http://www.gnu.org/licenses/>.

PC Control of MTH Engines by Radio Connection to the TIU

Background

I've been working on understanding the interface between the Remote and TIU for several years. I started with the work done by Mike Hewett  <mhewett737yahoo.com> in about 2011. He investigated the wired connection (using a phone handset cord) between the two. He figured out a lot of the interface. It was RS-232 (using 0v and 3.3v levels). It was 9600 baud, 8 data bits, no parity, 1 stop bit. He could  see command packets going between the Remote the TIU. He wrote software to capture those packets, store them on a PC and send them to the TIU on request.

I took the work that Mike did and expanded on it. I developed a better understanding of the command packet from the Remote and the response packet from the TIU. I put all that I learned into a program called Remote Train Control.

I was still using a wired connection between the PC and the TIU. I thought that I could figure out how the radio connection worked.

Searches on Google developed a few leads:

1. Frequency requests to the FCC for Hand Held RF module and for Base RF module:

https://fccid.io/OT8RFMR#axzz3RPE7qRYL
https://fccid.io/OT8RFMT#axzz3RPE7qRYL

This showed that the Remote transmitted on  916.5 MHz and the TIU transmitted on 905.8 MHz

2. This I found this post on an SDR web site:

SDR-noob needs help. Want to decode 9600bps OOK signal at 905.8MHz.

submitted 17 Nov 2014 by playaspec

Hi all. I've been trying to reverse engineer the protocol used by a toy train with little luck. Through a great deal of digging through Google, I've discovered that the remote and the base communicate at 905.8MHz, using OOK at 9600bps. I would like to snoop this protocol to bring the train under computer control. Can anyone lend a hand?

The radio chip in the receiver (and I assume the transmitter) is a TI TRF6901

He never got any responses, except from me, and could not add to his comment at the time. I don't know if he ever got to a solution because I never heard from him again. But at least, if he was right, I could search for OOK and the TRF6901.

3. I needed to find out if anyone sold a radio board using the TRF6901. Searching the Internet turned up nothing.

4. On the TI web page, the TRF6901 was listed as "NRND" - TI speak for "Not Recommended for New Designs". I downloaded the data sheet and saw that the chip supported FSK (Frequency Shift Keying) and OOK (On-Off Keying). So the Remote and TIU probably spoke either FSK or OOK. I found this article: "I'm OOK, You're OOK?" from Maxim. Another big hint was the comment on the TI TRF6901 web page that stated:  "Replaced by CC1101".

I learned that OOK, which stands for "On-Off Keying" is a simple bit serial protocol where the transmitter is just turned on and off based on the "1" or "0" value of the bit being transmitted. Kind of like Morse Code or what we hams call "CW" - Continuous Wave - transmission.

5. Since the TRF6901 was obsolete, maybe the CC1101 could be used. The data sheet said that it could do OOK. It was worth investigating.

6. Now did anyone make a board using the CC1101?  I found Erwan's Blog which talks about connecting a CC1101 to an Arduino. He used a board from Elechouse which contains the CC1101. 

7. Then I found the panStamp web site and product called the "panStamp AVR 1". Exactly what I needed, an Atmega328p MCU and CC1101 on a small circuit board along with a carrier board containing a USB port for a PC. I've used the Atmega328p MCU (its the basis of the Arduino) in other projects so I was familiar with it. Easily covers the two frequencies I needed to cover. Its a very low power draw solution. I ordered one. Took about 2 months to get it from Spain - I didn't get the expedited shipping. Mental note: next time, pay for the faster shipping.

8. The Atmega328p MCU is programmed using the standard Arduino IDE and board files from panStamp. Their web page shows you everything you need to know about installing the IDE with panStamp support. I learned that panStamp supported the CC1101 using only a protocol called "SWAP". A very complex high level protocol. For most users it is the best choice - as long as the radio on the other end of your connection is speaking SWAP. I, on the other hand, needed to be speaking OOK.

9. I learned how to program the CC1101 from scratch. I searched the Internet and got little bits of help. I found a program called SmartRF Studio 7 from TI which helps set the values needed for the CC1101 configuration registers. Months of digging through the CC1101 data sheet and test code for the Atmega328p MCU finally led me to a working receiver. Then a working transmitter. I wrote a program based on the panStamp example program "modem.ino". I called my program "RTCModem". I could communicate between the PC and the TIU with my Remote Train Control program. (note: this paragraph took about 5 months actual work.)

10. To program the CC1101, I took the code written by the panStamp developers that supports SWAP, deleted all of the SWAP routines and added routines to implement OOK.

11. The protocol over the radio is just like the RS-232 TTL level wired connection. You might think of it as inverted, though. When the RS-232 signal is a '1' or "Marking", the transmitter is off. In RS-232-land, this is the idle state. With a radio, we want the transmitter to be off when the connection is idle. This lets other remotes transmit and control the TIU. It also saves our battery power. When the RS-232 signal is a '0' or "Spacing", the transmitter is on.

12. I found that both the Remote and the TIU require what I call a "wakeup" signal be transmitted to them before data is transmitted. I'm guessing that the receiver circuit needs a carrier signal for some amount of time in order for it to lock onto the incoming signal. I found by experimentation that a carrier on signal of about 2000 microseconds followed by a carrier off signal of about 600 microseconds worked. Following this wakeup pulse, the next carrier on is the START bit of the first character of the packet of data. If you look at the code, you can see where I do this.

For details on the previous steps look at this document.


http://www.gocomics.com/nonsequitur

Here are two articles that I wrote about RTC. They give simple operating instructions and might be of use. The articles were originally published in the TTOS Southern Pacific Division newsletter "Daylighter" in March 2016:

Article with screen shots and startup instructions
Article with more technical description of the program's operation


You can also access these videos on my YouTube Channel.

Radio based interface between the PC and TIU

Here is a video, recorded 2 Sep 2015, of the interface which replaced the wired connection between the PC and TIU used by the RTC program with a radio connection.

Image loading....


RTC Program communicating with a TIU over the radio

I used the panStamp AVR 1 which is no longer available. It is shown mounted on a panStick 3.0 (with the USB connector), also no longer available. The panStamp consists of an Arduino-like processor using the ATMega328 along with a TI CC1101 radio chip.  Its programmed using the Arduino IDE along with the panStamp AVR board files as downloaded by the IDE's Board Manager. The new version of that board is now available, it's the panStamp AVR 2. I have ported my RTCModem program to that new board. You can download the RTCModem program below.

One thing the I will point out over and over (because I messed up here) is that the TI CC1101 is a 3.3v part and can only connect to 3.3v circuit. The panStamp has voltage regulators which run it at 3.3v. A plain Arduino is a 5.0.v part and will NOT directly connect with the TI CC1101 (safely). In some of the examples below, I used an Infiduino which can be switched to operate at 3.3v.


Retro Transformer

This is my first project using the panStamp radio. Recorded 21 Sep 2015. Its only an example of what could be done. I built it in a cardboard shipping box. Inside are a panStamp AVR 1, 2 AA batteries for power, a few switches, pushbuttons and an old joystick (really just a fancy potentiometer). When you are not transmitting, the board draws about 3ma. Great for battery operation. Take a look:

Image loading....


First Project - a Retro Transformer

This box performs just a sub-set of the functions performed by the remote. It is hardcoded to control one engine and communicate with one TIU. But I could see a controller built with large buttons, something really kid friendly. Or how about a track activation device that sounds the whistle/horn automatically when the engine approaches a grade crossing. Maybe even an automatic speed control as the engine is approaching a station. It can be extended to control accessories and switches. Mike Hewett has developed a scheme with which he can identify the position of each engine on the layout. With that, you can develop a system that performs different functions depending on which engine is coming into town. Maybe routes them onto different sidings or to different industries (by commanding the AIU).

You can get the RetroXFMR (panStamp AVR 1 & 2 version) program here <download ZIP file>. This version is one I used in the hardware shown in the video.

You can get the RetroXFMRE (ElectHouse CC1101 version) program here <download ZIP file>. I ported the panStamp version to the Arduino/Infiduino & ElecHouse CC1101 and tested that it compiled correctly. I did not do any extensive tests on this version but one of my users compiled, loaded and ran it on his hardware.

See below for instructions on how to use the Arduino IDE to compile and download these programs. Each also requires a support library.

Each of these ZIP files contain a circuit schematic of how I connected up the switches, pushbuttons and pot. The schematic is for the panStamp version but you can translate the pin numbers to match the Arduino/Infiduino used in the ElecHouse CC1101 version. You need to download the free program KiCad EDA to view these files. Look here:  http://kicad-pcb.org/

Below, you can see an implementation of RetroXFMR by Ray.

Developer's  note: If you are interested in learning how to use either the panStamp or the Arduino/Infiduino to control your trains, this RetroXFMR is the best place to start. Look at the code to learn how to take a command and add all of the bytes around it to build a packet that can just be sent over the radio. Once you understand this, you can use my routines to build up and send your own commands.


panStamp AVR 2

I think that I bought one of the last panStamp AVR 1 boards sold. They are now sold out. The good news is that they have designed a new version of the board called the "panStamp AVR 2". It appears to have the same functionality but a different form factor. It comes in different versions depending on the frequency range needed. We need the 902-928 MHz version. 

I ordered several and I have ported my RTCModem code to run on it.

From the panStamp store, you need to order a few  items (you can use the links):

1.  "panStick 4.0" module and SMA connector assembed with option (very important) "panStamp AVR2 @  902-928 MHz"   PS0002.
                    panStamp supplies these components assembled and tested - Now there is NO soldering necessary.

2.  "SMA articulated antenna" AN0003 
3.  If you want to get fancy, you can order a small plastic box "Enclosure for mini-carrier boards" EN0005

Don't use the standard shipping as it will take 2 months to get the parts (I know this from my first order).

Here is a photo of items 1 and 2 as you would receive them from panStamp:



You will need a USB cable (USB A Male to USB Micro B) to connect the board to your computer.

You can now install the Arduino IDE and OOK support files as described below or you can download the pre-compiled program using the XLoader program as described below.
To use the radio with the RTC program, you need to load the "RTCModem" program.

Here is their wiki page. Here are some photos from their web page:



panStamp AVR 2


panStick carrier boards
The bottom board is the panStick 4.0.
Using the link above, you can order this radio with the AVR 2 already soldered and tested by panStamp.
You will need a USB cable (USB  A Male to USB Micro B) to connect the board to your computer.



Here is a photo of my setup.

Antenna
Frequency = 915 MHz:

    Quarter Wavelength: 77.9 mm = 3.069 inch
    Half Wavelength: 155.9 mm = 6.138 inch

The length is not critical. Get close. I used a curly, Spring Antenna that I bought from the panStamp store.
You should get fancier and get the SMA articulated antenna from the panStamp store.
Using the link above, you can order this radio assembled and tested by panStamp.
Note the slide switch - it must be in the position closest to the RESET pushbutton.


Homebrew panStamp enclosure

Mike Hewett bought himself a 3D printer and he made a really nice enclosure for the panStamp.




Mike Hewett's panStamp enclosure

Mike is going to send me the data files for this enclosure. With those files, you should be able to get get this enclosure fabricated by one of the 3D printing web sites. I'll post the files when I get them.

Installation of the Arduino IDE and OOK support files

Install the Arduino IDE. When I wrote this, 1.6.5-r2 was the lastest version.  As of Jan 2016, the panStamp people have said that newer versions of the Arduino IDE do NOT work with the panStamp - so do not use version 1.6.6 or newer until this problem is corrected. Get version 1.6.5-r5 here: https://www.arduino.cc/en/Main/Software .

Install support for the "panStamp AVR 2 w/atmega328p" board. Follow instructions here:  https://github.com/panStamp/panStamp/wiki/First-steps. This page should also inform you if the newer versions of the Arduino IDE will work. Otherwise, continue to use 1.6.5-r2.

Make sure that the Arduino AVR Libraries are loaded. https://www.arduino.cc/en/Guide/Libraries. I believe that all of the necessary libraries get loaded automatcially. I suggest that you try the compile (when you get to step 8 below) and worry about the libaries only if you have a problem.

In your Arduino Sketch folder, create a folder named "RTCModem" and put these two files in it:
  RTCModem.ino
  RTCModem.h

You can get the RTCModem (panStamp version 1.0.1) program here <download ZIP file>.

You might need the VCP device drivers from the FTDI web site. Get the latest version for Win 7, Win 8 and Win 10. At the time of this writing, that is version 2.10.0.0 (dated 1/27/2014). Get the older, no longer supported, version 2.8.30 (dated 7/12/2013) for Win XP (still works fine). NOTE - this version for XP seems to be gone from the FTDI web site - in its place, get the latest version 2.08.24 dated 4/13/2012.

Install the "panStamp OOK AVR 2 w/CC1101" support (this is my implementation of OOK protocol on the panStamp version 1.0.2) as follows:
 
1. Start the Arduino IDE.

2. Open the File->Preferences menu and add the following URL into "Additional Boards Manager URL's":

        http://www.silogic.com/trains/RTC/package_silogic.com_panstamp_ook_index.json

        Separate multiple URL's by commas.

3. Click on "Tools->Board->Boards Manager" and scroll down the window until you find the "panStamp OOK AVR 2 w/CC1101" entry. Then click on [INSTALL]. This should install version 1.0.2 of my radio.

4. Click on "Tools->Board" and select the "panStamp OOK AVR 2 w/CC1101" board.

4a. On the panStick 4.0, check the position of the small slide switch. It must be in the slide position nearest the RESET pushbutton.

5. Plug the panStick 4.0 with panStamp into a USB port. Drivers for the board should install. Note which COM port that it configured as.

6. Select that COM port on the "Tools->Port" menu item.

7. Open the "File->Open" menu and select the RTCModem.ino file

8. Click on "Sketch->Upload" to complile and upload the code into the panStamp.

9. Start your program, might be RTC or one of Mike's programs. Select the correct COM port in Setup, select "Radio" mode. Turn on your TIU, press CONNECT, READ, and then STARTUP and run an engine.

Email me if you have questions or clarifications (or if your setup actually worked!).  email :  markd@silogic.com
---------------------------------------------------------------------------------

Notes::

1. Requires TimerOne which is installed when the panStamp support is installed.

2. Requires HardwareSerial which is installed when the panStamp support is installed.

3. Requires SoftwareSerial which is installed when the panStamp support is installed. SoftwareSerial inverts the data in both directions. Required so that when the serial data is "1", the transmitter is off and when its a "0", the transmitter is on. RS-232 Marking state ("1") is its idle state and we don't want the transmitter on when the channel is idle.

I had to make a few patches to the Software Serial routines as received with the original panStamp library. If you download the Board Mangaer files for the "panStamp OOK AVR 2 w/CC1101" board as described above, you will get this patched library. I am only documenting the changes here. They increase the buffer size to insure that the 173 byte packet from the TIU can be received without the possibility of overflow.

SoftwareSerial.h
Increase the buffer size from 64 bytes to 256 bytes:
#define _SS_MAX_RX_BUFF 256 // RX buffer size    MCD was 64
Change the buffer pointers from 8 bit to 16 bit:
  static volatile uint16_t _receive_buffer_tail;    // MCD was uint8_t
  static volatile uint16_t _receive_buffer_head;

SoftwareSerial.cpp
Change the buffer pointer from 8 bit to 16 bit:
volatile uint16_t SoftwareSerial::_receive_buffer_tail = 0;    // MCD was uint8_t
volatile uint16_t SoftwareSerial::_receive_buffer_head = 0;


4. Remember that raising then dropping DTR over the COM port will reset the Atmega328p MCU on the panStamp board. So if you don't want to reset it, don't toggle DTR. The panStamp always resets on power on.


Arduino with ElecHouse CC1101

Earlier in this page, I mentioned Erwan's Blog which talks about connecting a CC1101 to an Arduino. He used a radio board from ElecHouse which contains the CC1101.

Originally, I thought that since the panStamp was a lower power and cheaper solution that it would be the best. I'm thinking now that a real Arduino along with the CC1101 is not such a bad idea. It will be more expensive and will consume more power but all of the other Arduino peripherials and software libraries that are available is a real plus.

First let me point out that the maximum voltage on any pin of the CC1101 is 3.3v. You cannot use a regular Arduino UNO but you have to use one that operates at 3.3v. There are many of these available. I used a version called an Infiduino. It has a switch for either 3.3v or 5v operation. I got it on eBay.

So I thought that I could port my RTCModem program to an Arduino/ElecHouse CC1101 setup. The time I spent learning about the CC1101 should be directly useable. It was. The developers of the ElecHouse CC1101 had written code for the Arduino to communicate with the CC1101. Since I now understood how all this worked, it was easy to port the code. I added an "E" to the program name to indicate that it is the ElecHouse CC1101 port - "RTCModemE".

Click here for a source for the ElecHouse 915MHz CC1101 Wireless Module (directly from ElecHouse). The page shows this module as "RF1100SE" but the boards that I received are marked "RF1101SE-V3.1". The web page claims that this board is designed specifically for operation in the 915MHz band.

Many of the boards on eBay are V2 and may not work at 915MHz. You never know. They are pretty cheap so there is not much to lose if you try them.

Here is a photo of my Arduino Clone, an Infiduino, jumpered over to an ElecHouse CC1101 (using a Screw Shield - but the Screw Shield is not really needed - you can connect the jumpers directly to the Infiduino.). I also added a 100uF electrolytic decoupling capacitor arcross the power pins on the CC1101. I don't really know if this is needed or not - seems to work fine with it and without it.



This is solderless solution..... Source for jumpers - MPJA.com .

Here are the pinouts of the ElecHouse CC1101 board. This drawing is linked from Erwan's blog.





Here is a drawing that shows how to interconnect the two devices. This drawing is linked from Erwan's blog with one modification. My OOK implementation requires one more interconnection than Erwan used, from Infiduino 03 to CC1101 GDO2 / 6.



You compile the RTCModemE program using the standard Arduino IDE and the standard Arduino libaries along with my "CC1101E" library as described below.

Install the Arduino IDE. When I wrote this, 1.6.5-r2 was the lastest version.  Get it here: https://www.arduino.cc/en/Main/Software
Make sure that "Arduino AVR Boards Built-In" is installed. I'm using version 1.6.8.

Note: in Aug of 2016, one of my users wrote: "I used Arduino IDE 1.6.8 and AVR
Board 1.6.13 (instead of 1.6.8) - For some reason, AVR Board 1.6.8 did not include TimerOne.  I was getting include errors initially looking for TimerOne.h.  I went and downloaded TimerOne from GitHub, but also the switch to 1.6.13 might have helped."


Detailed installation instructions are here: https://www.arduino.cc/en/Guide/HomePage.

Make sure that the Arduino AVR Libraries (I'm using version 1.6.8) are loaded. https://www.arduino.cc/en/Guide/Libraries

Newer versions of the IDE and AVR Libraries should work but I've not tried them (I have to stay at an older version of the IDE because v1.6.6 and newer don't work correctly with the panStamp AVR Libraries and I need support both the Arduino and the panStamp.).

In your Arduino Sketch folder, create a folder named "RTCModemE" and put these two files in it:
  RTCModemE.ino
  RTCModemE.h

You can get my RTCModemE (ElecHouse CC1101 version 1.0.1) program here <download ZIP file>.

This library is my implementation of OOK protocol on the Arduino with the ElecHouse CC1101. You can get the my CC1101E_OOK library (Version 1.0.2) here <download ZIP file>. In the zip archive, look for the folder CC1101E. Move that folder and its contents into your Arduino libraries folder - on my Win 7 computer, its a folder named: C:\Users\<user>\Documents\Arduino\libraries.

In your local Arduino Library folder, create a folder named "CC1101E" and put the CC1101E_OOK library files in it.

You might need the USB VCP drivers from the FTDI web site. This is only if the drivers do not load automatically. Get the latest version for Win 7, Win 8 and Win 10. At the time of this writing, that is version 2.10.0.0 (dated 1/27/2014). Get the older, no longer supported, version 2.8.30 (dated 7/12/2013) for Win XP (still works fine). NOTE - this version for XP seems to be gone from the FTDI web site - in its place, get the latest version 2.08.24 dated 4/13/2012.

Install the "Arduino AVR Boards"  support as follows:

1. Start the Arduino IDE.

2. Click on "Tools->Board->Boards Manager" and scroll down the window until you find the "Arduino AVR Boards" entry. Then click on [INSTALL] -- unless its already installed.

3. Click on "Tools->Board" and select the "Arduino Uno" board. NOTE: you can use any Arduino board, does not have to be a Uno.

4. Connect the Arduino to the PC into a USB port. Drivers for the board should install. Note which COM port that it configured as.

5. Select that COM port on the "Tools->Port" menu item.

6. Open the "File->Open" menu and select the RTCModemE.ino file

7. Click on "Sketch->Upload" to complile and upload the code into the Arduino.

8. Start your program, might be RTC or one of Mike's programs. Select the correct COM port. Turn on your TIU, press CONNECT, READ, and then STARTUP and run an engine.

Email me if you have questions or clarifications (or if your setup actually worked!).  email :  markd@silogic.com
---------------------------------------------------------------------------------

Notes::

1. Requires TimerOne which is installed when the Arduino AVR Boards support is installed.

2. Requires SoftwareSerial which is installed when the Arduino AVR Boards support is installed. SoftwareSerial inverts the data in both directions. Required so that when the serial data is "1", the transmitter is off and when its a "0", the transmitter is on. RS-232 Marking state ("1") is its idle state and we don't want the transmitter on when the channel is idle.

3. I get these two warning messages when I compile. They don't seem to have any effect on the operation of the sketch.


...\SoftwareSerial.cpp:375:6: warning: always_inline function might not be inlinable [-Wattributes]
 void SoftwareSerial::setRxIntMsk(bool enable)
      ^
...\SoftwareSerial.cpp:121:6: warning: always_inline function might not be inlinable [-Wattributes]
 void SoftwareSerial::recv()
      ^


CTI TrainBrain Support

Mike Hewett uses CTI's TrainBrain software to control his trains. Mike did the original wired interface to the TIU. Paul Reynolds wrote the original code in the sketch. I added the interface to the radio.

You can get the TBModem (panStamp version 1.0.0) program here <download ZIP file>.

This program compiles and installs the same way as the RTCModem program described above. Or you download a pre-compiled panStamp version in the XLoader section of this web page.

XLoader - Uploading code images to the Arduino and panStamp without having to install the IDE and compile the code

Here is a way to upload a precompiled binary image of these programs without having to load the Arduino IDE and compiling the code. The precompiled code is available below for both the panStamp and the Infiduino/ElecHouse CC1101. This procedure is based on Xloader by Geir Lunde:
-------------------------------------------------------------------------------
Copyright (c) 2012, Geir Lunde
All rights reserved.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://russemotto.com/xloader/
-------------------------------------------------------------------------------
I have updated Geir's software with programs and files compiled with v1.6.5 of the Arduino IDE. The zip file contains a program which will load a hex file into an Arduino based board. Make a folder (maybe called XLoader) and extract all of the files in the ZIP into that folder.

The ZIP file below conatins the XLoader program and all of the *.hex files.

To run click on XLoader.exe

Choose the Hex file to load.
Choose the Device.
Choose the COM port.

The Baud rate will be set automatically.

Click on "Upload".

-------------

My RTC files included were compiled on 8 Sep 2016 and were the latest versions of the programs at the time. The compliled output files are named <program>.cpp.hex

panStamp AVR OOK Library v1.0.2 and ElecHouse CC1101E Library v1.0.2 were used.

Remember than any system that uses the ElecHouse CC1101 radio requires an Arduino implementation that operates at 3.3V (such as the Infiduino).

Note: All of the receivers in these programs are set for 162.5kHz bandwidth,  except for RTCModem541 and TBModem541, which are set for 541kHz bandwidth.

RTCModem - provides radio communications between the PC and the TIU for the Remote Train Control (RTC) program as described earlier on this page. The recever bandwidth is set to 162.5 kHz. This bandwidth has worked for me using Rev I, Rev I3A and Rev L TIU.

    RTCModem  - panStamp version. <-- this is the program you want to use with RTC if you bought the assembed panStamp radio from its maker.
    RTCModem541 - panStamp version with 541kHz receiver bandwidth.
    RTCModemE - Infiduino/ElecHouse CC1101 version.

RetroXFMR - My simple implementation of a toy train transformer as described earlier on this page.

    RetroXFMR - panStamp version.
    RetroXFMRE - Infiduino/ElecHouse CC1101 version.

RTCEngine - A program which emulates an Engine connected to a TIU. It outputs the commands it receives and responses that it sends to the Arduino IDE Serial Monitor Port. Look at Technical Video 7 at http://www.silogic.com/trains/Technical%20Videos.html

    RTCEngine  - panStamp version
    RTCEngineE - Infiduino/ElecHouse CC1101 version

RTCSnoop - A program which monitors the radio communcations between the Remote and TIU and logs the packets to PC using the Arduino IDE Serial Monitor (or any terminal emulator). To decode these packets copy/paste them into RTC's TIU buffer using RTC's debug mode. Then from the TIU Buffer's context menu, click on "Decode Strings in TIU Buffer". This will put the decoded strings into the CRC Buffer. You can copy and paste or save them from there.

You can leave comments in the logged packets to reminder of what button you just pushed. In the serial monitor just type a note to yourself and press [Send]. A note could be something like "Press the Startup button".

If you use the XLoader downloaded version, you can use any terminal emulator to capture the packets. I've used Termite: http://www.compuphase.com/software_termite.htm with success. Set the baud rate to 57600.

    RTCSnoop  - panStamp version
    RTCSnoopE - Infiduino/ElecHouse CC1101 version

TwoEngine - A program which runs two engines around and around on your layout. Requires a Sharp GP2Y0A21YK infrared (IR) detector, a pushbutton and an LED. Written only for an Infiduino and an ElecHouse CC1101 radio. Requires DistanceGP2Y0A21YK.h and TimerOne.h. Look at Technical Video 6 at http://www.silogic.com/trains/Technical%20Videos.html

    TwoEngineE - Infiduino/ElecHouse CC1101 version

TIU - A wired serial port based TIU emulator. I wrote this to help me watch the serial output of the RTC program. It does not use a radio. When I wrote this, I used an Arduino Uno running at 5V (the LCD Keypad Shield requires 5v). I've not tried it with a Infiduino running at 5v, but it should work. Look at Technical Video 1 at http://www.silogic.com/trains/Technical%20Videos.html . Requires an LCD Keypad Shield to display the commands it receives.

    TIU - Arduino/LCD Keypad Shield version.

TBModem - This is an interface between the CIT TrainBrain controller written by Mike Hewett and the TIU. Specifically written for Mike's code. Based on code originally written by Paul Reynolds (who developed a nice, fast CRC generator function). panStamp only. As a debug feature, this program toggles the LED each time a packet is forwarded to the TIU. Look at Technical Video 2 at http://www.silogic.com/trains/Technical%20Videos.html

    TBModem - panStamp version

Fast_Clock_Master
Fast_Clock_Slave

    Model railroad fast clock master and slave. Requires TM1637.h,  TimerOne.h and EEPROM.h. Hardware requirements spelled out in the source code file.

    Fast_Clock_Master.cpp.hex - Arduino version
    Fast_Clock_Slave.cpp.hex - Arduino version

You can download the XLoader program and compiled binary versions of my programs <download ZIP file>. There have been some comments that the XLoader.exe program in the ZIP file has a virus but I checked it with Malwarebytes and found none. I have run it on my computer with no apparent problem. Requires dotNET v4.0.30319 (at least on WinXP). On my Win7 computer, I have dotNET version 4.6.1. Win10 includes dotNET 4.6.1 automatically.

You can download the source code for all of these programs here <download ZIP file>.

Mar 2016 Demo of RTC at the TTOS SP Meet in Anaheim, CA

Here is a video taken at the March 2016 meet of the Toy Train Operating Society in Anaheim. Photos and videos taken by one of the RTC users, Tom Niemi. It shows my simple demo layout and some of the portable layouts at the meet. I didn't bring my portable to this meet.

Image loading....
 



 Examples of Implementations by Users of RTC

Ray was the first person to report success at installing the Arduino IDE, buying an Infiduino and ElecHouse CC1101 radio, compiling RTCModemE and actually running trains! Here are a few photos that he sent me:


Here is the Infiduino wired to an ElecHouse CC1101
Ray, is this a real breadboard?

Ray's PC running RTC

RTC Screens

Ray then went on to build the Retro Transformer. Here is a video that he sent me:


Image loading....



In 2017, Ray built an upgraded and repackaged version of the Retro Transformer.

From:    "Ray Leiter"
Subject:    RetroXFMR finally done
Date sent:    Fri, 7 Jul 2017 19:34:45 -0400

Mark;

Here is a picture of the Retro Transformer finally completed.

I hate to admit it but the crazy thing was working all along. The reason it appeared to not work was because I wired the speed pot backwards. When the knob was turned fully CCW (which would normally be 0 smph), it was actually full speed and as you well know, you can’t do a startup in that condition.

I discovered it after I made it work without any controls. I since then wired it correctly and it now works as it did before.

On another matter; I am still waiting on my parts order from Futurlec. I need the parts to build Adrian’s UHF Block Detector circuit. I don’t think I’ll ever order from them again.

Ray



I used Embarcadero C++ Builder v10.1 Berlin to compile the program.

I used Audacity and WavePad to try different decodes on the ".mth" file.

I used hex editor HxD in understanding the format of the sound file and in editing the sound file.

I used SOX to understand and convert audio files from one format to another.

I use Lame to convert clips to mp3 format.

Screen recording performed with CamStudio. and with Icecream Screen Recorder.


This site prepared and maintained by Mark DiVecchio

email :  markd@silogic.com

SD&A HOME
 
 Mark's Home Page

The DiVecchio genealogy home page
The Frazzini genealogy home page

This site will be under construction for a while forever.