New bug possibly discovered on 9x ("pot no. 3 bug")

Cant get your radio to work? General Hardware issues?
User avatar
KAL
Posts: 552
Joined: Thu Oct 10, 2013 4:36 pm
Country: Germany
Location: somewhere near Rothenburg ob der Tauber

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by KAL »

But please note that there is a little difference:
The horizontal trims ARE tied to analog ground (stock) and should be tied to digital ground
but the pots ARE tied to digital ground and (maybe) should be tied to analog ground!

Klaus
( TH9X / 9XTreme / FrSky DHT / Spektrum / Multi / RotEnc )
( 9XR PRO / erSKY9x  / FrSky DHT / Spektrum / Multi / RotEnc / P3 as Slider )

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

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

Yeah, funny isn't it? :) :o

Lets see what Mike finds with the data we provided. :)

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: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

So far I have no explanation. There are 8 analog inputs, read in sequence, the 4 sticks, the three pots and the battery voltage. The same code is used for all of these.
I do have one idea though. The processor includes a JTAG port, that uses the last 4 analog input pins, so includes all three pots.
P1 is the JTAG clock, while P3 is the JTAG data output.
The JTAG port is only enabled one of the fuses is programmed to a 0. It is bit 6 of the fuse HIGH byte.
If you have this problem on a radio, please read the fuses and see what this one is.
There is a bit in a processor register that could be set that should also disable the JTAG port.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

how to do that on the 9xtreme radio?
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
Nadim
Posts: 101
Joined: Tue Feb 23, 2016 11:42 am
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by Nadim »

MikeB wrote:So far I have no explanation. There are 8 analog inputs, read in sequence, the 4 sticks, the three pots and the battery voltage. The same code is used for all of these.
I do have one idea though. The processor includes a JTAG port, that uses the last 4 analog input pins, so includes all three pots.
P1 is the JTAG clock, while P3 is the JTAG data output.
The JTAG port is only enabled one of the fuses is programmed to a 0. It is bit 6 of the fuse HIGH byte.
If you have this problem on a radio, please read the fuses and see what this one is.
There is a bit in a processor register that could be set that should also disable the JTAG port.

Mike.
Thank you Mike. :)

Forgive my probably electronics-naive question, but would the above mean that P3 also is in theory capable of triggering the issue to P1, namely the opposite of what we have seen so far?

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

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by ReSt »

MikeB wrote: If you have this problem on a radio, please read the fuses and see what this one is.

Mike.
Fuses Hi reads 81 on both radios

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

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

Nadim wrote:but would the above mean that P3 also is in theory capable of triggering the issue to P1
No, P1 is a JTAG input. P3 is a JTAG output, so only P3 will be affected at all.

I'll see if I can post test versions of er9x with the register bit set.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

Mike, the 9xtreme does also have the problem. Can you fix it by flashing the 9x mainbaord using the 9xt?

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: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

I've just posted a test version for the 9Xtreme. This includes a (possible) fix in the 'slave' for this problem.
From the main screen go UP LONG, then then LEFT twice. This gets you to the "Slave Revision" screen. This should show the current revision as 0.3, with 0.4 available. Just press MENU LONG, and the slave will be updated to 0.4.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

Thanks Mike.. Will do 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
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

9xtreme. It actually got worse.
Moving P1 and P2 makes P3 go to full as before. Continue to move P1, P3 jumps between min and max, but now I can't make it recover and work normally, or I didn't find out how to. Need to reboot.
Also, it is much easier to make the problem happen 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
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

OK, another test version of 9Xtreme posted. I found you have to write the JTAG disable bit TWICE to make it change.
The slave revision is still 0.4, but it should write on command anyway.

Mike.

If this problem is caused by the JTAG port, it will likely also depend on your battery voltage as this may determine the apparant logic level on the TDI pin.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

MikeB wrote:
If this problem is caused by the JTAG port, it will likely also depend on your battery voltage as this may determine the apparant logic level on the TDI pin.
I couldn't make it fail now.. will try some more later..

So if it depends on the battery voltage that means that the problem can't be really fixed? :)
My battery voltage at the moment is 7.4V
I am using 6 cell NiMhs pack on this radio..

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
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by ReSt »

I soldered a wire to pin57 (P3 input ) of the processor.
With p3 at minimum position I measure 0.01 Volt on the CPU pin and on the slider of P3
When the error is there, the CPU pin measures 4.44 Volt and the P3 slider 0.05 Volt

That means, that the measured and displayed voltage are correct with respect to what is available on the pin.

