RoboPro 3.1.3 with 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: 1609
Registriert: 31 Okt 2010, 22:23
Wohnort: Enschede (NL)
Kontaktdaten:

Re: RoboPro 3.1.3 with I2C!

Beitrag von vleeuwen » 24 Apr 2012, 22:11

Thanks for your effort.
Is the 250 msec an one time event or does it arrives more?

A rather slow on-line implementaion.
In that case a solution with for example the Microchip USB-2-I2C interface/(the serial analyzer; +/- 40 Euro's) is much faster.

Are you able to speculate about the situation when there are more TX-C slave in use?

It looks like that the bypass the TA in the off-line mode.
Only the master can be addressed for I2C use, it looks like that the slave are excluded in RoboPro, or make I a mistake?

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 27 Apr 2012, 16:39

Hallo Sven oder andere I2C-users

Du hast (auch) vor das LED I²C Display beim Flipper zu nutzen. Funktioniert dieser schon ?

Ich versuche jetzt der LED-DisplaySAA1064 in verschiedene einfache RoboPro-Programme anzuwenden.
Wäre es möglich deine Robo-Flipper-Program mit dem integrierter "I2C-Bus LED Display Conrad # 198344" als Beispiel zu mailen oder zu uploaden ?

Wie damals beim Tutorial von Ulrich Müller lernt man sehr viel und schnell wenn es mehrere Beispiel-Programme gibt, die man selbst ändern kann.


Grüss,

Peter
Poederoyen NL
Peter Poederoyen NL

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 27 Apr 2012, 18:53

Ich habe 2 RoboPro-Programm mit I2C-Bus LED Display geuploaded aber dieser sind noch nicht freigeschaltet:

- G-krachtmeting-max-min + LED-I2C (=Neuhold 3-Achsen Beschleunigungs-Senor-Module (=300mV/g) + I2C-Bus LED Display Conrad # 198344)

und

- LED-SAA1064 + 5K=Potmeter

Grüss,

Peter
Poederoyen NL
Peter Poederoyen NL

hamlet
Beiträge: 332
Registriert: 12 Jan 2011, 21:41

Re: RoboPro 3.1.3 with I2C!

Beitrag von hamlet » 28 Apr 2012, 20:37

Dear All,
yeah, today the ft-guys have released the C-Compiler Programmierpaket FIRMWARE 1.30 and PC Programming ROBO TX Controller Version 1.5 including the i2c interface.
Now I see a chance to implement a reansonable logging interface from an C-compiled appication running on the TX to a generic application running on a PC. Fortunately a colleague of mine donated me a little cute "mbed NXP LPC11U24" controller, he is just happy with the more powerful version LPC1768. The LPC11U24 provides an i2c interface on one side and a USB serial interface on the other side. The idea is to send the logs from the TX via i2c to the LPC11U24 (configured as i2c-slave) that simply forwards them via USB serial to the PC. The i2c voltage levels are different: 3.3 vs. 5V. Even though I have read in some blog that the mbed devices are "5V tolerant", I guess that it is not wise to try to connect them directcly. I have already found a guide to build a simple level shifter.
Now the big question. What transfer rate could I expect?
I read in an earlier posting that 1Byte/100µs~10K/s can be achieved.
Do I realize this, by calling the write function several times in one 500µs/ms-slot using the KeepOpen-flag? Each call of write_i2c appends a data byte to a buffer and later the OS sends the whole buffer to the i2c bus?
Do you think that this is a reasonable approach? I am an i2c newbie and I also know that using the nice mbed as relay is a kind of abuse, but currently I don't see any other way to get some debug info out of the TX.
Just to make sure: I have thoroughly read the bluetooth documentation. My conclusion was that it is not possible to transfer data from a TX application to a generic application running on the PC via BT. Is this correct?
Are there any other options?
cheers,
Helmut

hamlet
Beiträge: 332
Registriert: 12 Jan 2011, 21:41

Re: RoboPro 3.1.3 with I2C!

Beitrag von hamlet » 29 Apr 2012, 21:13

Thanks Rei!
The wireless solution sounds interesting. But it is a pity that one has to add two additional moduls to get some data out of the TX.
Cheers,
Helmut

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

Re: RoboPro 3.1.3 with I2C!

Beitrag von vleeuwen » 30 Apr 2012, 11:30

@Hamlet,

I2C opens new ways for the PC-TX-C commnication.

For example:
*) USB<->I2C connector (Microchip serial analyzer +/- 40 EUro) makes the PC act as an I2C slave.
*) I2C <-> wifi webserver board,
*) etc.

Bad luck that the online I2C implementation is so slow (ref. the experiment of Ad2)
Zuletzt geändert von vleeuwen am 11 Mai 2012, 22:38, insgesamt 1-mal geändert.

Ad2
Beiträge: 306
Registriert: 31 Okt 2010, 22:20

Re: RoboPro 3.1.3 with I2C!

Beitrag von Ad2 » 30 Apr 2012, 13:39

