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.

IWR6843ISK-ODS: GUI python code for SPI reading

Part Number: IWR6843ISK-ODS

Originally, I have GUI in toolbox of 3D people count and HVAC that demo target tracking via UART. How can I modify TI GUI python code to show target data on GUI directly from SPI read? For example, when I use Rapsberry Pi, there's no need to transfer data from SPI read to UART. Please tell me which part of TI toolbox GUI python code I need to modify to show data from SPI instead of UART.

  • Hi Hector,

    The file, oob_parser.py, uses the pyserial library to read from uart. You will have to replace this with SPI peripheral reads.

    Regards,

    Justin

  • Hi Justin,

    Don't I need to modify gui_main.py? In oob_parser.py, I see there're 2 functions: connectComPorts and readAndParseUart.

    1. connectComPorts is used to connect to COM port similar to Teraterm, right? If I use SPI, do I still need to use this function and modify it? Or just delete it?

    2. readAndParseUart can be modified as readAndParseSPI. There're SDK3xPointCloud, sdk3xTLVHeader, sdk3xPCHeader, Capon3DHeader, tlvHeader... in try-except. I don't understand how we can parse data to GUI here. What's the purpose of try-except here? I don't know how to replace UART by SPI in this part.

    Besides, what's saveBinary? As I see, it's to save dataCom.read(numBytes) in a binary file. Why numBytes needs to be set = 4666?

    If I change to SPI, can I still use dataCom.read() to read data? Where's the definition of dataCom in this code?

    Please explain more which lines I should modify for SPI data parse. 

  • Hi Hector,

    To find definition of dataCom, just search for it in the file - there aren't many instances so you will see that it is created by a call to Serial, it is a serial (UART) object.

    The program is simple:

    1. Create Serial objects (dataCom, UARTCom) that can be used to obtain data. These could be replaced with any object that returns binary data, so these need to be replaced by your SPI functions.

    2. Using the (in my case) Serial Objects, I read data, then parse it based on the lab encoding.

    3. This is sent to gui_main()

    Why Try, except? - If data isn't sent properly, a read/parse could fail, don't want to crash the program.

    If you want to understand program flow, look through gui_main to see what function is called when you press a button, then you will understand the order in which the program does stuff.

    Regards,
    Justin