Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Codesys on raspberry pi - I2C with interupt

2021-01-13
2021-01-14
  • pavel-entry - 2021-01-13

    Hello,

    I am trying to connect STM32 (slave) and raspberry pi (master) via I2C. I need Codesys running on raspberry pi to be able to read data from I2C using an interrupt.

    Is it possible? Is there any example? I would appreciate any help.

    I currently use the I2C_master.read library to read data in Codesys.

    Thanks
    Pavel

     
    πŸ‘
    1
    • Morberis

      Morberis - 2021-01-13

      You're talking about pulling one of the GPIO pins high/low to trigger an interrupt and read something over the i2c bus? I don't believe that interrupts triggered from the GPIO are supported.

       
  • ojz0r - 2021-01-14

    Do you perform a cyclic I2C already and it is not enough?
    Or do you only want to read I2C only when there is a change (interrupt) in the slave?
    If its the latter then you can use a GPIO as input to trigger a I2C read as Morberis said.

     
    πŸ‘
    1
    • Morberis

      Morberis - 2021-01-14

      Sorry yes that could work.

      I was assuming it was a hardware interrupt that was wanted though if that's not required it could definately trigger a read through a variety of methods.

      My reference for hardware interrupts not being supported is this post here.

       

Log in to post a comment.