Warning, a persistent error about TXT and I2C

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Warning, a persistent error about TXT and I2C

Beitrag von vleeuwen » 17 Mai 2019, 22:01

[color= #BF0000 ] Warning, a persistent error about TXT and I2C on the FT-community web sites. [/color]

https://ftcommunity.gitlab.io/website-h ... nsoren.pdf
This page suggests that the 9 pin is 3,3V power supply.
However the 9-pin is the serial-TX and it has no not a power supply functionality!
See also he TXT manual, paragraph "technical data PIN-Belegung EXT"
The level shifter is also missing the 5V power supply.
This way of connecting can damaged your TXT.

To avoid I2C hardware errors, always consult the [url = https://www.nxp.com/docs/en/user-guide/UM10204.pdf ] the one and only offical I2C bible from NXP [/url]; for level shifting see page 43
See also https://reivilofischertechnik.weebly.co ... s-txt.html
[color= #008000 ] NXP is the owner and inventor of the I2C concept. [/color]

See also for [url = https://www.nxp.com/docs/en/data-sheet/P82B715.pdf] the I2C bus extender[/url]

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Warning, a persistent error about TXT and I2C

Beitrag von MasterOfGizmo » 18 Mai 2019, 00:28

Please don't frighten other users without reason.

a) there's a protection circuit inside the txt consisting of a 1k current limiting resistor and an esd protection chip. Thus this pin 9 is protected against short circuits, overloads and even over voltages. You cannot easily harm this pin
b) The page you are referring to is using this pin only to drive the 3.3V side of the level shifter. The only current sink there are two 10k resistors which will draw at most 330µA each. The TX line can easily drive this.

To summarize: It's indeed not the purpose of the TX line to supply the level shifter. But it will work just fine and it will not do any harm to the TXT in any way.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Warning, a persistent error about TXT and I2C

Beitrag von vleeuwen » 19 Mai 2019, 19:17

My preference is: don't give users wrong information. It is also the warning in the official TXT documentation.
And if you do, mention at least why, the risk's and a reference to the official documentation.

An 9 to 3,3V regulator (MB102) is not so expensive, example 2,95E (MB102)
https://www.kiwi-electronics.nl/breadbo ... ption=true
and on Ali-Express even cheaper (1,50 to 0,72) .
Zuletzt geändert von vleeuwen am 21 Mai 2019, 23:47, insgesamt 1-mal geändert.

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Warning, a persistent error about TXT and I2C

Beitrag von MasterOfGizmo » 20 Mai 2019, 15:13

vleeuwen hat geschrieben:My preference is: don't give users wrong information.
Unfortunately you did.

But you are right if you say that the given solution is not very elegant. But it's not necessary to use a separate voltage regulator as you suggest.

Instead there are very cheap i²c level shifters that come with an integrated 5V to 3.3V voltage regulator like this one: https://www.amazon.de/dp/B07PY4RTFQ/. It needs to be supplied with 5V only (which you'll need for your sensor, anyway). The ftDuino's manual explains how to use this to connect the 5V ftDuino to the 3,3V TXT:

Bild

Bild
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Warning, a persistent error about TXT and I2C

Beitrag von vleeuwen » 21 Mai 2019, 01:05

My warning has been based on:
-) The official TXT documentation.
-) The official NXP I2C documentation and application notes.
-) Common practice in developing electronic circuits.

The 3.3/5V dual power regulator compatible with bread boards has no direct relation with a level shifter.

The 3.3/5V dual power regulator is cheap and easy to use; the outputs are stabilized. A signal pin is not stabilized.

I am an experience software- and electronic engineer and developer of didactic material.
My advice will be: keep your experiments clean. Don't start with trics like using a functional output as power supply.
This to develop good skills to avoid: secondary effects, problem and mistakes in the futur.
Also make use of primary information sources for the components like: data sheets and application notes.
NXP has I2C very well and good readable documented.

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Warning, a persistent error about TXT and I2C

Beitrag von MasterOfGizmo » 21 Mai 2019, 08:08

vleeuwen hat geschrieben: This way of connecting can damaged your TXT.
This is simply not true. And i still don't understand which of the following sources supports this claim.
vleeuwen hat geschrieben:My warning has been based on:
-) The official TXT documentation.
-) The official NXP I2C documentation and application notes.
-) Common practice in developing electronic circuits.
BTW: Which official TXT documentation are you referring to?
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Warning, a persistent error about TXT and I2C

Beitrag von vleeuwen » 21 Mai 2019, 09:46

