🤖Have you ever tried Chat.M5Stack.com before asking??😎
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
M5Stack Community
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Pahub not recognized on port SDA21/SCL22 (uiflow 1.9.1) - help needed

UIFlow
2
4
4.9k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A
    Arno
    last edited by Feb 12, 2022, 5:27 PM

    I am limited in number of ports for my project, I have to use I2C with internal ports 21/22.
    When I declare in Uiflow a PaHUB alone on 21/22, I don't get an error message. But if I declare in Uiflow a Pahub and an Extend i/o unit on the Pahub, I systematically get an error message on the CORE2 "Pahub unit may be not connected".
    If I connect and declare the Pahub whith extend i/o on port A it works.
    I need several Extend i/o, I have no other solution than the PaHUB.
    I tried to modify the I2C address of an extend i/o (0x25), but Uifow does not recognize it, it looks for it on 0x27 (possible to change that?)
    A little help would be appreciated

    I only use Uiflow ! with M5STACK Gray, RED, CORE2, ATOM, ATOM Lite,M5Paper, M5Tough, ATOM Display, M5 Stamp pico and more Unit...

    1 Reply Last reply Reply Quote 0
    • F
      felmue
      last edited by Feb 12, 2022, 10:34 PM

      Hello @Arno

      I don't think this kind of setup will work with the current UiFlow version. I tried many things to trick the PbHub being recognized on a PaHub connected to 21/22.

      That said, the trouble actually starts before that. Even with only a PaHub connected and setup to use 21/22 below code either crashes my M5Core2 after a short time or it shows an I2C bus error (110). I think the UiFlow firmware and the micropython code both trying to use the I2C bus at the same time is causing this.

      from m5stack import *
      from m5stack_ui import *
      from uiflow import *
      import unit
      
      screen = M5Screen()
      screen.clean_screen()
      screen.set_screen_bg_color(0xFFFFFF)
      pahub_0 = unit.get(unit.PAHUB, (21,22))
      
      while True:
        pahub_0.select(0, 1)
        wait_ms(2)
      

      Thanks
      Felix

      GPIO translation table M5Stack / M5Core2
      Information about various M5Stack products.
      Code examples

      A 1 Reply Last reply Feb 13, 2022, 3:10 PM Reply Quote 1
      • A
        Arno @felmue
        last edited by Feb 13, 2022, 3:10 PM

        Thanks @felmue

        The PaHUB solution on internal I2C 21/22 does not seem to be the right solution.
        I only have to use two EXTEND I/O with two different addresses, but Uiflow only recognizes address 0x27.
        Do you have an example of using EXTEND I/O with the I2C master functions of Uiflow without going through the declaration of an EXTEND I/O unit.
        I only need the 8 I / O input and to read their status

        0_1644764900756_db71af6f-e651-4726-89cf-6cfc78fd0c7b-image.png

        an example of use would be very useful

        I only use Uiflow ! with M5STACK Gray, RED, CORE2, ATOM, ATOM Lite,M5Paper, M5Tough, ATOM Display, M5 Stamp pico and more Unit...

        1 Reply Last reply Reply Quote 0
        • F
          felmue
          last edited by Feb 13, 2022, 7:45 PM

          Hello @Arno

          I am sorry, I cannot help you on this one - I don't have the EXTEND I/O unit to test.

          That said, you might get some idea how to talk to it through I2C by looking at the Arduino example?

          Thanks
          Felix

          GPIO translation table M5Stack / M5Core2
          Information about various M5Stack products.
          Code examples

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post