9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Cant get your radio to work? General Hardware issues?
ReSt
Posts: 1540
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by ReSt » Mon Jul 08, 2013 9:27 am

Maybe I found, why my radio does not reboot with the trim buttons.

I tried to measure the inductivity from the trim switch ground to the plane ground. And my instrument (0.001uH resolution) does show 0.000 uH

I believe we are talking about one of the two small black blocks near the lower left edge of the processor ?
Directly measuring them (while soldered in) does also show 0 uH for both.

What about, if in the working radios, there are 0 uH inductivities soldered in?

Reinhard


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

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by MikeB » Mon Jul 08, 2013 10:25 am

Possible, doesn't explain why a M64 board works OK until the processor is replaced.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Bill
Posts: 195
Joined: Thu Jul 04, 2013 5:54 pm
Country: -

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by Bill » Tue Jul 09, 2013 9:00 am

OK has anyone with the problem done the modifications is it a fix??
“A good politician is quite as unthinkable as an honest banker”
They used to say "if you don’t want to work at McDonald’s, go to college." Now they say "if you want to work at McDonald’s, go to college.”

User avatar
gohsthb
Posts: 1412
Joined: Wed Dec 28, 2011 2:32 pm
Country: -
Location: Naperville, IL

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gohsthb » Tue Jul 09, 2013 9:55 am

Flaps did the mod originally, and said it worked. I also did the mod, and it fixed mine. I would recommend every one do this mod. Even if your testing shows that it works. According to my simulation, it shouldn't work with any processor.
-Gohst

Sent from my LG-P999 using Tapatalk 2

User avatar
Flaps 30
Posts: 1490
Joined: Tue Dec 27, 2011 6:04 pm
Country: -
Location: Wokingham Berkshire

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by Flaps 30 » Tue Jul 09, 2013 12:38 pm

Bill wrote:OK has anyone with the problem done the modifications is it a fix??
Yes it is a fix. Both of my transmitters have been done, along with fitting a higher rated five volt (7805) regulator in both as an insurance policy, as I have the higher current draw M128's fitted instead of the lower power (and cheaper) M128A.

The trim fix pictures ----> http://openrcforums.com/forum/viewtopic ... =30#p52593


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

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by MikeB » Sun Aug 04, 2013 4:44 pm

Just for information I've finally installed my main board with a M128 (not 128A) on it, into a Tx and don't seem to have any reboot problems with the horizontal trims. So many mods and connections to do I haven't got round to the trim mods, but I will be fitting them before I use the Tx for flying.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

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

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by MikeB » Sun Aug 04, 2013 9:11 pm

Thanks Flaps, I used your pictures to do the mod, only difference is I have a SM resistor kit so I used SM resistors!.

Just starting to fully test the M128 Tx. I'm noticing there is more jitter on the Analog values compared to the M64. Anyone else seen this?
It is the standard M128 (not A) so maybe it is due to the extra current load on the 78L05.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 19294
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by jhsa » Mon Aug 05, 2013 1:44 am

how do you check that? Mine look normal.. Mike, do you have a pic from your trims mod with the SM resistors?

Thanks,

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

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

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by MikeB » Mon Aug 05, 2013 8:27 am

Not pictures! All I did was use Flaps30s' pictures, cut the tracks where the red lines are and solder some 0805 1K resistors across the cuts.

Both the values on the ANA screen, and the values of the servo outputs on the main screen have the last digit changing a lot, you can't read the value as it is just a blur. The M64 board is fine, the numbers don't jump around.

Maybe the inductor filtering is wrong on the board, which is why the trims didn't cause a reboot!

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 19294
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by jhsa » Mon Aug 05, 2013 9:38 am

Hi Mike, thanks..
I just checked the ANA screens on both my radios and they don't seem to be that bad..
In the ANA screen I could stop the oscillation by touching the sticks and pots. That makes me believe that it's is caused by the bad quality of the pots.. Also no numbers changing on servo screen.. I never experienced any rebooting with my radios until now..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by LTMNO » Tue Aug 13, 2013 7:04 pm

Well, all sounds exciting from the trials and tribulations of this M128 upgrade... I just ordered 2 chips myself...
From what I gather, these are the right ones...ATMEGA128A (IC MCU 8BIT 128KB FLASH 64TQFP)
Should arrive in a few days... and will let you know of the outcome...

