Skip to main content
Davey Surphlis
Visitor II
January 22, 2018
Question

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 ?

  • January 22, 2018
  • 3 replies
  • 1003 views
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

    This topic has been closed for replies.

    3 replies

    waclawek.jan
    Super User
    January 22, 2018
    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
    Super User
    January 22, 2018
    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 ...

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    January 22, 2018
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    Andrew Neil
    Super User
    January 22, 2018
    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

     
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    January 22, 2018
    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 VenmoUp vote any posts that you find helpful, it shows what's working..