cancel
Showing results for 
Search instead for 
Did you mean: 

how can i implement 3 I2C buses on a STM32 LO family. Although it has 3 these are split across AF6 and AF7 alternative pin mapping ?

Davey Surphlis
Associate
Posted on January 22, 2018 at 14:39

how can i implement 3 I2C buses on a STM32 LO family.

looking at the data sheet for pin mapping this are mapped in to PB & PA buses

with alternative Mode does not allow all 3 to be expossed, as these are spread across AF6 & AF7

Can this part support 3 IC2 buses, or do i need to look at a new part

we only need 3 I2C busses and a few GPOI

2 Of these buses must support ARP. so that limits us to L0, L4, F3 families

Davey

6 REPLIES 6
Posted on January 22, 2018 at 15:23

2 Of these buses must support ARP

Can't you bit-bang the third one?

JW

Andrew Neil
Evangelist III
Posted on January 22, 2018 at 15:32

Yes, it is a pretty universal problem - not just STM32 - that the full complement of peripherals often can't be accessed due to pin restrictions.

Why do you need 3 separate I2C busses?

There are I2C hub/switch/router chips available ...

Posted on January 22, 2018 at 16:09

And chips supporting multiple instances via address straps.

At Philips we'd run entire TV and CD subsystems with a single bus, the bus was designed for low pin count interconnecting multiple boards.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 22, 2018 at 17:09

Which L0 (L Zero) part specifically are we talking about, some of the smaller parts have more restricted escape scenarios.

You'd want to escape 6 individual pins, each with it's own AF setting to assign it to a specific I2Cx peripheral.

There might be some hackery if you are a master, where you can switch between SDA AF settings on a transactional basis sharing a common SDA pin, and have 3 independent SCL pins.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 22, 2018 at 16:52

Indeed - the whole point of a bus is exactly that it can be shared by multiple devices!

'bus' is short for 'omnibus'  which, as Michael Flanders tells us:

comes from the Latin, 'omnibus', meaning to or for, by, with, or from everybody - which is a very good description!

This song is about a bus, it's wittily subtitled - (I thought of this) - 'A Transport of Delight'.

https://www.youtube.com/watch?v=mVHbF0jAzMw

 
Posted on January 22, 2018 at 17:04

I'm with John Cleese, I like my buses with 32 bits rather than something bit with half a ferret armoured car.

https://www.youtube.com/watch?v=dPmiC_Zt88I

 
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..