Grove Base Hat for Pi I2C Registers

Hi all,



I am writing a Windows 10 Core driver in C# for the Grove Base Hat for Pi.



<LINK_TEXT text=“https://www.seeedstudio.com/Grove-Base- … -3186.html”>https://www.seeedstudio.com/Grove-Base-Hat-for-Raspberry-Pi-p-3186.html</LINK_TEXT>



I can read the raw, voltage & % values just fine but the Version number isn’t quite what I expected



In the python sample code I can see…



def init(self, address=0x04):

self.address = address

self.bus = grove.i2c.Bus()



def read_raw(self, channel):

addr = 0x10 + channel

return self.read_register(addr)



# read input voltage (mV)

def read_voltage(self, channel):

addr = 0x20 + channel

return self.read_register(addr)



# input voltage / output voltage (%)

def read(self, channel):

addr = 0x30 + channel

return self.read_register(addr)



@property

def name(self):

id = self.read_register(0x0)

if id == RPI_HAT_PID:

return RPI_HAT_NAME

elif id == RPI_ZERO_HAT_PID:

return RPI_ZERO_HAT_NAME



@property

def version(self):

return self.read_register(0x3)



When I read register 0x3 to get the version info the value changes randomly.



Format = register num, byte value, word value



0,4,4 1,134,10374 2,2,2 3,82,79 4,0,0 5,0,0 6,0,0 7,0,0 8,0,0 9,0,0 10,0,0 11,0,0 12,0,0 13,0,0 14,0,0 15,0,0

0,4,4 1,134,10374 2,2,2 3,86,69 4,0,0 5,0,0 6,0,0 7,0,0 8,0,0 9,0,0 10,0,0 11,0,0 12,0,0 13,0,0 14,0,0 15,0,0

0,4,4 1,134,10374 2,2,2 3,32,66 4,0,0 5,0,0 6,0,0 7,0,0 8,0,0 9,0,0 10,0,0 11,0,0 12,0,0 13,0,0 14,0,0 15,0,0



It looks like register 1 or 2 (134/10374 or 2/2) might be the version number?



Is the code for the MCU available?



Thanks



@KiwiBryn

blog.devmobile.co.nz

Hi All



First cut of my Windows 10 IoT Core driver for the Grove Base Hat for Pi is here



<LINK_TEXT text=“https://github.com/KiwiBryn/GroveBaseHa … s10IoTCore”>https://github.com/KiwiBryn/GroveBaseHatWindows10IoTCore</LINK_TEXT>



The register for the version info might change, currently working on documentation,



@KiwiBryn

https://blog.devmobile.co.nz