To close this discussion.
It is only a warning.
The readers have now enough information to make their proper choice in how to work.
And also give their proper judgement about the quality of electronic design that they see, would buy or like to reproduce.

Benutzeravatar
Kali-Mero
Beiträge: 595
Registriert: 21 Nov 2017, 12:28
Wohnort: Karlsruhe
Kontaktdaten:

Re: Warning, a persistent error about TXT and I2C

Beitrag von Kali-Mero » 21 Mai 2019, 11:42

Hi Vleeuwen,

I couldn't find a official documentation. But I would be happy to read something about the TXT, if possible. Do you have a link to the document, or isn't it official? That would be nice.

Greetings
Kali

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Warning, a persistent error about TXT and I2C

Beitrag von vleeuwen » 21 Mai 2019, 13:30

The TXT manual is part of the RoboPro installation.
Open the fischertechnik Robotics Terminal and use the tab TXT controller.
Direct access in the installation root directory of RoboPro.
The software is documented on the fischertechnik web site and GitHub\Fischertechnik.

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Warning, a persistent error about TXT and I2C

Beitrag von MasterOfGizmo » 21 Mai 2019, 15:09

The only warning in that document i can find reads "External voltages greater than 3.3 volts could damage the device!". The level shifter from the initial posting does not apply a voltage exceeding 3.3V to the expansion port.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Warning, a persistent error about TXT and I2C

Beitrag von vleeuwen » 21 Mai 2019, 20:15

The TXT description mention two things:
-) The pin 9 is a logical output
-) The pin 9 is operating in a 3.3V logical system.
It does not define that the pin 9 is a 3.3V power supply or always logic high.

A logic output is the opposite of a stabilized power supply output .
A logic output has a low capacity and a low induction. It has not a function to keep the power on a well defined level, just the opposite it has a function the be able to switch very fast.

The logical level of an high signal is also not defined as 3.3V. but 2V to 3.3V, see for example also:
https://learn.sparkfun.com/tutorials/logic-levels/all (3.3 V CMOS Logic Levels)
https://en.wikipedia.org/wiki/Logic_level

The signal level during the execution of a program is also not defined so the assumption that the signal level will always be high is wrong.
This al could influence the I2C signal quality, introducing logical errors or slow down the system

MasterOfGizmo assumption that a logical signal output in a 3.3V system will be 3.3V is fundamental wrong.

https://www.i2c-bus.org/specification/

Karl
Beiträge: 2212
Registriert: 24 Sep 2016, 17:28

Re: Warning, a persistent error about TXT and I2C

Beitrag von Karl » 21 Mai 2019, 20:24

Habe auch eine Frage bezüglich Pegelwandlung(en), allerding in "German".
Was passiert bei den Pegelumsetzern mit den FET-Transistoren als Schalter wenn jeweils nur ein Gerät runter- und dann
wieder hochgefahren wird, insbesondere beim I2C mit seinen Pull-up-Widerständen ?
Sind nicht definierte Zustände an den entsprechenden Ports ausgeschlossen?
Müsste da nicht besser noch eine "Zwischenstufe" vorhanden sein um beim Ausfall eines der Geräte eine
"Isolation", Hochohmigkeit zur Trennung, vorzunehmen.
Meine, fast alle PIO-Bausteine bieten oder boten die Möglichkeit die Ein- und Ausgänge oder Ports in einen
hochohmigen Zustand zu setzen.
Kann mich noch erinnern daß ich früher die Pegelumsetzung mit Transistoren und Spannungsteilern, evtl. unter
Zurhilfenahme von Zenerdioden, verwirklicht habe. Damit habe ich eigentlich nie Probleme gehabt, auch beim
C64 - User-Port nicht und der User-Port war ja schon sehr empfindlich, lange ist es her.

Logische Pegel, H - L, sind jeweils mit einem Spannungsbereich definiert.
Dazwischen ist der "verbotene Bereich", dort sind die H - L - Pegel laut Definition nicht eindeutig
zuzuordnen. Ebenso gibt es Grenzen wie weit die Spannungs-Potentiale in den positiven oder negativen Bereich
wirken dürfen ohne daß die Baugruppen Schaden nehmen.
Als User, welcher die Bausteine bzw. -Gruppen bezahlt hat darf man, (oder frau), natürlich alles machen ohne daß der MikroProzessor, kleiner
Staatsanwalt, tätig wird. Muß er, der User, halt die Sache selbst ausbaden.

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Warning, a persistent error about TXT and I2C

