I²C für Einsteiger...

Alles rund um TX(T) und RoboPro, mit ft-Hard- und Software
Computing using original ft hard- and software
Forumsregeln
Bitte beachte die Forumsregeln!
Antworten
Benutzeravatar
Dirk Fox
ft:pedia-Herausgeber
Beiträge: 1832
Registriert: 01 Nov 2010, 00:49
Wohnort: Karlsruhe
Kontaktdaten:

I²C für Einsteiger...

Beitrag von Dirk Fox » 10 Apr 2012, 23:55

Hallo Computing-Experten,

gibt es unter Euch jemanden, der Lust und Interesse hätte, die ft:pedia mit einem (mglw. mehrteiligen?) Beitrag über die Möglchkeiten, via I²C-Bus andere Sensoren oder Aktoren an den TX anzuschließen, zu bereichern? Den mit RoboPro mitgelieferten Treibern zu Folge sollte die Nutzung zahlreicher interessanter Sensoren (Kompass, Accelerometer, Echtzeituhr, Gyroscope, Thermometer, Farbsensoren, ...) aus RoboPro problemlos möglich sein. Freue mich über Rückmeldungen an ftpedia[ät]ftcommunity.de!

Is there anybody out there experienced in the use of I²C sensors and interested in writing (one ore more) articles about the usage of the RoboPro supported sensors and actuators for the ft:pedia? Then do not hesistate to write us (ftpedia[at]ftcommunity.de) - translation and review is part of our service ;-).

Gruß, regards,
Dirk

olav
Beiträge: 64
Registriert: 31 Okt 2010, 23:46
Wohnort: Freudenstadt

Re: I²C für Einsteiger...

Beitrag von olav » 14 Apr 2012, 22:07

Hallo,
ich finde die ft:pedia immer sehr toll und wenn es die Möglichkeit gibt das über eine ft:pedia Ausgabe verständlicher zu machen würde ich nicht nein sagen.

Grüße olav
Ohne ft ist alles doof! ;-)

Benutzeravatar
Endlich
Beiträge: 362
Registriert: 01 Nov 2010, 08:45
Wohnort: Ingelfingen
Kontaktdaten:

Re: I²C für Einsteiger...

Beitrag von Endlich » 14 Apr 2012, 22:11

Genau, da schließ ich mich olav an, denn im Moment versteh ich von I²C, wenn ich ehrlich bin, gar nichts. Und so geht es bestimmt nicht nur mir und olav sondern auch anderen Fans.

Würde mich freuen wenn ein Artikel zustande käme.

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

Re: I²C für Einsteiger...

Beitrag von vleeuwen » 15 Apr 2012, 14:14

Hi All,
The basics for I2C bus use are not so difficult.
The I2C protocol is very simple and easy to understand.
But it is all low level stuff.
Sending and writing bytes to/from a device.
On the internet you will find some good descriptions.

The content of the bytes has nothing to do with the I2C protocol, it has to do with the functionality of the device.
The second part is the discription of the functionality.
The best place to find this information is the data sheet of the device.
But it is not always easy to understand the functional descriptions.

The LEGO brick has an internal I2C preprocessors on board. The preprocessor transforms the raw data into data which is usable by the LEGO end users.
The TX-C has nota preprosesor. So all processing of the raw data need to be done at RoboPro level.
This makes it rather slow.
For example the RoboPro I2C lib for the stepper controller shows that this is possible but complex.
And this lib is only offering the basic read and write operations for that stepper device and not how to make use of all the functionality this device is offering.

So how it works it not the problem, there is no need for a new description.
The main problem is the development of functional sensors and actuators electronic and software drivers.
In a way that these hardware will be accessable for the normal FT end users.
And this is a lot more than buying an I2C sensor kit from Conrad, Microchip of others.

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

Re: I²C für Einsteiger...

Beitrag von vleeuwen » 15 Apr 2012, 15:26

Hi Lutz,
Microchip has a nice and sheep Functional Serial Bus analyzer which is covering I2C (+/- 37.84 excl.)
I am using it myself.
The scripting engine is good for both slave and master simulation.
The library (dotNet level) is well documented.
This interface is also usable as I2C<=> USB.

See:
http://www.microchip.com/stellent/idcpl ... e=en028600

Kind regards.

Benutzeravatar
Dirk Fox
ft:pedia-Herausgeber
Beiträge: 1832
Registriert: 01 Nov 2010, 00:49
Wohnort: Karlsruhe
Kontaktdaten:

Re: I²C für Einsteiger...

Beitrag von Dirk Fox » 15 Apr 2012, 15:32

Hallo elektrolutz,

