Number of I2C and SPI lines

Hi,
On the map of the pico lipo there is 2 i2c and 2 spi… I have used only one for each type of communication.
Is it possible to use a second one?
If I have a conflict between 2 spi harware, could I resolve it with the use of 2 soft SPI connections?

Thanks.

The brains of a Pico Lipo is the RP2040, which has 2 I2C hardware units plus 2 SPI hardware units. Any of the pins marked 0 SCL or 0 SDA can be controlled by I2C unit 0, and the same goes for I2C unit 1 and 1 SCL and 1 SDA, and yes the same goes for the 0 SPI and 1 SPI pins. You might need to check through the documentation for whatever language you’re using to see how you specify which bus to use.

Hi Shoe,
I had tried:
“from machine import I2C
from sensor import SENSOR
i2c = I2C(1) ## or 0
sensor = SENSOR(i2c)#like this, alone it works fine”
At this line I have an error with all the possibilities of connections listed in the map, that I have tried.
Finally, I have just the pin4 for sda and 5 for scl, i2c(0) which works ; so one line.
For spi the line 0 works with sck=pin(18)… But the display no works at this time…
I will try again… Maybe, I have made a mistake somewhere…
Thanks.

So, I tried to use 2 lines of SPI connections… It doesn’t work correctly for me.
Just one, it works fine. I love it. And I can use different names of pin and pin. But, for me, there isn’t 2 lines, there is just 2 names of line… The same for the i2c… I can use a I2C(x,scl=…,sda=…) with all the NAMES that I want, but finally, just one line works at the same time. For sure this is the same situation for the rasp pico.
It was just that I have to know it. I will use the beautiful 1.12 oled in i2c mode, and finish my project which need a spi peripheral.
Thanks.

You can have more than one device on the Pico’s SPI bus. You just have to use a different CS pin for each device. I’ve run two SPI Color LCD’s on SPI on a Pico. Memory / frame buffer becomes an issue, but it is doable.

Same sort of deal for i2c, as long as no two devices have the same i2c address you can run multiple devices on i2c.

So what exactly are you trying to do? If you want the two busses to work at exactl y the same time there might be some tricks you have to do with the code. In general, Python will work by sending a command to one, and then to the other, not by doing it simultaneously.