Skip to main content

And now for something completely different.  Explain to me some real-world scenarios/applications of 4-channel operation.  What's neat about the PIC is you can queue triggers.  So if both CH1 and CH2 are triggered simultaneously, you can queue up the CH2 trigger to present to the TX module after the CH1 trigger is dispatched.  

One question is CH3 and CH4 which are separate and do not go thru the PIC.  As drawn, the PIC has no visibility into what CH3 and/or CH4 are doing.  The TX module can only transmit one command at a time.  Now that I think about it, I have no idea what the TX module does if more than one trigger is active at a time (?).

Anyway, getting back to the "universal" flavor of your motherboard, I'm trying to get straight exactly what applications need (up to) 4 channels of triggers and "who" is responsible for insuring that multiple channels are NOT simultaneously triggered/active. 

 

 

The four channels are there because you might want to control stuff in multiple locations from one source.  Remember, I'm making single channel receivers that will react to individual channels.  I can see the locomotive having the four channel board installed, and then using the individual receivers, react to a coupler signal, a headlight signal, markers, and perhaps smoke off/on status.  Also, you don't have to use all four channels, but I can envision plenty of times you'd want to use more than one.

Fun fact, the four channels appear to be totally independent.  That is, I can hold continuous transmission on one channel and manipulate the other channels with 100% recognition. The transmitter board we're using, as well as several different brand keyfobs, all will transmit one or all the channels and they're perfectly recognized by the receiver, and when any one goes active or inactive, it's immediately recognized.  Given that fact, I don't see why I have to insure the other channels are not triggered simultaneously, this seems to be a non-problem.

A different problem does exist, that being multiple transmitters.  If you have two transmitters trying to send at exactly the same time, then the messages do get lost.  That's not something that is easy to control, I don't have a solution for that, but it has nothing to do with the design of my transmitter board.  In point of fact, multiple transmitter boards are a problem.

...

Fun fact, the four channels appear to be totally independent.  That is, I can hold continuous transmission on one channel and manipulate the other channels with 100% recognition.

The specs are scant for the TX module from the qiachip website.  So this may be a roll-of-the-dice if they go to V3 or whatever.  Anyway, for the record let me understand exactly what you're saying:

So if you continuously trigger say CH1, the TX module will transmit continuous packets (~22 msec long, every ~30 msec).  But if CH1 is transmitting and you additionally press, say, CH3 then the packets switch to CH3 packets?  Or are the packets alternating CH1, CH3, CH1, CH3, etc.?  Then you release CH3 and the packets revert to continuous CH1 packets?

When you say "totally independent" I'm a bit confused.  If all 4 channels are triggered simultaneously, what is transmitted?

Apparently, they just mux them all, I can sit there with either the transmitter (with my four buttons to trigger it), or a keyfob and press one, two, three, or all four buttons, and all the receiver lights react properly at all times.

@stan2004 posted:

So if you continuously trigger say CH1, the TX module will transmit continuous packets (~22 msec long, every ~30 msec).  But if CH1 is transmitting and you additionally press, say, CH3 then the packets switch to CH3 packets?  Or are the packets alternating CH1, CH3, CH1, CH3, etc.?  Then you release CH3 and the packets revert to continuous CH1 packets?

Correct, exactly what you'd expect to happen happens.  It's like the four channels are muxed, and they always transmit what they should to manage the channels.

@stan2004 posted:
When you say "totally independent" I'm a bit confused.  If all 4 channels are triggered simultaneously, what is transmitted?

I confess, I can't trigger them truly simultaneously, but I suspect they're managing that internally since as close as I can get with two buttons, I never see anything anomalous in the received data.  My belief is they manage the four channels in the keyfob or transmitter module and trigger the outputs properly.

I wouldn't be at all surprised to see that the transmitted word has a bit for each channel, and they're just setting and resetting one or more of them based in their inputs.  I know that's how I'd design it if I were doing it.  I suspect finding a specification for the 1527 protocol might answer that question.

TX-118S-4 V2 transmission

Everything is becoming clear.  As the "datasheet" suggests each burst sends the state of all 4 inputs so any combination of inputs can be simultaneously active.  What's a little confusing at first glance is that successive bursts are back-to-back without skipping a beat so to speak.  That is, the Preamble of the next burst immediately starts after the last data bit of the previous burst.  So what appears like a gap between bursts is really the 31 clock gap of the preamble.

Anyway, for the record, since it appears you'll be using the TX-118S-4 V2 module, the above scope photo shows the timing for a CH1 and a CH2 burst.  The only difference as per the datasheet is the data bits.  As measured, the (1+31) clock preamble + (20 x 4) clock address + (4 x 4) clock data is about 32 millisec for 128 clock periods.   Since each clock cycle is 250 usec and it takes 4 clock cycles to send 1 bit of address or data, that's equivalent to 1000 bits/sec.

I think the value-added of the PIC is to limit the TX module transmission time to a few bursts whenever the 4-bit data field changes.  I realize that as configured the CH3 and CH4 will cause the TX to be on continuously if either are triggered continuously.  This would limit the user to having only 1 of these systems in place on a layout. So the idea would be to only use CH1 and CH2 for any triggers that can stay on for sustained intervals. 

Attachments

Images (1)
  • TX-118S-4 V2 transmission

That's my thinking Stan.  I'm also assuming that some of the outputs would be like couplers that only come on briefly, so they wouldn't be a factor.  Obviously, as I mentioned, having continuous transmission from one of these does knock out any other 433mhz system, not a good thing.