It looks like there is a pullup switched on to the input pin

But what I do not understand is, how does it survive a reboot ?

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

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

No, if this problem is the JTAG port, and my change disables the JTAG port, then the problem IS fixed. I'm running from 8 NiMh cells, so have around 10V supply voltage, which is probably giving a logic '1'. 7.4V may give a logic 0..
I've posted a possible fix for the'128 on the test versions thread: viewtopic.php?f=5&t=4598.

ReSt: The 'pullup' is likely the JTAG TDO pin driving out high.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

Thanks Mike.. I misunderstood your post above, hence I asked..

João

P.S. - Out of topic, but having trouble with my 9xtreme bootloader to PC connection since a couple months now.. it was a nightmare to connect to the computer and update the tx now. :( Will continue this on another thread..
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
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by ReSt »

Mike,
flashed with your er9x-128p3 fw and it's still the same
it still fails.

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

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

Sorry, I slipped up and didn't include setting the bit twice. Just about to post a er9x-128p3a !

Mike.

(Posted!)
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by ReSt »

And I agree, P3 input pin is an active output when the failure occurs.
I connected a 220 Ohm resistor to ground and the voltage decreased from 4.44 to 3.98 Volt (1kohm to ground didn't make a real difference on the voltage level)

Reinhard

will test 3a
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by ReSt »

Flashed the P3a version and could not recreate the failure inspite of working hard for several minutes.

BUT
I reflashed the failing previous version and couldn't recreate the failure anymore !!!! (My thumbs got tired from truning the pots)

Is it possible that setting the appropriate bits correctly once, solved the problem forever?

I wil retry later again.
Reinhard
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

My understanding, from the datasheet, is the bit is cleared on power up/reset.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
willhac
Posts: 89
Joined: Tue Feb 19, 2013 11:25 am
Country: France

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by willhac »

MikeB wrote: The JTAG port is only enabled one of the fuses is programmed to a 0. It is bit 6 of the fuse HIGH byte.

Mike.
So is it safer to set the high fuse to C1 ? (eepe sets it to 81)
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

It is an option, but not that necessary. As long as the bit in the MCUCSR register is set, the JTAG is disabled. The bit is also protected, you have to write it twice, within 4 clock cycles, to change it.

I'll change eepe to set the bit in the high fuse anyway.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by ReSt »

My testing with the P3a version shows that I was not able to recreate the faiure during two times of five minutes intensive moving P1 back and forth. (and I could again recreate it with the older version P3).

To me it seems. that this fix solves the problem.

Mike, can you provide me the source code for the fix, so that I can merge it into my privately modified code base?

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

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

Just a few lines into main():

Code: Select all

#ifdef CPUM2561
  uint8_t mcusr = MCUSR; // save the WDT (etc) flags
	SaveMcusr = mcusr ;
  MCUSR = 0; // must be zeroed before disabling the WDT
  MCUCR = 0x80 ;
  MCUCR = 0x80 ;	// Must be done twice
#else
  uint8_t mcusr = MCUCSR;
  MCUCSR = 0x80 ;
  MCUCSR = 0x80;	// Must be done twice
#endif
Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by ReSt »

Mike,
thanks for the fix.

I have applied it to ER9x r218 and Opentx 2.1.7 and it looks like there is no more problem

Reinhard
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by Kilrah »

Included in mainline OpenTX too, thanks...
Impressive that this was never noticed in >5 years...
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by jhsa »

Well, I guess no one wiggles the pots like crazy to fly a model :mrgreen:
But great that someone did ;) :)
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: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by MikeB »

Kilrah wrote:Included in mainline OpenTX too, thanks..
You don't need the:
MCUCSR = 0;
before the:
MCUCSR = 0x80 ; // Disable JTAG port that can interfere with POT3

(saves 2 bytes of flash :mrgreen: ).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
Nadim
Posts: 101
Joined: Tue Feb 23, 2016 11:42 am
Country: -

Re: New bug possibly discovered on 9x ("pot no. 3 bug")

Post by Nadim »

jhsa wrote:Well, I guess no one wiggles the pots like crazy to fly a model :mrgreen:
But great that someone did ;) :)
João
Ah ah, I wasn't flying luckily. :lol:

Probably the reason why nobody had detected it is that (as far as I've heard) there are few people that program something on their P3, preferring P1 and P2 for their convenience due to the position. So even if P3 stopped working during flight, nobody probably noticed it before switching off the TX.

Post Reply

Return to “Hardware”