Beitrag von MasterOfGizmo » 21 Mai 2019, 22:09

vleeuwen hat geschrieben: MasterOfGizmo assumption that a logical signal output in a 3.3V system will be 3.3V is fundamental wrong.
I never said that. But what i now say is that the output logic level of any given chip will typically match the thresholds of its own inputs. Otherwise the chip would not work at all. So taking the TX output and feeding it back into the I²C inputs via the pullup resistors will basically always work. And that's what this adapter does.

So we are now from "can damage the TXT" to "may not work reliably"? I am fine with that. This adapter may in theory indeed not work as one expects. But in real life it will work pretty well. And since you won't damage your TXT if it doesn't there's no reason not to give it a try.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Warning, a persistent error about TXT and I2C

Beitrag von MasterOfGizmo » 21 Mai 2019, 22:21

Karl hat geschrieben: Müsste da nicht besser noch eine "Zwischenstufe" vorhanden sein um beim Ausfall eines der Geräte eine
"Isolation", Hochohmigkeit zur Trennung, vorzunehmen.
Da hast Du Recht. Der I²C-Bus wurde nicht zum Anschluss externer Geräte erfunden so wie fischertechnik ihn nutzt. Stattdessen sollte er vor allem in Philips-Fernsehern die unterschiedlichen Bausteine verbinden. Das bedeutet auch, dass ein defektes Bauteil (bzw. dann ja ein defektes Gerät) den ganzen Bus beeiträchtigt. Aber wenn im Fernseher ein Chip kaputt ist erwartet ja keiner, dass der Rest problemlos weiterläuft.

In der Tat passiert das sogar recht leicht, da ja der Pullup mit ggf. 10kOhm recht hochohmig ist und es nicht viel erfordert, dass ihn ein Defekt an einem Client unter die High-Grenze zieht und damit jegliche Kommunikation stört.

Für sowas ist I²C aus diversen Gründen eigentlich ungeeignet. Das fängt damit an, dass man nie weiss, ob und wenn ja welche Pullups ein Gerät mirbringt, geht über die Tatsache, dass man regelmäßig mit Adresskollisionen zu kämpfen hat und endet nicht damit, dass störende Kapazitäten leicht die Flanken zu sehr verschleifen können, zumal der Bustakt und die Pullups variablel sind. Das leidige Clock-Stretching-Problem ist auch so eine Sache. Usw usw ...

Eigentlich sollte bei I²C das ganze System als Stück entworfen und berechnet werden und nicht einfach eine handvoll irgendwelcher Chips zusammengestöpselt werden. Für sowas wurde z.B. USB erfunden. Das hat alle diese Probleme nicht, ist aber deutlich aufwändiger.

Aber hey, solange es meistens geht und solange man dabei nix kaputt machen kann. Warum nicht?
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Karl
Beiträge: 2212
Registriert: 24 Sep 2016, 17:28

Re: Warning, a persistent error about TXT and I2C

Beitrag von Karl » 21 Mai 2019, 22:42

Ist mir auch noch in Erinnerung daß der I2C-Bus eigentlich als "Gräteinternes Bus-System" konzipiert worden ist.
Habe vor ca. 20 Jahren dieses Bussystem auch missbraucht, Einlesen von Daten und Ausgabe von I2C- Bausteinen
mittels CAT-Leitung über 30 m. Allerdings habe ich die Treibe 82B715 auf jeder Karte eingesetzt und wohl mit
geschätzten 100 kBit betrieben. Lief problemlos mit dem damaligen Atmel AT8515 plus dem og. Treiber am TWI-Port,
I2C war bei Atmel aus lizenzrechtlichen Gründen TWI.

Noch ein kleiner Hinweis: Die Philips I2C geben im Grundzustand H-Pegel an den Ausgängen. Somit zogen nach
dem Einschalten erstmal die Relais über ULN2803 an. Abhilfe brachte ein 8-fach TTL-Bus-Inverter zwischen
I2C-Portexpander und dem ULN. Dadurch waren bei Nichtansteuerung oder ausgeschaltetem
Mikrocontroller die Relais inaktiv.
Müsste noch irgendwo ein- oder zwei Karten von damals rumfliegen haben, ein kpl. Steuergerät habe ich noch.

vleeuwen
Beiträge: 1557
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: Warning, a persistent error about TXT and I2C

Beitrag von vleeuwen » 21 Mai 2019, 23:24

