Sugar
Posts: 5
Joined: Mon Apr 13, 2015 5:28 am

How to create an I2C slave interface

Mon Apr 13, 2015 6:59 am

Hello to all.

I want to use the raspberry pi as a slave.
But I do not know.

Please tell me the information that would be helpful.

I am using Python.
It does not matter other languages.

Information that is written in the following PDF will care.
・Raspberry Pi Education Manual (130page)
http://212.187.212.72/bt/69fc7f0b8f84a2 ... Manual.pdf

"Inter-Integrated Circuit (I2C)
I2C is an interface on which you can connect multiple I2C slave devices.
The Raspberry Pi acts as the master on the bus."

master only?


I am also using the Google translation.
Sorry, but it might have been in the wrong sentence.

Yours sincerely

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11853
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How to I2C slave

Mon Apr 13, 2015 7:05 am

Yes, master only, its not written there by accident, concluding anything else is just wishful thinking.

AFAIK the only way to create a slave I2C interface is to write a bit-banging routine using normal GPIO ports.

or to use an external micro controller that can be an I2C slave, and communicates with the PI using its UART (serial port).

User avatar
joan
Posts: 14017
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to create an I2C slave interface

Mon Apr 13, 2015 7:18 am

The Pis with the 40 pin header and the compute module export one I2C/SPI slave peripheral on the expansion header.

The I2C/SPI slave peripheral is not supported in the kernel. I know at least one poster was trying to use it from Linux userland. I haven't seen any evidence of success. There are bare metal examples of code.
Last edited by joan on Mon Apr 13, 2015 9:42 am, edited 1 time in total.

Sugar
Posts: 5
Joined: Mon Apr 13, 2015 5:28 am

Re: How to create an I2C slave interface

Mon Apr 13, 2015 9:01 am

Dear mahjongg and joan,

Thank you for your answer.

I found out that OS isn't supporting it.

bare metal...
I do not know.
I try to search on Google.

Thank you all.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11853
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: How to create an I2C slave interface

Wed Apr 15, 2015 11:55 am

You normally use Linux userland drivers like PIGPIO to control the GPIO's and its special functions, of course you don't need to write your own bare metal drivers.

krishnaiah.vv
Posts: 19
Joined: Wed Jun 24, 2015 7:34 am

Re: How to create an I2C slave interface

Fri Aug 14, 2015 12:55 pm

joan wrote:The Pis with the 40 pin header and the compute module export one I2C/SPI slave peripheral on the expansion header.

The I2C/SPI slave peripheral is not supported in the kernel. I know at least one poster was trying to use it from Linux userland. I haven't seen any evidence of success. There are bare metal examples of code.
Hi Joan,
than means, the I2C/SPI slave couldn't be achieved/implemented on RPi2(40 pin header) with Linux support?

User avatar
joan
Posts: 14017
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to create an I2C slave interface

Fri Aug 14, 2015 1:16 pm

krishnaiah.vv wrote:
joan wrote:The Pis with the 40 pin header and the compute module export one I2C/SPI slave peripheral on the expansion header.

The I2C/SPI slave peripheral is not supported in the kernel. I know at least one poster was trying to use it from Linux userland. I haven't seen any evidence of success. There are bare metal examples of code.
Hi Joan,
than means, the I2C/SPI slave couldn't be achieved/implemented on RPi2(40 pin header) with Linux support?
It means that no one has written a Linux driver to support the I2C/SPI Slave peripheral. I'm sure it is possible. My personal view is it would not be very useful even if someone did write a driver.

Return to “Interfacing (DSI, CSI, I2C, etc.)”