One question.. is this the chip to buy?

http://www.digikey.ca/product-detail/en ... ND/1886206
Custom 9x with M64/Telemetry Mod

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

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by MikeB » Tue Aug 13, 2013 10:06 pm

Should be fine.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by LTMNO » Tue Aug 13, 2013 10:08 pm

Good stuff. :-)
Custom 9x with M64/Telemetry Mod

User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gruvin » Thu Aug 29, 2013 1:20 am

Thought I'd check in on this subject -- thanks to Tom in Aussie for bringing it to my attention.

Here's my few cents worth on the topic ...

1. I have never personally experienced the trim-crash problem. I have one client (Tom) who has had it on a G9X v4.2 board, which was replaced. My understanding is that the replacement board solved the problem. However, I believe he also has a board with an ATmega128 chip, which has the trim crash problem. (Hope I haven't got that wrong, Tom.) I still have the returned, faulty G9X board here and have confirmed the fault. But I never really got the time or inclination to investigate further. Now that I've seen this forum thread, I may have to do so, just to try and get all the way to the bottom of this mystery.

2. Whilst the resistor insertion trick certainly appears to get around the trim-switch crashing problem, it absolutely should NOT be required. Something else is wrong. I cannot stress this enough. This SHOULD NOT be required, at all. Obviously though, you have to do whatever works, in the meantime.

EDIT: Addressing this issue further; Some time back ...
MikeB wrote:NOT replacing the existing resistors, they are AFTER the de-bounce capacitor.
Adding a resistor in the wire from the trim switches will drastically reduce any spike caused when switching. Not having a resistor is, in my opinion, poor design.
The only current consumption in question here is the shorting of the capacitor to ground, by the trim (and other) switches. There can be no spike on the power rails from this. There could be an electromagnetically induced current in other wires -- inductively coupled. But that would be very short in duration and, very small. That said, if the Vss-to-AVss short is present, then there is a fairly decent sized ground loop in the wiring loom, which I guess could pick up such a spike. Seems very unlikely to me to be anything like what would be required to interfere with the MCU, though. And why not on the '64 chip?

In this case, all capacitor discharge current goes through a big fat, mechanical switch, only. This does introduce some potential for anomalous spikes, should there be ground loops involved -- as indeed there is, with Vcc shorted to AVcc on some '9X trim switch PCBs. But this should at worst only present noise on the analogue input ports. (More on this below.)

That said, the fact that inserting current limiting resistors does appear to solve the problem, I have to concede that there is some possibility of this transient spike being an issue. For the life of me however, I cannot see how and I cannot concur that it is, "bad design". All else being as it should be, no current should be sourced from ANY supply rail, through this. Hence, no spike -- except maybe on AVss. But IMHO, that should not cause a crash, either -- unless the chip is faulty in some manner, either by design or during fabrication.

3. I have three Turnigy branded, "V2" 9X radios and one FlySky version. The second "V2" Turnigy branded radio I bought was the one I installed the G9X v3.2 board into. Only on that radio, there was this issue on the right hand trim switch PCB (looking from the back, with the case off) where it turned out that an error in the PCB design had digital ground and analog ground shorted together, under the white wire loom connector. The other three radios I bought did NOT have this problem.

So then, some trim switch PCBs have the shorting error and some (most?) do not -- with no apparent way of telling the difference, by just looking.

The ONLY reason I had to correct this error was because for the G9X v3.2 board (only), I changed the circuitry for reading the 13 switches (navigation x 6 and trim x 8) from 13 individual I/O pins to a 4x4 scanned matrix, using just 8 I/O pins, in order to free up I/Os for the SD card interface. This required being able to switch four virtual grounds on and off in a scanning, round-robin fashion. Having one of those grounds shorted to AVss foiled that plan.
I never actually checked the first Turnigy radio -- the one I originally hacked to make it do telemetry. That main board has since been destroyed (parts robbed off it etc) and the radio itself dismantled for spare parts. Looking in the junk drawer now, I have no idea which trim boards are which. 4. Having digital ground (Vss) connected to analog ground (AVss), however in error that may be (and it is) absolutely should NOT cause these trim switch system crashes. At worse, it should only introduce a little more noise on the analog input ports -- sticks and pot readings -- especially if using lower frequency radio modules, like 40 or 72MHz, perhaps. I have never witnessed a problem, using 2.4GHz modules -- not that I had very long to test that, since I fixed the problem on the bench, before using that radio in the field.

These switch inputs do not generate any interrupts. They are merely polled, in low priority MCU time. There is therefore no opportunity for noise on these inputs to cause a system crash -- not withstanding a faulty chip, perhaps. That said, all eight PORTJ inputs on the G9X v4.x boards do support pin-change interrupts. But there is no code anywhere in the firmware that enables those, far as I can or have ever seen.

4a. Yes, there are two inductors involved in this -- larger black casings (0805 size, I think) -- each 10uH in value and both near the MCU chip. These inductor RF-isolate the analogue supply rail from the digital rail. That is, they filter out high frequency noise that may be present on the digital supply rails, for the express purpose of making analog reads as less noisy. This is especially important for the ARef input, which is the reference voltage for the analog converters. One inductor is on the +5V rail (Vcc) and the other is on the ground (Vss). They connect Vcc to AVcc and Vss to AVss, respectively.

The error on some trim PCB's, shorts Vcc and AVcc/ARef together, through the wiring loom, at the right hand (from rear) trim switch PCB. The error is directly beneath one of the white wire loom connectors, which has to be removed to effect correction. Again though -- this error does not really need correcting, in practice, in our case, as far as my experience confirms. It certainly would not lead to system crashes, in and of itself.

5. When developing the firmware to make the ATmega2561 and '2560 chips work, I/we came across a number of anomalies, compared to the '64 chip and also at odds with the '256x data sheet. In other words, there are bugs in the design or fabrication of the chips I am using, which sourced from DigiKey -- not off eBay.

There are at least two places in the firmware where this has had to be worked around ...

5a. One relates to the PWM hardware in the chip and its relation to the normal I/O pin operation. We cannot read the current output status of a PWM output pin when in PWM module, hardware driven mode, on the 256x chips. But we can on the '64 chip and the datasheet for the 256x chips says you can. Further more, when I first reported this, at least one commenter came back to say that they has runs tests and could not duplicate this fault. (See my comments below about potential, "Chinese knock-off" chips.)

5b. The other bug is also relating to the PWM generator, used in this specific case to drive the PPM_OUT pin. The internal timing of timer output compare match to actual pin toggling is off by +/- a couple cycles (depending on toggle direction) on the 256x chips. It is not off at all on the '64 chip. This first showed up as errant timing in the DSM2 125,000bps signals, was later confirmed in standard PPM mode if the hardware switching mode is used and needed an annoying coding work-around to correct the timing.

5c. Again, in both cases here, how the chip actually operates is at odds with how the datasheet says it should. Is it possible that some of us have ended up with Chinese knock-off chips? Or are all '256x and possibly '128 chips, given the reports in this thread, having some internal faults?

I should note that the one G(X board that has been reported to have the trim switch error was from the second batch of G9X boards we had made in China, by the second supplier. Both suppliers claimed to be using, "100% manufacturer original parts" -- but in this batch, ALL the 1.22V reference parts were completely stuffed and needed replacing. So I can't believe them. What I am saying here is that we have no way of knowing if the chips on those boards were in fact genuine Atmel parts, having passed all QC checks. The same goes for chips bought off eBay - especially rom Hong Kong or China. (I'm just saying. It's possible.)

My own field radio uses a board from that same, second Chinese batch though and does not have the trim-crash issue.

5d. Neither of these PWM/Timer related issues should have anything to do with trim switches causing crashes and they certainly do not explain why some folks are seeing problems with the '128 chip -- unless that chip has the same, potentially faulty design. However, once you find one bug in a chip, you can't help wondering if there are others -- or indeed if the chip is a knock-off, with errors.

6. If a digital input, such as those being used for the trim switches, happens to be configured as an OUTPUT in the firmware, then with a 200 ohm or even maybe as high as a 1K ohm resistor in series (or no resistor) the pin WILL still operate as a input, in this circuit. Obviously however, that input signal will clash with the digital high (+5V -- current limited) output is and will cause an internal high current loading, "short circuit". This causes excessive heating in part of the chip and, importantly in this case, loads down the Vcc power supply rail, potentially causing a system crash through the accompanying spike -- especially given that the 5V regulator in this circuit is only rated to 100mA.

I have had this exact error in firmware, several times in other projects. Inserting a higher value resistor will limit the current of the internal, "short circuit", possibly to the point where the spike is no longer sufficient to cause a crash. But everything else appears to work correctly. If a switch is held down (input held low) then the chip will become noticeably warm or even hot to the touch, but otherwise keep on trucking.

If I had to guess -- faulty Chinese clone chips not withstanding -- I would be looking here first. So lets do that ...

6a. opentx r2741/targets/gruvin9x/board_gruvin9x.cpp: Line 60: ...

Code: Select all

 DDRJ = 0x00;  PORTJ = 0xff; // 7-0:Trim switch inputs
... correct. PORTJ is all inputs, with internal pull-upss on.

Well then, assuming readers with this trim switch problem are using a G9X v4.x board and opentx -- as I am -- then errant firmware is not the problem. Indeed, I do not experience the problem. But there are surely other variables at play and I haven't even looked at code written for the '128 chip.

It would be good if someone else could triple-check the firmware (th/er/openXx) relating to whatever I/O port it is where this trim switch crash problem is occurring, just to be certain that the I/O pins in question are in fact configured correctly -- IE. not as outputs and with internal pull-ups on, as in the code sample above. However, we know there is at least one G9X v4.2 board where the fault occurs.

If that's all good -- and I suspect it is -- then I'm going to lay a bet on the idea of Chinese knock-off chips having polluted the market place. Proving that could take a lot of energy ... unless perhaps someone who definitely has the trim switch crash problem could go to the expense and trouble purchasing a known genuine chip directly from Atmel's online store and seeing if that fixing the problem -- or informing us that they already have a known genuine chip and it's still got this problem.

EDIT:
In summary then, it seems to me that only thing left to have checked would be for someone who has the trim-crash problem and who can confirm also having the Vss-to-AVss short on the right-hand (viewed from back) trim switch PCB, to remove and remedy that fault, then test for the trim-crash fault again -- without the 1K resistors inserted. Personally, I cannot see the crash problem being fixed by simply removing that errant Vcc-to-AVcc short. But I've been wrong (many times) before and it would seem this particular route has not yet been tried.

I'm still backing faulty chip design and/or fabrication -- possibly due to Chinese knock-offs as the most likely, true cause. Then again, we have more than fifty G9X v4.2 boards out there -- with Atmega2560's on them -- that do not have appear this trim crash problem. At least one does. Maybe it just comes down to some people having the shorted Vss-to-Avss problem and most folks not?

Failing all that, let's just all go buy a Fr-Sky Taranis! :-P (I don't have one yet, fwiw. can't yet afford it.)

Regards,


Bryan
aka Gruvin.
Last edited by gruvin on Thu Aug 29, 2013 1:59 am, edited 6 times in total.

User avatar
gohsthb
Posts: 1412
Joined: Wed Dec 28, 2011 2:32 pm
Country: -
Location: Naperville, IL

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gohsthb » Thu Aug 29, 2013 1:48 am

Bryan, go back to post #86 of this thread. Mike B points out that there is no digital ground for the horizontal trims. When one is switched this causes the voltage to ring from very high to very low. This seems to cause the reset. For unknown reasons the m64 is unaffected.
-Gohst

User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gruvin » Thu Aug 29, 2013 2:04 am

gohsthb wrote:Bryan, go back to post #86 of this thread. Mike B points out that there is no digital ground for the horizontal trims. When one is switched this causes the voltage to ring from very high to very low. This seems to cause the reset. For unknown reasons the m64 is unaffected.
-Gohst
I can't see any post numbers anywhere. How do I get to that post, specifically? But have I coincidentally addressed that in my just now posted edit?

There is a digital ground (EDIT: for ALL switches) on all my radios. EDIT again. I better double-check that, actually. Just having lunch. Will get back soon.

EDIT: Ignore the rest of this post (due wrong assertions), except for historical reference. Move onto the next ...

The only difference is that on one of them, it was also shorted to analog ground. Or is there there another version of this circuitry out there? (Bear in mind that I have tried everything I can think of to reproduce this fault and cannot -- except on the one board returned with it already present.)

If there's no digital ground, then how can the voltage be pulled from very high to anywhere, let alone very low?

Even if there was only analog ground, it doesn't change anything. The DC signal would still be sinked down through the Vss-to-AVss inductor.

I know -- putting resistors in WORKS. Not denying that. Just don't believe the reason it works is quite what we've been thinking, so far.
Last edited by gruvin on Thu Aug 29, 2013 2:25 am, edited 1 time in total.

User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gruvin » Thu Aug 29, 2013 2:20 am

Finished lunch.

You know, if there is no digital ground getting to the switches at all (as opposed to one being there and also shorted to AVss, as I have so far asserted) then there is indeed a big problem. It would mean there could be a very high voltage back EMF spike generated from the AVss 10uH inductor, when the switch is released and said inductor discharges. That would surely be sufficient to propagate through the internal circuitry and spike the MCU.

So give me a while to pull a radio apart and confirm this. Will get back soon ...

User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gruvin » Thu Aug 29, 2013 3:23 am

Geoff, you -- and Mike B but I somehow missed it -- have nailed it. Guess what?! ...

There is indeed no digital ground connected to ONLY the HORIZONTAL trim switches. The vertical trim switches get digital ground, while the horizontal ones get only analog ground, which is then passed on up to the pots.

So that's the problem then, for sure now. It also explains why multiple switch presses cause a crash, while holding them down does not. This effect was not satisfactorily explained in previous posts, to me anyway. I'll bet money that a crash occurs only when the switch is released, too.

My confusion clearly came about from assuming that ALL trim and navigation switches would be using the SAME ground circuitry. OMG they are not! So ironically, the problem I originally found when making my G9X v3.2 board work is ultimately the very same issue that causes this other problem.

Inserting the resistors appears to work well enough, by limiting the initial inductor magnetic flux (inductor charge). But it's not in fact addressing the real problem, which is now clearly a back EMF discharge spike from the AVss inductor. But there will still be a spike. Just not quite so big. So it's still not good.

This is just how the spark coil in (especially older) motor vehicles works. Charge a coil at 12V (in that case) and then, when the charge current is disconnected -- by distributor points opening or us releasing our trim switch on our radios -- a back EMF discharge is caused by the very rapidly collapsing magnetic field around the inductor coil. That little 10uH inductor we are using is tiny compared to a motor vehicle coil. But we don't need 33,000 Volts, just to spike our little MCU, either!

So what's the REAL fix?
I'll try to describe it here in text, briefly then get some pictures uploaded after I actually do it.

On my FlySky field radio and at least one of my Turnigy sets, the digital ground wire (from each 12-pin JST connector) is grey and the analog ground is orange. (Some radios of this breed use different colours.)

Procedure (tested on FlySky TH9X radio, with G9X v4.2 board) ...

Step 1.
Remove the two horizontal trim switch PCBs.

Step 2.
Cut the PCB trace that runs from the middle, red wire (common ground in fact, even though its red!) of the two 3-pin connectors on the trim switch PCB, to the trim switch common ground. Do the same for both horizontal trim PCBs. The layout is slightly different on each horizontal trim board. Adjust where you cut accordingly. On the left board (viewed from the back) you will have to cut tracks on both sides. The right hand board (some version of it anyway) require a single cut, on the under-side (opposite side to components.)

Note that there are at least two versions of at least one of these PCBs in existence -- not including how the left and the right are each a little different!

Step 3.
Cut the orange wire where it enters the white, 6-pin wire-to-board header on the removed horizontal trim PCB, as close as you can to the white header, to leave the wire as long as possible.

Do the same for both horizontal trim PCBs.

- - -

In steps 2 and 3, we broke the link running from the two (digital) trim switch grounds, to the two (analog) stick pot grounds -- and disconnected the incoming analog ground (orange wire) entirely, just for now.

In the following steps, we will connect the correct digital and analog grounds to where they should always have been ...

Step 4.
Note where the grey wire goes to on the nearest VERTICAL trim switch board. It should be the middle of the 3-pin wire-to-board header and also the common ground of those two trim switches. Solder a new wire (preferably grey or black) between that vertical switch board's common ground and the pin on the removed horizontal trim board, where the orange wire used to go. Just solder it to the pin on the back of the board. Don't try to solder to the remains of the orange wire.

Do the same for each horizontal trim board, using the nearer vertical trim board as the source for digital ground (grey wire) in each case.

Step 5.
Solder the loose end of the orange wire you cut in step 3 to the common ground pin of the two 3-pin white headers, which go off to each of the nearest stick pots. NOTE: This is NOT the black wire on my radio, but the RED wire, in the middle. That is, do not assume ground equals black, in this case. Red (-ve) and black (+ve) are reversed! (Yeah. I know eh?!)

Do the same with the loose orange wire on the other horizontal trim switchboard.

Step 6.
Lock down the newly soldered wires with hot-glue, to act as cable strain relief. This will prevent the wires breaking way at the brittle solder joint, during future movements within the radio -- mods, etc. This is not optional. It's important. Trust me. ;-)

Step 7. (optional)
If you previously installed them, then remove the additional 1K resistors you added and re-bridge the cut track. This is essentially optional, but those resistors should no longer be needed.

I strongly recommend that ALL Turnigy radio owners perform this corrective patch -- even ATmega64, stock versions.
right bottom side.jpg
View of left trim board, as viewed from back of radio
"analog ground" refers to the new position for the orange wire.

left top side.jpg
View of left trim board, component side, as viewed from back of radio
left bottom side.jpg
View of right trim board, as viewed from back of radio
- - -

An alternative, quick and dirty patch would be to install a reverse EMF capture diode across the AVss, 10uH inductor -- cathode to AVss and anode to Vss. This is the same sort of thing done for relay coils, to prevent back EMF spikes. I won't be trying this one, but it should prevent system crash spikes from using the horizontal trim switches, without doing the above mod and without the 1K series resistors (which otherwise do no harm).

Even quicker/dirty mod -- short out the Vss-to-AVss inductor. I doubt anyone would notice any additional noise on their gimbals or pots, in practice -- especially with only 2.4GHz radio modules in use. It's not ideal, but neither is leaving the radio's wiring wrong, as it is from the factory. A little noise versus a system crash from using trims? It's a no brainer.
Last edited by gruvin on Thu Aug 29, 2013 7:54 am, edited 4 times in total.

ReSt
Posts: 1540
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by ReSt » Thu Aug 29, 2013 7:29 am

What I mentioned above as possible reason for my board to NOT have the problem:
I tried to measure the inductivity from the trim switch ground to the plane ground. And my instrument (0.001uH resolution) does show 0.000 uH
Should I have measured anything at the in circuit inductivities or must an iductivity be desoldered to be measured?

So if it is possible, to measure the inductivity while in circuit, my inductivities seem to be no inductivities.

Reinhard

User avatar
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by Animal60 » Thu Aug 29, 2013 7:48 am

Good job Bryan,
looking forward to some pictures
Tom.

User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gruvin » Thu Aug 29, 2013 7:52 am

ReSt wrote:What I mentioned above as possible reason for my board to NOT have the problem:
I tried to measure the inductivity from the trim switch ground to the plane ground. And my instrument (0.001uH resolution) does show 0.000 uH
Should I have measured anything at the in circuit inductivities or must an iductivity be desoldered to be measured?

So if it is possible, to measure the inductivity while in circuit, my inductivities seem to be no inductivities.

Reinhard
There are capacitors to ground in the circuit, too. So it's unlikely you could get a proper reading on your inductance meter, since those would look like dead shorts to the meter -- 99% sure.

I think the reason some (most) people don't see the problem is just dumb luck. Cooler weather conditions even, possibly. Variances in internal chip track widths and thus tolerance to spikes and that sort of thing. In fact, I'm pretty sure the 128 and 256x chips, being later editions and all, are manufactured used smaller structures. (Does anyone reading this know for sure?) In any case, these sorts of transient spikes are clearly quite unpredictable.

It is my opinion however that every radio wired as they are from the factory will be at least putting undue stress on the MCU, when the horizontal switches are used. If they are not crashing now, they might begin doing so one day. It's impossible to know for sure. All we can do is put things how they ought to be, to eliminate the issue from the get go.

Gruvin.

User avatar
gruvin
9x Developer
Posts: 131
Joined: Tue Jul 24, 2012 10:02 pm
Country: New Zealand
Location: Auckland
Contact:

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by gruvin » Thu Aug 29, 2013 7:53 am

Animal60 wrote:Good job Bryan,
looking forward to some pictures
Tom.
Pictures added. Some edits to the instructions/procedure text also made.

Sorry it took me so long to get a grip of this. Thanks to everyone who has offered input to date. Looking forward to feedback from someone with 1K resistors, to say they removed them, did the above and all is good. Until then, I'll likely sleep a few minutes less quality sleep each night. :-P

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

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by MikeB » Thu Aug 29, 2013 8:39 am

I'm not sure the 'worst' problem is when you release the switches. When you press the switch, a capacitor charged to 5V is 'instantly' connected across the inductor, thus causing a rapid change in current flowing through the inductor (the 1K resistors reducing this current). When you release the switch, the current through the inductor doesn't change suddenly. There is already current flowing from the internal pull up resistor, and this reduces as the capacitor across the switch charges up.
This is why I came up with the 1K resistors.
I personally don't like the capacitors directly across the switches, they are too far away as well so when they discharge there is a current spike through several inches of wiring. I believe all the switches should have 1K resistors (MENU, EXIT and DIRECTION as well).
(I haven't had a chance to read your mod in detail yet!).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Animal60
Posts: 21
Joined: Mon Aug 26, 2013 9:31 am
Country: -

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by Animal60 » Thu Aug 29, 2013 2:33 pm

I have modified a 9X radio with a M128 that i had fitted resistors to, I removed the resistors and performed the horizontal trimmer rewire as described by GRUVIN. :roll:

And guess what it worked! just about wore the trimmers out through continuously switching; did not reboot at all. :mrgreen: :mrgreen:

all good
Tom.

User avatar
Bill
Posts: 195
Joined: Thu Jul 04, 2013 5:54 pm
Country: -

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by Bill » Mon Sep 02, 2013 7:40 am

Thanks Bryan,
For doing the mod and proving it works.
A much more logical cure.
“A good politician is quite as unthinkable as an honest banker”
They used to say "if you don’t want to work at McDonald’s, go to college." Now they say "if you want to work at McDonald’s, go to college.”

WendoNZ
Posts: 50
Joined: Fri Dec 21, 2012 4:00 am
Country: -

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by WendoNZ » Mon Sep 16, 2013 6:58 am

I've just performed the same fix. I have a gruivin9x board installed and could get it to reboot about 10-20% of the time I used the left stick and used the right horizontal trim.

After the fix I also notice much more solid stick readings on the radio setup menu and from withing the channel setup menu in model setup. They used to move about a little with the sticks not moving at all, now the readings only change as I move the sticks.

I find myself wondering if it's only those of us with "noisy" TX's that even see the reboots at all?

User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by LTMNO » Tue Sep 17, 2013 1:10 am

I haven't done the fix yet.. but confirming that my newly moded M128 Stock 9x board does in fact reboot after the update when making adjustments on the Trim.
I will disable the trims in the Mixer as I fly MultiRotor but I know that doesn't change anything, i still need to make the fix... just contemplating the 1k Resistor or the other mod.
Custom 9x with M64/Telemetry Mod

cae
Posts: 45
Joined: Thu May 17, 2012 10:20 am
Country: Australia
Location: Sydney,NSW

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by cae » Tue Sep 17, 2013 1:33 am

LTMNO wrote:I haven't done the fix yet.. but confirming that my newly moded M128 Stock 9x board does in fact reboot after the update when making adjustments on the Trim.
I will disable the trims in the Mixer as I fly MultiRotor but I know that doesn't change anything, i still need to make the fix... just contemplating the 1k Resistor or the other mod.
Very interesting, I fitted M128 chips to two TX's three days ago, and no matter what I do I can not get either to reboot while using horiz. trims.
I used M128A chips sourced from Farnell in Australia, did you use M128 or M128A?

I will do the Gruvin mod, but I wonder why some TX's have the problem and some don't.

Colin.

User avatar
LTMNO
Posts: 1049
Joined: Fri Nov 30, 2012 9:31 pm
Country: Canada
Location: Toronto, Canada

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by LTMNO » Tue Sep 17, 2013 1:51 am

Hi cae, I used the M128A chip...
I am going to configure out my switches and such... and then choose which mod to do, I still have a bit of time before I get out flying again, at least til the weekend. ;-)
Custom 9x with M64/Telemetry Mod

cae
Posts: 45
Joined: Thu May 17, 2012 10:20 am
Country: Australia
Location: Sydney,NSW

Re: 9x upgrade to ATmega128A3-AU + Reboot With Horiz Trims

Post by cae » Tue Sep 17, 2013 2:03 am

OK, thanks, it does not look like the "A" chip is the difference then, will have to keep looking.

I will be fitting a 2561 to another TX, maybe to-night, I will see how that goes.

Colin.


Post Reply

Return to “Hardware”