gerne möchte ich zu meinem eigentlichen Topic zurückkehren.
elektrolutz hat geschrieben:Nur weil es nun möglich ist, I²C-Module über TXC und RoboPro zu erreichen, darf man natürlich nicht erwarten, dass das Bus-System trivial ist.
Auch sollte man nicht erwarten, dass ft nun auch noch eine kostenlose I²C-Schulung für Einsteiger nachreicht.
Ich gaube nicht, dass alleinige Programmierkenntnisse/-erfahrungen mit RoboPro ausreichen, um Treiber für I²C-Module entwickeln zu können.
Es geht mir nicht um eine Einführung in I²C (da gibt es genug im Netz), sondern um eine Vorstellung der Anschluss- und Nutzungsmöglichkeiten der I²C-Devices, zu denen mit RoboPro 3.1.3 jetzt Treiber ausgeliefert wurden - u.a. dank Rei Vilo immerhin ganze 18 Stück. Für jemanden, der wenig Programmiererfahrung hat, dürfte es für einige der Devices (zumindest für die bei Conrad erhältlichen) nicht besonders schwierig sein, sie zu nutzen - vorausgesetzt, irgendwo ist vernünftig zusammengefasst, wo man sie beschaffen und wie man sie anschließen und in RoboPro ansprechen kann. Dazu würde ich gerne eine kleine ft:pedia-Serie initiieren - je Ausgabe ein oder zwei neue Devices, mit kleinem Beispielprogramm, Anwendungsvorschlägen, Bestellmöglichkeit und etwaigen sonstigen hilfreichen Hinweisen.

Beste Grüße,
Dirk

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

Re: I²C für Einsteiger...

Beitrag von vleeuwen » 15 Apr 2012, 18:19

The basic I2C RoboPro libs are not real drivers.
They are examples that show how to deal with the basic device commands.
For example:
The stepper case: It will be rather difficult to write a fault tolerance program in RoboPro which deals with the most important error flags of the stepper controller. To react on the error conditions will cost relatively much time.
To read the status of the stepper will cost at least 2 or 3 TA cycles and to react also 2 or more TA cycles. 40 to 60 ms instead of the normal 2 to 6 ms with a preprocessor.

For me, drivers are the code that runs on the preprocessor; the code that transfers the low level I2C commands into high level end user commands for RoboPro. The end user is only interested in going to a new position and feedback about the end result and not in handling the internal problems (flags).
Compare this with for example the motor API in the FtMscLib.

The development of a I2C preprocessor could be a nice higher technical education project.

thkais
Beiträge: 381
Registriert: 31 Okt 2010, 21:45

Re: I²C für Einsteiger...

Beitrag von thkais » 15 Apr 2012, 18:59

Hallo,

nur keine Panik - I²C ist einfacher, als man denkt. Wenn man sich einmal in die Datenblätter eingelesen hat (sich auf das technische Englisch eingeschossen hat) ist alles halb so schlimm. Die echten Fußangeln sind durch RoboPro bereits weitestgehend abgefangen, obwohl es (sinnvollerweise) noch relativ hardware-nah abläuft.
Zum Debugging: Bei jedem I²C-Befehl kann man einen Fehler-Ausgang aktivieren, den man auch nutzen sollte. Gibt man Texte auf dem Display aus, ist ein rudimentäres Debugging auch im offline-Modus möglich. Wobei es eher sinnvoll sein dürfte, während der Entwicklung eines "Treibers" im online-Modus zu arbeiten. Aber auch später kann ein sinnvolles Fehler-Management sinnvoll sein, so sollte man relativ schnell bemerken, dass ein Kabel nicht angeschlossen ist...
Um ein I²C-Device anzusteuern, braucht man eigentlich nur 3 Informationen: Welche Adresse hat es, gibt es Sub-Adressen und welche Daten erwartet es/gibt es zurück. Anhand der mitgelieferten Beispiele sollte es wenig Probleme machen, neue Devices anzusteuern. Abgesehen davon sind viele I²C-Devices so alt, dass man sie als Steckbrett-taugliche DIP bekommt.
Und notfalls gibt es ja das Forum.
Gruß
Thomas

jmvedrine
Beiträge: 1
Registriert: 04 Mai 2012, 17:39

Re: I²C für Einsteiger...

Beitrag von jmvedrine » 04 Mai 2012, 17:49

Bonjour,
Hello Rei Vilo,
I see that you now have a page on your website for the ADJD-S371 color sensor (breakout board Sparkfun SEN-08663) but unfortunately this part is now very difficult to buy if you don't already have it.
Did you made some tests with the new ADJD-S311 (breakout board SEN-10701) wich is easily available and are there any differences or are they interchangeable ?
Thanks a lot.
Jean-Michel

Antworten