I sat down and coded up the PIC functionality, now I just have to get my boards back in and see how close I am.   I'm still up in the air as to the length of the burst, I programmed in 100ms, but a stroke of the pen can make that any value.

I think having the four operating modes of the two channels will be a nice plus over my first cut, it should fill a lot of the holes.  I was tempted to do all four channels, but that would require a larger part and I'd probably have to surface mount it and program it on the board.  I kinda' like the feature of having the chip in a socket so someone can have a replacement if new functionality is desired.

BTW, nice scope, I am still muddling along with the dual-trace model, I keep looking at the 4-trace ones, but I can't really justify it.

Last edited by gunrunnerjohn

Stan, did you happen to notice that the TX-118S-4 V2 (and V1) have swapped the #1 and #2 outputs from any other transmitter? 

I have three or four keyfob transmitters, all of them are consistent that A = 1, B = 2, etc.  However, these transmitters send output #2 to the first receive channel and output #1 to the second receive channel!  I have to wonder if that's why they're being sold so cheap, someone ordered them and they were screwed up, so they had to fix them and go again.

I'm going to swap those two channels on my transmit board so these boards agree with all the other transmitters.

Stan, the V2 one does the same thing.  I swapped the pins in my code so that it'll match what the keyfob transmitters send.  I always like one to be one, two to be two, etc.   That has to be a screwup with the transmitter module design.  The encoder chip specs clearly indicates it sends them out right, so they must have just wired the board wrong.  Unless that's actually a design screwup and that's the reason they're dumping them cheap, I can't imagine why they'd do that.

PS2 coupler transmission with only 220uF

Of course I'm obsessed with the possibility of a 2-wire self-powered PS2 version.  To that end I reduced the 470uF cap to 220uF as you have in your size-matters module.  I also added a 4.7K resistor across the 5V 78L05 output to simulate the ~1 mA load of a PIC.  Then I triggered it via the 2-wire coupler with both 18V command voltage and then only 12V AC on the track.  As scope photo above shows using short PS2 coupler pulse, 220uF is enough to power ~6 bursts at command voltage!  And even with a lower 12V track voltage it still put out 3 bursts...and reliably activates the receiver.  In other words, I think your 100 msec TX time which would be ~3 bursts is long enough.

So, again, I think by simply parallel'ing your 2 track power inputs and a trigger input pair, there is enough energy in the 220uF to release a valid burst in 2-wire self-powered mode!  I'm undoubtedly the only person who finds this exciting...but I've learned to be thankful for the small things in life! 

Attachments

Images (1)
  • PS2 coupler transmission with only 220uF

Mine has the addition of the opto coupler in the path, not sure how that will affect it.

The results are in, doesn't work.  I suspect whatever load/delay the optos inflict are the culprit.  This is the version without the PIC, so it's not in the picture.  This module just had the trigger go through the opto and on to the transmitter module.  I see the pulse, but it doesn't ever trigger the receiver, I don't even see the LED on the transmitter flash at all.  In an interesting twist, just connecting it that way to the transformer works a time or two, then it insists I power the board first and then trigger the transmitter.

This isn't a train control system, it's for remote controlling stuff like accessories, operating cars, switching lights in passenger cars, etc.  The receivers can be triggered by the transmitter described or with a 4-button keyfob, depending on the application.

  

The receivers will be placed in various locations, either on the layout for accessories or in rolling stock, and even locomotives, again depending on the application.

  

Attachments

Images (1)
  • mceclip0
@stan2004 posted:

Of course I'm obsessed with the possibility of a 2-wire self-powered PS2 version.  To that end I reduced the 470uF cap to 220uF as you have in your size-matters module.

What is the actual diagram of what you have working there?  It would seem it would be very simple to make a tiny board plug the transmitter module into.

I was looking at the components to do the transmission without their board, where did you find this little board?  Adding the 8-pin chip and this board is all it would take to transmit the data, a very compact board.  In truth, making the transmitter with our power requirements wrapped around it would be simple if the components and spec sheets were available.

Attachments

Images (1)
  • mceclip0

220uf experiment

The most recent experiment was to replace the 470uF cap with only 220uF as in one of your schematics for the TX side.  Also added was a 4.7K across 5V to simulate the 1 mA draw of a PIC.  Again, this was "only" to see if a 220uF momentarily charged by a brief PS2 coupler pulse can power the TX module for long enough to transmit a valid command.

There are many versions of the TX module, try search "433MHz ASK modulator".  For example:

433mhz ask modulator just over a buck each

As discussed earlier the PIC would then be back to heavy-duty-lifting to generate the 1527 protocol.  I don't see this as particularly heavy lifting since the data rate is only about 1000 bits/sec but then again No Job is so easy...well you know the rest!  I think the bigger challenge is how to create (up to) 1 million unique addresses.  As mentioned I recall you might be able to buy PIC chips with factory-programmed "unique" serial numbers that can be re-purposed.  I'm sure there are other methods as well depending on what kind of programmer you have, etc.

 

 

 

Attachments

Images (2)
  • 220uf experiment
  • 433mhz ask modulator just over a buck each

Add Reply

Post
OGR Publishing, Inc., 1310 Eastside Centre Ct, Suite 6, Mountain Home, AR 72653
330-757-3020

www.ogaugerr.com
×
×
×
×
Link copied to your clipboard.
×
×