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

    8-Angle Unit does not respond to read_status call through I2C

    Units
    1
    3
    2.4k
    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.
    • V
      vjou0
      last edited by

      My 8-Angle Unit only responds to I2C communication for register addresses 0xFE (Version) and 0xFF (Address) with values “1” and “0x43” respectively.
      “read_status” calls to all the other register addresses (0x00 – 0x17, 0x20, 0x30 – 0x53) respond “None”.

      Please help me to read values from 8-Angle unit.

      Output from my test python script as well as the script:

      from unit8angle_read_status import *
      |
      | FEh : 1h | FFh : 43h |
      | 00h : None | 01h : None | 02h : None | 03h : None | 04h : None | 05h : None | 06h : None | 07h : None |
      | 08h : None | 09h : None | 0Ah : None | 0Bh : None | 0Ch : None | 0Dh : None | 0Eh : None | 0Fh : None |
      | 10h : None | 11h : None | 12h : None | 13h : None | 14h : None | 15h : None | 16h : None | 17h : None |
      | 20h : None |
      | 30h : None | 31h : None | 32h : None | 33h : None | 34h : None | 35h : None | 36h : None | 37h : None |
      | 38h : None | 39h : None | 3Ah : None | 3Bh : None | 3Ch : None | 3Dh : None | 3Eh : None | 3Fh : None |
      | 40h : None | 41h : None | 42h : None | 43h : None | 44h : None | 45h : None | 46h : None | 47h : None |
      | 48h : None | 49h : None | 4Ah : None | 4Bh : None | 4Ch : None | 4Dh : None | 4Eh : None | 4Fh : None |
      | 50h : None | 51h : None | 52h : None | 53h : None |
      | FEh : 1h | FFh : 43h |
      |

      unit8angle_read_status.py

      import unit
      
      def angle8_address_read(address_list):
          address0 = 0
          for i, address in enumerate(address_list):
              value = angle8.read_status(address)
              if address % 8 == 0 or address - address0 != 1: print(" |")
              if type(value).__name__ == "int": form = " | %02Xh : %4Xh"
              else:                             form = " | %02Xh : %s "
              print(form % (address, value), end="")
              address0 = address
          print("\n |")
      # -----------------------------------------------------------------
      
      angle8 = unit.get(unit.ANGLE8, unit.PORTA)
      
      # --- addresse list ---
      address_list = [0xFE, 0xFF]
      address_list.extend(range(0, 0x18))
      address_list.append(0x20)
      address_list.extend(range(0x30, 0x54))
      address_list.extend([0xFE, 0xFF])
      # ---------------------
      
      angle8_address_read(address_list)
      
      1 Reply Last reply Reply Quote 1
      • V
        vjou0
        last edited by vjou0

        Additional information:
        I am using ATOM Lite to communicate with 8-angle and I flashed ATOM Lite with ATOM Lite firmware v1.11.0, by using M5Burner-v3-beta-win-x64.
        When I connect to ATOM through Terminal in UIFlow, it says “MicroPython 3a9581b5a-dirty on 2022-12-08; M5Stack with ESP32.”
        MicroPython on the ATOM Lite is perfectly working with other units, such as CardKBCardKB V1.1 (I2C) and ATOM GPS kit (UART).

        If anyone can give me valid MicroPython scripts to test the 8-angle unit response that I can try with my ATOM Lite, I would appreciate very much.

        V 1 Reply Last reply Reply Quote 0
        • V
          vjou0 @vjou0
          last edited by

          This issue was resolved. It was a simple misunderstanding of mine. "angle8.read_status" method was only for reading version and address. To read other registers, another angle8 unit method or normal I2C read work as expected.
          I realized I had been asking help to wrong people for almost three months, though they were also in M5Stack. I finally got the answer telling me it was my simple mistake.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post