De TXT is natuurlijk aan vele kanten beveiligd tegen beschadiging door de hoofd gebruikersdoelgroep. Maar voorkomen is beter dan genezen.
Als je hete kolen ziet liggen dan weet je ook dat sommige mensen er overheen kunnen lopen, maar als je de achtergrond van de truc niet kent dan verbrand je vaak wel je eigen voeten;
vandaar dat er dan het bijschrift bij staat: "doe dit niet zonder toezicht van een deskundige en doe dit zelf ook niet thuis".
De gegeven oplossing waar ik commentaar op lever, komt met deze beeldspraak overeen.
Door de gegeven oplossing zonder enig toelichting en voorbehoud te presenteren als de normaalste gang van zaken, zou ook de geloofwaardigheid en kwaliteit van dit forum aangetast kunnen worden.
Zoals ik al eerder opgemerkt heb, het is aan de forumgebruikers om aan deze discussie hun eigen conclusie aan te verbinden.

Benutzeravatar
MasterOfGizmo
Beiträge: 2720
Registriert: 30 Nov 2014, 07:44

Re: Warning, a persistent error about TXT and I2C

Beitrag von MasterOfGizmo » 22 Mai 2019, 08:56

vleeuwen hat geschrieben:Als je hete kolen ziet liggen dan weet je ook dat sommige mensen er overheen kunnen lopen
So you now compare using I²C on the TXT with walking over hot coals ...

Ok, you got me convinced. Using I²C on the TXT _is_ extremely dangerous and should be avoided by all means. I suggest getting rid of the TXT and instead buy a device that's better suited for I²C usage like the Arduino or the Raspberry Pi. Both support I²C much better than the TXT, there are many examples how to use I²C on them and there's a huge community supporting this.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32

Benutzeravatar
fishfriend
Beiträge: 1789
Registriert: 26 Nov 2010, 11:45

Re: Warning, a persistent error about TXT and I2C

Beitrag von fishfriend » 22 Mai 2019, 10:38

Hallo...
Kleine Zwischenfragen

Ich gebe zu das ich nicht alle Dokus ganz gelesen habe, aber
-Hängt nun hinter dem "+3,3V Pin" vom TXT ein UART mit 3,3V?
-Muss nicht GND durchgeschleift werden?

Ich gebe zu das ich auch zwei Converter genommen hätte. Ich hatte bisher noch keine Mischung von 3,3V und 5V am I2C.
Gruß
fishfriend
Holger Howey
ft Riesenräder PDF: ftcommunity.de/knowhow/bauanleitungen
TX-Light: Arduino und ftduino mit RoboPro

juh
Beiträge: 903
Registriert: 23 Jan 2012, 13:48

Re: Warning, a persistent error about TXT and I2C

Beitrag von juh » 22 Mai 2019, 10:55

MasterOfGizmo hat geschrieben:
vleeuwen hat geschrieben:Als je hete kolen ziet liggen dan weet je ook dat sommige mensen er overheen kunnen lopen
So you now compare using I²C on the TXT with walking over hot coals ...
No, he didn't, he used an analogy.

I find this discussion fruitless. It seems to me you are consciously trying to not understand vleeuven's point. He's just saying that novices might come to false conclusions from the given example, even if the specific example might work alright. Let's call the example (using the TXT pin as 3,3V source for the level shifter) a "hack" and add a proper warning about its limits, and all is well.

Jan

Benutzeravatar
EstherM
Beiträge: 1466
Registriert: 11 Dez 2011, 21:24

Re: Warning, a persistent error about TXT and I2C

Beitrag von EstherM » 22 Mai 2019, 11:38

Hallo zusammen/ hi all
[Start of moderator mode]

I would you like to ask all contributors to this topic to write in English, because this topic has started in English. In my opion, doing otherwise is unfair to the orirgnal author or the readers. If you prefer to write in German, Dutch or whatever, please start a new thread or ask someone for help. Thanks.

[End of moderator mode]
I am quite impressed, that this file, which has already been on the ftc website for more than three years now attracted so much interest, once it has found a place at the prototype of the new website. There is a clear warning message at the file download page.
I doubt that anybody who is not familiar with electronics will experiment with this circuit.

German translation:
Ich bin beeindruckt, dass diese Datei, die schon seit mehr als 3 Jahren auf der ftc-Webseite existierte, so viel Aufmerksamkeit erhält, nachdem sie jetzt auch im Prototypen zu finden ist. Bei jeder Download-Datei steht ein deutlicher Warnhinweis.
Ich persönlich bezweifel, dass ein Anfänger mit dieser Schaltung herumexperimentieren würde.

Gruß / Regards
Esther

Antworten