With 2 TX it should be possible to communicate at a reasonable speed over BT using messages. Connect one TX with USB to a PC. The other TX (in download mode with a C program) can communicate any data over bluetooth to the first TX (in online mode with a C program). This comes very close to the memory read and write functions we had with the RoboInterface.

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

Re: RoboPro 3.1.3 with I2C!

Beitrag von vleeuwen » 30 Apr 2012, 17:05

This package
C-Compiler Programmierpaket FIRMWARE 1.30 and PC Programming ROBO TX Controller Version 1.5 including the i2c interface.
is still based on a old Yagarto/GNU version.

hamlet
Beiträge: 332
Registriert: 12 Jan 2011, 21:41

Re: RoboPro 3.1.3 with I2C!

Beitrag von hamlet » 27 Mai 2012, 09:13

Hi all,
some i2c performance tests:
I2C-Performance.pdf
cheers,
Helmut

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

Re: RoboPro 3.1.3 with I2C!

Beitrag von vleeuwen » 27 Mai 2012, 22:19

@Helmut.

I notice a simularity between your results and the results of Ad2, some weeks ago.
The online mode result is very disappointing.

In the online mode it looks like that it will be more efficient to make use of a normal USB to I2C connector.

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

Re: RoboPro 3.1.3 with I2C!

Beitrag von thkais » 28 Mai 2012, 09:38

Hi,

may I ask you: Did you expect a control-device for toys when you bought the TX or a professional industrial control-unit? Let's not get carried away.
To connect displays, sensors etc. the data-rate will be enough. To build a milling-machine with I²C-Stepper-controllers and full 3D 3-axis path control the data rate maybe will not be enough. I can deal with it.
Gruß
Thomas

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

Re: RoboPro 3.1.3 with I2C!

Beitrag von vleeuwen » 28 Mai 2012, 23:45

Hi Thomas,
Based on my earlier comment you were able to know that I am not expecting miricals from the TX-C I2C implementation.

My reference is the 45 Euro Microchep serial analyzer ( same as the Microchip USB-I2C interface) and not the more industrial and more expencive I2C interfaces.
I did not expected the same quality from the TX-C as offer by this Microchip USB-I2C interface at dotNet framework level.

I was expecting four bytes data transfer+ address info in one TA refresh cycle (online mode).
And not 6 to 9 TA refresh cycles for one I2C command.
http://forum.ftcommunity.de/viewtopic.p ... 1274#p8627

Even with a additional I2C preprocessor between the (I2C) actuator/sensor devices and the TX-C is one byte/TA refresh cycle very slow to obtain some results in the online mode.

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 05 Aug 2012, 13:15

Ich habe für den Flipper eine LCD (für noch ein Spiel ?) + LED Anzeige für die Punkte (account). Das funktioniert gut.

Ich möchte aber noch ein zweiter extra LED-Anzeige für die Kugelzahl : I2C-Bus LED Display (4 Digits 7Segs. rot 13mm) Conrad # 198344.

