Autoswitching between USBasp and Telemetry?

General mods that are considered worth doing; regardless of the end firmware you use.
Post Reply
andrewju
Posts: 784
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Autoswitching between USBasp and Telemetry?

Post by andrewju »

Hi All,

This is not directly related to Smartieparts board (although it is one of the components in this equation), so I thought I would rather post it here. I have a pre-pre-beta of the Smartieparts programmer installed in my 9x. It's the version that was a couple of versions before 2.1, and it's not a completely solder-less solution, as my board doesn't have power line connection, so I had to solder the power manually (which is totally fine with me). It works great, and I'm happy to have USBasp built-in. It was designed to always be connected to the 9x mainboard. And it uses Power, MOSI, MISO, SCK and RST lines - just like any other USBasp device.

My FrSky XJT module is on its way, and I would like to modify my radio to show the telemetry. The issue is that MOSI and MISO are occupied by the USBasp. In fact, XJT's S.PORT needs only MOSI line at present (to receive telemetry data), but MISO may be required later as well.

So, the question is whether it's possible to implement an automatic switching between Telemetry and USBasp? So that when the radio is powered on by its power switch, the Telemetry is connected (default state). And when the radio is powered from a USB port, Telemetry gets disconnected and Smartieparts / USBasp is connected instead, allowing flashing the ATmega.
Another question is shall I switch just the MISO / MOSI lines, or the SCK and RST lines need to be disconnected as well when the programmer is not in use?

I think I need some kind of switch here... Perhaps, something like this. But I just realized we probably cannot easily distinguish between the power by a power switch and the power from a USB port... Hmm... It gets quite complicated...

Yes, I checked with Steven. He says it is too complex / not practical to modify such an old board the way I want it to be. While I understand his point, I would still like to see what are the options to achieve my goal and utilize existing hardware. Also, this might be beneficial for other USBasp and Telemetry owners who want to have everything built in...

Please share your ideas!

P.S. Do I need to switch between USBasp and Telemetry at all? Maybe hooking them up in parallel will just work?
Last edited by andrewju on Fri Dec 20, 2013 5:25 am, edited 1 time in total.

User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Autoswitching between USBasp and Telemetry?

Post by MikeB »

1. When the Smartieparts board is not programming, its outputs should go to three-state. If they didn't you wouldn't be able to use the MENU button as that shares the SCK line, or the THR and AIL switches as they share the MISO and MOSI lines.
2. The Sport signal is inverted logic, so you will need to have an inverting circuit between pin 5 of the module connector and the processor.
3. If you include a resistor (470 ohms) in series with the (inverted) SPort signal before the processor, it will still work, but the programmer will be able to overcome the resistor and still program OK.
4. You will need to do the "telemetry mod" that moves the THR and AIL switch signals to alternative pins.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
andrewju
Posts: 784
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: Autoswitching between USBasp and Telemetry?

Post by andrewju »

MikeB wrote:1. When the Smartieparts board is not programming, its outputs should go to three-state. If they didn't you wouldn't be able to use the MENU button as that shares the SCK line, or the THR and AIL switches as they share the MISO and MOSI lines.
Menu button works just great, as well as the THR and AIL switches - so I guess the outputs do get to the right state.
MikeB wrote:2. The Sport signal is inverted logic, so you will need to have an inverting circuit between pin 5 of the module connector and the processor.
Yes, I saw that and I have planned an inverting circuit already.
MikeB wrote:3. If you include a resistor (470 ohms) in series with the (inverted) SPort signal before the processor, it will still work, but the programmer will be able to overcome the resistor and still program OK.
Wow! That's cool!
MikeB wrote:4. You will need to do the "telemetry mod" that moves the THR and AIL switch signals to alternative pins.
Yep, I already moved these when upgrading my ATmega (and yes, THR and AIL worked before this mod as well!). :)


This appears to be much easier than I expected...

Now, can't wait for the XJT to arrive! :)

Thanks a lot, Mike!!!

Post Reply

Return to “Electronic Mods”