Register Read Write EFM03

    • Register Read Write EFM03

      Hello,
      I want to connect a sensor to one of the GPIO registers provided with EFM03 within EFM03 wrapper design.
      To see if the apk has any effect, I tried to use the writeRegister call provided. However, when I write anything on the register and try to read it afterwards, the api always responds with a 0.
      I am not sure what was wrong with the call that I made in python so below is a snippet of the program that I used:

      # initialize api
      udk3api.init()

      # get EFM03 device
      for ed in udk3api.enumerate(udk3api.ALL):
      d = ed.open()
      if d.getDeviceInfo().getDeviceType() == udk3api.EFM03
      break

      # write register
      d.writeRegister(0x80000000, 0xdeadbeef)

      # read registerd
      val = d.readRegister(0x80000000)

      # close the device
      d.close()

      udk3api.deInit()

      This program shall be able to write to GPIO_tri_io_0 from what I understand. But when I check it on board or by reading as above there is no change.

      However I also observe that for EFM03 no code example for Register R/W is provided.

      So my question is is it possible to read/write registers from apk?

      Am I doing something wrong?

      Yours
    • Hello sopelvan,

      address 0x80000000 is mapped to IP block gpio_ss/axi_gpio_0 in our reference design
      which is an instance of the Xilinx GPIO IP block. Please consult the Xilinx "LogiCORE IP
      AXI GPIO" Product Guide to understand how it works. As far as I remember, you have
      to configure the GPIO block first with the direction of its signal connections. Usually
      the signal connections are either input or output, and not tri-state. You can write a
      value to the output bits, but you cannot read this value back from these output bits.
      In other words, the GPIO data register at address 0x80000000 does not behave like RAM.

      Reading and writing registers with UDK3 API is certainly possible.

      Best regards,

      Manfred Radimersky
      Software Development
      CESYS GmbH
    • Hello Manfred,

      I was able to make it work as an output channel and interestingly when you try to read the output channels it reads the output value as well. For this to work you first have to set the bits as outbut by setting the register at 0x80000004 to zeros. If you set the bits to ones they become input bits.
      Thanks for the answer
      Özgün