XDK as I2C-Slave
응답
17. 3. 6 오후 1:06

Hello together,

I would like to know whether there are any Projects or Demos, in which the XDK could be used as a slave which gives out sensor values after being asked for these values by a master over I2C.

Dear Greetings, Benedikt

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 6 오후 8:49 as a reply to Benedikt Sessler.

Hello Benedikt,

Welcome to the XDK community.

Unfortunately there are not demos that cover your specific use case.

But in general the EFM32GG390 microcontroller of the XDK supports both, master and slave I2C functionality.
I am not quite sure, if it is possible on the highest API level. On the first glance I do not think so, but I am certain it can be implemented on lower API levels like em_i2c.c.

Please tell me if this is helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 8 오후 2:26 as a reply to Franjo Stjepandic.

Hello Franjo,

Thanks a lot for your very quick answer!

I am not yet sure whether I will make the XDK talk over I2C or some other way, but in case of I2C, I will come back to your kind offer. Your information about em_i2c.c was a good to know, I'll have a close look to that.

Yours sincerely, Benedikt

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 8 오후 3:55 as a reply to Benedikt Sessler.

Hello Benedikt,

I am glad to hear that my suggestion is helpful.

Please let me know if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 27 오후 1:58 as a reply to Franjo Stjepandic.

Hi Franjo, hi all viewers,

Unfortunately, that way did not work as planned, but I saw that there might be another option: There are two I2C-Bus-Pin at the Port of the XDK (Source below): The ports B9 and B10 are accessible over the extension board and they are part of the bus I2C1.

That's why I would like to know: Is it possible to connect the two I2C-Bus-Systems I2C0 and I2C1 to connect the internal Senors from I2C0 to the external pins? Maybe there is a software-controlled switch for that?

Dear Greetings, Benedikt

Source:

https://xdk.bosch-connectivity.com/xdk-api -> Related Pages ->XDK Extension Bus User Guide

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 27 오후 11:32 as a reply to Benedikt Sessler.

Hello Benedikt,

I am sorry to hear that it didn't worked out as you expected. First I would like to clarify some issues about your new I2C attempt.

Am I correct, that you try to implement a direct access of your external device to the internal I2C0 channel to access the internal XDK sensor data directly?

If this is true:
Unfortunately, there is no internal switch that the I2C0 channel can be accessed of the extension bus pins of the I2C1 channel. All pins of the extension bus are directly connected to corresponding pins on the XDK MCU. Therefore if you want to receive sensor data over I2C, you have to implement an application which passes the sensor values from the MCU to you external device.

May I ask, what the basic idea of your purpose is? Maybe I can make some useful suggestions.

Please tell me if this is helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 28 오전 8:19 as a reply to Franjo Stjepandic.

Hello Franjo,

Yes, you are correct, I would like to access the sensor data as directly as possible. A behaviour such as if they were not packaged in XDK but sold solely and placed on a breadboard with a wiring for I2C would be ideal. This way I could poll the sensor data from the external device by simply adressing the registers of each sensor.

Well, you said the I2C-Busses can not be connected to each other, because there is no such switch. Alright then I will have to look for an other way:

You proposed i could"implement an application which passes the sensor values from the MCU to [...] external device". Some suggestions for that way are always welcome!
In this case I would have to make the XDK poll the sensor data, store them, wait for incoming requests to read the values, and answer these requests depending on address an register in the request. Is that similar as you proposed?

Dear Greetings, Benedikt

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 28 오후 10:09 as a reply to Benedikt Sessler.

Hello Benedikt,

I had exactly that in mind. Unfortunately there is currently no detailed I2C documentation available about how to implement the proposed functionality on the XDK.
In addition there is currently no example in the extension bus guide you linked available.

I asked some developers if anyone has an I2C example to speed your implementation up.

Meanwhile, is it urgently necessary to implement the communication on I2C or could it be another serial (for example SPI) to receive the data.

I am asking because there are pretty good examples available for SPI and UART.

Kind regards,
Franjo

+1 (1 투표)
RE: XDK as I2C-Slave
응답
17. 3. 29 오전 8:39 as a reply to Franjo Stjepandic.

Hello Franjo,

Yes you are right: in my linked extension bus guide there is no example, only some external I2C-pins listed in the chapter "Extension header pin assignment":

B9 PB11 I2C1 data line EXTENSION_I2C1_SDA
B10 PB12 I2C1 clock line EXTENSION_I2C1_SCL

These Pins made me hope that there would have been a possible solution like connecting these pins to internal bus I2C0. That's why I linked it.

 

Well, I already implemented a communication between the XDK and the external device over USB, which works fine. There are indeed some pretty good examples for that. On the other hand, my boss would prefer a communication via I2C rather than USB, so I'll have a talk with him the next days and come back to you.

Kind regards, Benedikt
0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 3. 29 오후 9:28 as a reply to Benedikt Sessler.

XDK as I2C-Slave

Hello Benedikt,

it is great to hear that you already implemented a solution via USB.

A solution via I2C is also possible, of course.
I will get back to you immediately when I receive the information I asked for.
Please keep me also posted on your progress.

Kind regards,
Franjo

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 4. 3 오후 3:10 as a reply to Franjo Stjepandic.

Hello Franjo,

thanks a lot for your kind offer.

Today I talked to my boss- we still prefer the way over I2C, so USB is just if I2C doesn't work.
So I indeed hope for your source of information.

Dear Greetings, Benedikt

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 4. 4 오후 2:24 as a reply to Benedikt Sessler.

Hello Benedikt,

Unfortunately, I still haven't received any information about my I2C request.
Thus I can only ask you for patience.

I will keep you in the loop and post any news I receive here.

Kind regards,
Franjo

0 (0 투표)
RE: XDK as I2C-Slave
응답
17. 5. 22 오후 4:49 as a reply to Franjo Stjepandic.

Hello Benedikt,

I have received new information about I2C. Unfortunately there is no example implementation available to show how to use the external pins of the extension bus to communicate via the I2C bus.

Fortunately I found an example I2C implementation of the underlying interface em_i2c.h in the community forum of silicon labs.

It explains in detail how to implement an I2C communication with the XDK’s internally used I2C channel I2C0. Maybe you can use that as starting point to implement the communication for the external I2C channel I2C1.

Please tell me if this is helpful and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)