Wie erkannt das Robo Pro -Programm die beiden I2C-Bus LED Display (Conrad # 198344) weil sie Identisch sind ?.....Grüss,

Peter
Poederoyen NL
Peter Poederoyen NL

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 05 Aug 2012, 14:08

Ich habe in die Anleitung gefunden : es gibt 4 Jumper-möglichkeiten die dem Modul die
einstellbare Adresse 0 bis 3 zuweisen.

Muss man bei eine andere Jumper-position auch noch etwas ändern im Robo Pro Programm ?Grüss,

Peter
Poederoyen NL

Im Anleitung lese ich....
Adressierung:
Die Adresse besteht aus einem festen, nicht veränderbaren Anteil und einem vom Benutzer
wählbaren Teil (zwei Bits x y). Das letzte Bit legt fest ob eine READ (Eingabe) oder WRITE
(Ausgabe) über den SAA1064 erfolgt. Allerdings ist beim diesem Baustein die interne
Adressdecodierung etwas anders als üblich. Das Modul hat deshalb 4 Jumper die dem Modul die
einstellbare Adresse 0 bis 3 zuweisen. Es darf jeweils nur ein Jumper gesteckt sein.
J1 x=0, y=0
J2 x=1, y=0
J3 x=0, y=1
J4 x=1, y=1
0 1 1 1 0 y x 1 READ-Operation
I----------I--------I--I
FIX ADR ADR R/W
Für eine WRITE- Operation ist das letzte Bit LO und es ergibt sich folgender Wert:
0 1 1 1 0 y x 0 WRITE- Operation
I----------I--------I--I
FIX ADR ADR R/W[/i]
Zuletzt geändert von Peterholland am 05 Aug 2012, 15:41, insgesamt 2-mal geändert.
Peter Poederoyen NL

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 05 Aug 2012, 16:12

Heist das im alle RoboPro-Icons in Unterprogramm I2CLED-Set das betr. Display mit Jumper2 (statt 1) die Subadresse ändern in: 1x0 statt 0x0 ?

Apparat-adres beiden: 0x38 ?

Grüss,

Peter
Poederoyen NL
Peter Poederoyen NL

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 05 Aug 2012, 18:00

Ich habe Heute erst ein zweiter extra LED-Anzeige für die Kugelzahl : I2C-Bus LED Display bei Conrad # 198344 bestellt.
Es dauert also noch einige Tagen zum probieren......

Beim I2C -LED und -LCD Anzeige für Flipper habe ich herausgefunden das die Stabilität des Zählen im Download-betrieb besser ist als im online-Betrieb.

Peter
Poederoyen NL
Peter Poederoyen NL

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 05 Aug 2012, 18:04

Ford hat geschrieben:stop:
wschl nicht 1x0 sondern 0x1!

alternative Möglichkeit, falls es nicht funzt:
Apparate-Addresse 0x39 statt 0x38.
Gehört 0x1 zu J2 (Jumper 2) ?

Grüss,

Peter
Poederoyen NL
Peter Poederoyen NL

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

Re: RoboPro 3.1.3 with I2C!

Beitrag von thkais » 06 Aug 2012, 08:10

Moin,

man muss unterscheiden zwischen Geräteadresse (device-address) und Subadresse.
Die Geräteadresse spricht das Gerät (= Chip, Modul, was auch immer) an. Die Subadresse ist nicht bei jedem Gerät vorhanden und dient zur Adressierung von Parametern innerhalb des Geräts.
Zum Beispiel bei einem EEPROM wird mit der Subadresse die Nummer der Speicherstelle mitgeteilt, auf die zugegriffen werden soll, während ein Port-Expander wie der PCF8574 keine Subadresse besitzt.

Es ist relativ üblich, über Pins verschiedene Geräteadressen zuweisen zu können, damit mehr als ein Gerät an den Bus angeschlossen werden kann.

Code: Alles auswählen

  0 1 1 1 0   y x    D
I----------I--------I--I
   FIX ADR     ADR   R/W
Um die Geräteadresse aus dem obigen Beispiel zu berechnen, muss man Binärarithmetik bemühen:
Zum Beispiel bei y=0 und x=0 wäre die Adresse:
0111000
Das R/W (bzw. "D" für direction) interessiert in diesem Fall nicht, es wird von RoboPro automatisch der Übertragungsrichtung entsprechend gesetzt.
Um nun die Geräteadresse anzugeben, fängt man rechts in 4-er Schritten an, die Binärdaten in Hex zu wandeln (da gehe ich nun nicht näher darauf ein, im Internet gibt es genügend hierzu).
Also bekomme ich Hex 38 = 0x38 heraus.
Wird nun statt J1 der Jumper J2 gesetzt, so ist nach Anleitung x=1 und y=0.
0111001
Rechnet man das nun um, bekommt man 0x39 heraus.
Also muss man das Gerät, sofern es umgejumpert wird, mit Adresse 0x39 ansprechen - wie von Ford vermutet. Die Subadressen bleiben unverändert.
Gruß
Thomas

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

Re: RoboPro 3.1.3 with I2C!

Beitrag von Dirk Fox » 06 Aug 2012, 22:04

Hallo zusammen,
thkais hat geschrieben:man muss unterscheiden zwischen Geräteadresse (device-address) und Subadresse.
die Verwirrung kommt vermutlich daher, dass der Wikipedia-Artikel über I²C (http://de.wikipedia.org/wiki/I%C2%B2C) die konfigurierbaren Adressbestandteile im I²C-Device fälschlich "Subadresse" nennt, nach den Datenblättern der I²C-Devices darunter aber eindeutig eine Device-Interne Adressierung zu verstehen ist. Das hat mich zunächst auch irritiert...

Gruß, Dirk

Benutzeravatar
Peterholland
Beiträge: 324
Registriert: 01 Nov 2010, 22:28
Wohnort: Poederoyen NL

Re: RoboPro 3.1.3 with I2C!

Beitrag von Peterholland » 10 Aug 2012, 18:08

Hallo zusammen,

Meine Flipper funtioniert jetzt mit 2x I2C-Bus LED Display (Conrad # 198344) + 1x LCD Anzeige (Conrad # 198330) .

LED Display- nr2 mit Jumper 2 wird im Robo Pro Programm mit Adresse 0x39 ansprochen.
Vielen Dank für die Hinweise.

Link um FT-Community:

http://www.ftcommunity.de/categories.php?cat_id=2616

ftCommunity | Bilderpool | Modelle | Sonstiges | Spielautomaten | Flipper PD-Holland

Robo Pro Programm gibt es unter:

http://www.ftcommunity.de/downloads.php ... ie=RoboPro

Grüss,

Peter Poederoyen NL
Zuletzt geändert von Peterholland am 10 Aug 2012, 22:06, insgesamt 4-mal geändert.
Peter Poederoyen NL

Antworten