This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMAG5273EVM: Where is documtation on how to read data from the sensor using TI-SCB board in Python/C/Java or JavaScript preferably on Mac

Part Number: TMAG5273EVM
Other Parts Discussed in Thread: TI-SCB, TMAG5273

I've got the TMAG5273EVM 3-axis linear HALL sensor and the TI-SCB board and I can read the sensor using the (cloud based?) GUi.

Now I need to add some processing to the data more or less in real time for the next step in evaluation.

I suppose there is an API or some such through which I can get the data to my program, however I have been unable to find any documentation.

I woud prefer to do this on macOS but Linux (Raspberry PI) or Windows 10 will do too if that is the only option.

I'm proficient in C/Java/Python/JavaScript and can probably cope with any other language as long as I can get the documentation.

cheers Kusti

  • Kusti-

    Thanks for reaching out on E2E about the TMAG5273.

    We do have some code examples available to help interface with your own MCU here:

    https://www.ti.com/tool/TMAG5X73-CODE-EXAMPLE

    If instead, you're hoping to just send USB commands to the TI-SCB to configure and poll the sensor, you can do this by opening a serial connection on the USB COM port.  You can check the GUI for which port the EVM opens on your machine, and then use your software to open the port.  

    You should then be able to send string commands over USB to interface with TI-SCB.  You can get more details on the command format in the user's guide:

    https://www.ti.com/lit/ug/slyu058c/slyu058c.pdf#page=15

    Thanks,

    Scott

  • Thanks, USB serial port was exactly what I was looking for!

    I made a quick test and I can talk to the EVM and get a response but some key information is missing or I just failed to spot it.

    No matter what I send I ge the same response. For example, the documentation says 'id' is a command. If I send it I get back:

    {"acknowledge":"i"}

    {"error":{"no":2,"msg":"'i' is not a valid command"}}

    {"evm_state":"idle"}

    {"acknowledge":"d"}

    {"error":{"no":2,"msg":"'d' is not a valid command"}}

    {"evm_state":"idle"}

    So obviously EVM receives 'i' and 'd' and obviously I get back a valid response but my command need some more formatting which I did not spot from the documentation, maybe I have to read it the third time.

  • To clarify, I did this test on macOS terminal emulator ('screen') like this:

    screen /dev/cu.usbmodem123456782

    and I suppose the communication is ok because EMV sees what I type and I see EVM response.

    I tried every key on the keyboard and I always get back that key in the form of response:

    {"acknowledge":"c"}

    {"error":{"no":2,"msg":"'c' is not a valid command"}}

    {"evm_state":"idle"}

     

  • I did a quick test in Python and this works:


    import serial
     
    port = serial.Serial(port="/dev/cu.usbmodem123456782")
    
    port.write(b'rreg e')    
    print(port.readline())
    print(port.readline())
    print(port.readline())
    port.close()
    


    and I get back:
    b'{"acknowledge":"rreg e"}\r\n'
    b'{"register":{"address":14,"value":32768}}\r\n'
    b'{"evm_state":"idle"}\r\n'
    


    So apparently the trick is to send the command as one string in language of you choice write/print statement.

    Ok, works, but not very 'serial port' like behaviour.  Maybe mention this somewhere in the docs and
    mention that you cannot try this out with terminal emulator which I think is the obvious first port of call.
  • Kusti,

    I agree it would be helpful to clear this up in documentation. I will recommend to the team for future document updates to add this.

    To get around the terminal window sending each character as an individual command, you could alternately type the command you want to send in a text editor, and then copy + paste into the the terminal.  It should capture the entire string before sending the packet and let you use this interface.  I do apologize for any inconvenience this causes. 

    I'm glad to see you were able to sort it out using a Python script, which should help you automate device configuration.

    Thanks,

    Scott