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)