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: IWR6843ISK + MMWAVEICBOOST and Arduino Mega: Enabling Uart tx and rx on the J5

Part Number: IWR6843ISK
Other Parts Discussed in Thread: MMWAVEICBOOST, IWR6843,

Hello Team,

 

I have been trying to send vital sign data from IWR6843+MMWAVEICBOOST to an Arduino mega. Also i have set the switch settings on the MMWAVEICBOOST as follows:

S12: on

S11:  off

S10: off

S9: on

S8: on

S7: off

S6: off

S5: on

S4: on

S3: off

S2: on

S1: off

 

Furthermore, i used jumper wires to connect the IWR6843ISK +MMWAVEICBOOST and the Arduino mega board as follows

MMWAVEICBOOST J5.                                   Arduino mega

Tx pin7                                                           Rx pin19

Rx pin5                                                           Tx pin18

GND pin4                                                         GND 5V

 

But i am still unable to send the data to the Arduino mega. So i decided to conduct further investigation on the matter and i found that (https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/910142/launchxl-cc1352r1-communicate-to-iwr6843-tida-010022-reference), i need to enable two UART ports using configuration as shown below:

+    /* Open mmwave configuration UART port */
+    UART_Params_init(&mmwaveUartParams);
+    mmwaveUartParams.writeDataMode = UART_DATA_BINARY;
+    mmwaveUartParams.readDataMode = UART_DATA_BINARY;
+    mmwaveUartParams.readReturnMode = UART_RETURN_FULL;
+    mmwaveUartParams.readEcho = UART_ECHO_OFF;
+    mmwaveUartParams.baudRate = 115200;  //Configuration baud rate
+    mmwaveUartParams.readTimeout = 500000 / Clock_tickPeriod;

...

+    /* Open mmwave logger UART port */
+    UART_Params_init(&mmwaveLoggerUartParams);
+    mmwaveLoggerUartParams.writeDataMode = UART_DATA_BINARY;
+    mmwaveLoggerUartParams.readDataMode = UART_DATA_BINARY;
+    mmwaveLoggerUartParams.readReturnMode = UART_RETURN_FULL;
+    mmwaveLoggerUartParams.readEcho = UART_ECHO_OFF;
+    mmwaveLoggerUartParams.baudRate = 921600;  //Configuration baud rate
+    mmwaveLoggerUartParams.readTimeout = 500000 / Clock_tickPeriod;

However, when i asked one at forum about this some weeks ago they said "As long as the Arduino is connected over UART, nothing would need to change since the breathing rate and heart rate are included in the Vital Signs Output Stats. The customer would need to parse the UART data to find the breathing and heart rate data in the vital signs output strucute"
(https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum/1133545/iwr6843isk-application-inquiry)

My Questions are :
1. Please can you provide mw with detailed explain of how to do this or may be an example?
2. Please can you provide mw with an example of a code to enable two uart port at J5 connector on the MMWAVEICBOOST?
4. Please what part of the program do i modify to used the data out via UART?
5. Please can you provide me with an example of a connecting between arduino the uart pin on mmwaveicboost 'd J5 connector?

Best regards,
James
  • Hi,

    I am looking into this and will get back to you with a response to your questions tomorrow.

    Best Regards,

    Josh

  • Hi,

    Please can you provide mw with detailed explain of how to do this or may be an example?

    If you are looking for code to reference which parses the data output from the radar device please take a look at the source code for our Industrial Visualizer (<INDUSTRIAL_TOOLBOX_INSTALL>/tools/Visualizer). Check out readAndParseUart() in gui_parser.py to see how this is done.

    The format of the vitals signs data can be seen in the Vitals Signs Demo User Guide.

    Please can you provide mw with an example of a code to enable two uart port at J5 connector on the MMWAVEICBOOST?

    Both UART ports should be enabled in most if not all of our demo code already. The reason you are not seeing data coming out on J5.5 is because the J5 pins (J5.5, J5.7) correspond to the Tx and Rx lines for the port used to configure the radar. The output data comes out on a different port, in the schematic this is referred to as MSS_LOGGER. This comes out to J6 pin 9 on the ICBOOST. 

    Please what part of the program do i modify to used the data out via UART?

    Could you elaborate on this a bit more? Are you running one of our demos/labs? Which one? Most demos already send the data out over UART.

    Please can you provide me with an example of a connecting between arduino the uart pin on mmwaveicboost 'd J5 connector?

    I am not familiar with Arduino hardware but a standard jumper wire should suffice. However If you want to connect both the configuration AND data ports you would need to connect to J6 pin 9 (on the ICBOOST) as well as those which you already mentioned. 

    Best Regards,

    Josh 

  • Hi Josh,

    Thank you for your support.

    1.readAndParseUart()
    Ans: Just to clarify, the vital signs data will need to be parsed before been sent to Arduino ?

    2. Could you elaborate on this a bit more?
    Ans: Do i need to modify any part of the Vital lab to send the data via J6 pin 9 to Arduino mega. In essence do i need to write a code to modify the dss or mss in order to send the data out to Arduino mega.

    3. Are you are running one of our demos/labs ?
    Ans: Yes, the vital signs labs

    5. However if you want to connect both the configuration AND data ports you would need to connect to J6 pin 9 (on ICBOOST) as well as those which you already mentioned.

    Ans: Just to clarify, simply connecting a jumper wire from J6 pin 9 on the ICBOOST to the rx pin on the Arduino mega will suffice ?
    Also, is a a particular switch setting i need use to enable the J6 pin 9 ?

    Best Regards,

    James

  • Hi,

    Just to clarify, the vital signs data will need to be parsed before been sent to Arduino ?

    No. The output data is sent via UART in TLV format. The UART stream should be read and parsed on the host (Arduino in your case) then the data can be used however you wish. You can find more info on the TLVs output by the Vitals Demo in the Vitals Signs Demo User Guide.

    Do i need to modify any part of the Vital lab to send the data via J6 pin 9 to Arduino mega. In essence do i need to write a code to modify the dss or mss in order to send the data out to Arduino mega.

    No modifications are required. The data is output via UART by default.

    Just to clarify, simply connecting a jumper wire from J6 pin 9 on the ICBOOST to the rx pin on the Arduino mega will suffice ?

    This will allow you to read output data stream from the device. If you wish to configure and start/stop the device from the Arduino then you will also need to connect to the config port (J5.5, J5.7).

    Also, is a a particular switch setting i need use to enable the J6 pin 9 ?

    Yes, please confirm with the MMWAVE-ICBOOST schematic which can be found on TI.com. In order to enable data output at J6.9 of the ICBOOST, I believe you will need S1.2 ON, S1.3 OFF (ICBOOST). Note: The IWR6843ISK EVM also requires certain switch settings to function with the ICBOOST carrier board. These settings can be found in this guide in the Industrial Toolbox under the section called "ISK Style With mmWaveICBoost Attached"

    Best Regards,

    Josh

  • Hello Josh

    Thank you for your support.
    So, i tried the switch setting (position for 40-pin LP/BP ) on page 11 of the 60GHz mmWave sensor EVM guide , bt still unable to receive data. In fact the vital signs demo doesn't run or flash on this switch setting, but when i change it back to the normal switch setting it works.

    Furthermore , i tried to use the normal switch on the MMWAVEICBoost but with S1.2 ON, S1.3 OFF. Then on the IWR6843ISK the switch setting were as followings :
    S1.1 : off
    S1.2 : off
    S1.3 : off
    S1.4 : off
    S1.5 : on
    S1.6 : off

    Now, with switch setting above vital signs demo ran, then i used a single jumper wire to connect the J6 pin9 on MMwaveicboost to Rx pin19 on the Arduino mega board. Next , i used an oscilloscope to verify if the data was been received by the Arduino mega board and nothing was been received .

    Best Regards,

    James

  • Hi, 

    Let me see if I can replicate this behavior on my end. 

    Which vitals signs lab are you running? Vital Signs with People Tracking or 68xx Vital Signs? And which version of the Industrial Toolbox?

    Best Regards,

    Josh

  • Hello Josh,

    Which vitals signs lab are you running? Vital Signs with People Tracking or 68xx Vital Signs? And which version of the Industrial Toolbox?

    Ans: 68xx vital signs with mmwave_industrial_toolbox_4_12_0

    Best Regards,

    James

  • Hi James,

    Please allow me some time to replicate this behavior on my setup and investigate further. I will respond here tomorrow with an update.

    Best Regards,

    Josh

  • Hi James, 

    I apologize for the delayed response. With MMWAVE-ICBOOST REV B. I was not able to reproduce the behavior that you describe. I can measure the UART data coming out  When S1.2 ON, S1.3 OFF (ICBOOST). 

    However, I was able to reproduce the behavior you describe with a MMWAVE-ICBOOST REV A.

    Can you confirm your MMWAVE-ICBOOST revision number?

    Best Regards,

    Josh

  • Hello Josh,

    I apologize for the delayed response. With MMWAVE-ICBOOST REV B. I was not able to reproduce the behavior that you describe. I can measure the UART data coming out When S1.2 ON, S1.3 OFF (ICBOOST).

    However, I was able to reproduce the behavior you describe with a MMWAVE-ICBOOST REV A.

    Can you confirm your MMWAVE-ICBOOST revision number?

    Ans: I don't how to find the revision number, but here are all the details about the MMWAVEICBOOST.
    Details on the box:
    (1P)MMWAVEICBOOST
    (Q) 1
    (D)2211
    (31T)LOT:2008102SVT
    (4W) TKY(1T) 0183459ZEA
    (P)
    (2P) REV: (V) 0033317
    (2OL) CS0: XXX (21L) CC0: XXX
    (22L) AS0: SVT (23L) AC0: USA

    Details on the board:

    Front of the board

    PROC074B-001

    C - 4B
    94V - 0
    E189010
    2 129

    EFTDI
    2051-C
    DHQ9WC1
    FT4232HL


    Back of the board

    TM4C129
    4NCPDTT3
    14AZG3W
    G4

    7007800600

    Also, can you share your full switch setting the mmwaveicboost and iwr6843-isk. And the position of the pin 9 on the J6 connector of mmwaveicboost .

    Best Regards,

    James

  • Hello James,

    Josh is out of office at the moment but I will help you best I can. I do not have the switch settings he was using. I am looking into the different markings between rev A and rev B.

    Thank you,

    Angie

  • Hello James,

    I have learned that the marking "PROC074B-001" indicates that your board in a rev B and not a rev A. I will get back to you shortly with the switch settings Josh used.

    Thank you,

    Angie

  • Hello Angie,

    Thank you for your quick reply.

    I've conveyed it to my customer.

    Have a good day .

    James

  • Hi James,

    Here are the switch settings Josh used:

    ISK: ICBOOST mode:
    S1.1 = OFF
    S1.2 = OFF
    S1.3 = OFF
    S1.4 = OFF
    S1.5 = ON
    S1.6 = OFF

    ICBOOST:
    S1.12 = ON
    S1.11 = ON
    S1.10 = ON
    S1.9 = OFF
    S1.8 = OFF
    S1.7 = ON
    S1.6 = ON
    S1.5 = ON
    S1.4 = ON
    S1.3 = OFF
    S1.2 = ON
    S1.1 = OFF

    Thank you,

    Angie

  • Hi Angie,

    Thank you for your support, i have tried it but i am still unable to send the data to an Arduino board. Also i have tried using python to start and send the config file to the board , i still got nothing. Please do you have any suggestions on how to send the vital signs to unity.

    Best Regards,

    James

  • Hi James,

    Lets take a step back. Can you connect the device to a PC and confirm that when following the steps outlined in the 68xx Vitals Signs User Guide you are able to view the vitals signs data using the GUI?

    Best Regards,

    Josh

  • Hi Angie,

    Yes, i can view the vital signs data using the GUI

    Best Regards,

    James

  • Hi James,

    Also i have tried using python to start and send the config file to the board , i still got nothing.

    When you say you got nothing do you just mean no output on the data port? Does the device send a response on the configuration port after each configuration command that you send? i.e. "Done"

    Best Regards,

    Josh

  • Hi Josh,

    Thank you for you support.

    When you say you got nothing do you just mean no output on the data port? Does the device send a response on the configuration port after each configuration command that you send? i.e. "Done"

    Answer: i don't get anything. it tells me "access to comport is denied " whenever i try to send the config file to the device (IWR6843+MMWAVEICBOOST) with a python a code. Please keep in mind that the vital signs application is not running at this point .However, i can open the comports on the device (IWR6843+MMWAVEICBOOST) with a python code when the application is NOT running and NOT trying to send the configfile.

    Best Regards,

    James

  • James,

    Are you running the python code on the arduino? Can you test the same code on a pc to ensure it is working?

    Also is this python code that you have written yourself or are you referencing TI code? You may wish to look at the source code for the mmWave Industrial Visualizer (found at <INDUSTRIAL_TOOLBOX_INSTALL>/tools/Visualizer) to see how we send the configuration commands to the device. 

    Best Regards,

    Josh

  • Hi Josh,

    Are you running the python code on the arduino? Can you test the same code on a pc to ensure it is working?
    Answer : Yes i can open the comport of the arduino with a different python code and read data from it in the visual studio code terminal.

    Also is this python code that you have written yourself or are you referencing TI code? You may wish to look at the source code for the mmWave Industrial Visualizer (found at <INDUSTRIAL_TOOLBOX_INSTALL>/tools/Visualizer) to see how we send the configuration commands to the device

    Answer : I referenced TI python code, all i did was change the comports name, name of the config file and location.Please see the code below

    import serial
    import time
    import numpy as np
    import pyqtgraph as pg
    from pyqtgraph.Qt import QtGui
    import matplotlib.pyplot as plt

    # Change the configuration file name
    configFileName = 'xwr68xxconfig.cfg'

    CLIport = {}
    Dataport = {}
    byteBuffer = np.zeros(2**15,dtype = 'uint8')
    byteBufferLength = 0;


    # ------------------------------------------------------------------

    # Function to configure the serial ports and send the data from
    # the configuration file to the radar
    def serialConfig(configFileName):

    global CLIport
    global Dataport
    # Open the serial ports for the configuration and the data ports

    # Raspberry pi
    #CLIport = serial.Serial('/dev/ttyACM0', 115200)
    #Dataport = serial.Serial('/dev/ttyACM1', 921600)

    # Windows
    CLIport = serial.Serial('COM6', 115200)
    Dataport = serial.Serial('COM5', 921600)

    # Read the configuration file and send it to the board
    config = [line.rstrip('\r\n') for line in open(configFileName)]

    for i in config:
    CLIport.write((i+'\n').encode())
    print(i)
    time.sleep(0.01)

    return CLIport, Dataport

    # ------------------------------------------------------------------

    # Function to parse the data inside the configuration file
    def parseConfigFile(configFileName):
    configParameters = {} # Initialize an empty dictionary to store the configuration parameters

    # Read the configuration file and send it to the board
    config = [line.rstrip('\r\n') for line in open(configFileName)]
    for i in config:

    # Split the line
    splitWords = i.split(" ")

    # Hard code the number of antennas, change if other configuration is used
    numRxAnt = 4
    numTxAnt = 3

    # Get the information about the frame configuration
    elif "frameCfg" in splitWords[0]:

    chirpStartIdx = int(splitWords[1]);
    chirpEndIdx = int(splitWords[2]);
    numLoops = int(splitWords[3]);
    numFrames = int(splitWords[4]);
    framePeriodicity = int(splitWords[5]);

    # Combine the read data to obtain the configuration parameters
    numChirpsPerFrame = (chirpEndIdx - chirpStartIdx + 1) * numLoops
    configParameters["numDopplerBins"] = numChirpsPerFrame / numTxAnt
    configParameters["numRangeBins"] = numAdcSamplesRoundTo2
    configParameters["rangeResolutionMeters"] = (3e8 * digOutSampleRate * 1e3) / (2 * freqSlopeConst * 1e12 * numAdcSamples)
    configParameters["rangeIdxToMeters"] = (3e8 * digOutSampleRate * 1e3) / (2 * freqSlopeConst * 1e12 * configParameters["numRangeBins"])
    configParameters["dopplerResolutionMps"] = 3e8 / (2 * startFreq * 1e9 * (idleTime + rampEndTime) * 1e-6 * configParameters["numDopplerBins"] * numTxAnt)
    configParameters["maxRange"] = (300 * 0.9 * digOutSampleRate)/(2 * freqSlopeConst * 1e3)
    configParameters["maxVelocity"] = 3e8 / (4 * startFreq * 1e9 * (idleTime + rampEndTime) * 1e-6 * numTxAnt)

    return configParameters

    # --------------------------------------------------------------

    # Funtion to read and parse the incoming data
    def readAndParseData14xx(Dataport, configParameters):
    global byteBuffer, byteBufferLength

    # Constants
    OBJ_STRUCT_SIZE_BYTES = 12;
    BYTE_VEC_ACC_MAX_SIZE = 2**15;
    MMWDEMO_UART_MSG_DETECTED_POINTS = 1;
    MMWDEMO_UART_MSG_RANGE_PROFILE = 2;
    maxBufferSize = 2**15;
    magicWord = [2, 1, 4, 3, 6, 5, 8, 7]

    # Initialize variables
    magicOK = 0 # Checks if magic number has been read
    dataOK = 0 # Checks if the data has been read correctly
    frameNumber = 0
    detObj = {}

    readBuffer = Dataport.read(Dataport.in_waiting)
    byteVec = np.frombuffer(readBuffer, dtype = 'uint8')
    byteCount = len(byteVec)

    # Check that the buffer is not full, and then add the data to the buffer
    if (byteBufferLength + byteCount) < maxBufferSize:
    byteBuffer[byteBufferLength:byteBufferLength + byteCount] = byteVec[:byteCount]
    byteBufferLength = byteBufferLength + byteCount

    # Check that the buffer has some data
    if byteBufferLength > 16:

    # Check for all possible locations of the magic word
    possibleLocs = np.where(byteBuffer == magicWord[0])[0]

    # Confirm that is the beginning of the magic word and store the index in startIdx
    startIdx = []
    for loc in possibleLocs:
    check = byteBuffer[loc:loc+8]
    if np.all(check == magicWord):
    startIdx.append(loc)

    # Check that startIdx is not empty
    if startIdx:

    # Remove the data before the first start index
    if startIdx[0] > 0 and startIdx[0] < byteBufferLength:
    byteBuffer[:byteBufferLength-startIdx[0]] = byteBuffer[startIdx[0]:byteBufferLength]
    byteBuffer[byteBufferLength-startIdx[0]:] = np.zeros(len(byteBuffer[byteBufferLength-startIdx[0]:]),dtype = 'uint8')
    byteBufferLength = byteBufferLength - startIdx[0]

    # Check that there have no errors with the byte buffer length
    if byteBufferLength < 0:
    byteBufferLength = 0

    # word array to convert 4 bytes to a 32 bit number
    word = [1, 2**8, 2**16, 2**24]

    # Read the total packet length
    totalPacketLen = np.matmul(byteBuffer[12:12+4],word)
    # Check that all the packet has been read
    if (byteBufferLength >= totalPacketLen) and (byteBufferLength != 0):
    magicOK = 1
    #print(f"magicOK = {magicOK}")

    # If magicOK is equal to 1 then process the message
    if magicOK:
    # word array to convert 4 bytes to a 32 bit number
    word = [1, 2**8, 2**16, 2**24]

    # Initialize the pointer index
    idX = 0

    # Read the header
    magicNumber = byteBuffer[idX:idX+8]
    idX += 8
    version = format(np.matmul(byteBuffer[idX:idX+4],word),'x')
    idX += 4

    totalPacketLen = np.matmul(byteBuffer[idX:idX+4],word)
    idX += 4
    platform = format(np.matmul(byteBuffer[idX:idX+4],word),'x')
    idX += 4
    frameNumber = np.matmul(byteBuffer[idX:idX+4],word)
    idX += 4
    timeCpuCycles = np.matmul(byteBuffer[idX:idX+4],word)
    idX += 4
    numDetectedObj = np.matmul(byteBuffer[idX:idX+4],word)
    idX += 4
    numTLVs = np.matmul(byteBuffer[idX:idX+4],word)
    idX += 4
    idX += 4
    #print(f"magicNumber = {magicNumber} \t version = {version} \t totalPacketLen = {totalPacketLen} \t platform = {platform} \t frameNumber = {frameNumber} ")
    #print(f"timeCpuCycles = {timeCpuCycles} \t\t numDetectedObj = {numDetectedObj} \t numTLVs = {numTLVs} \t\t idX = {idX}")

    # UNCOMMENT IN CASE OF SDK 2
    #subFrameNumber = np.matmul(byteBuffer[idX:idX+4],word)

    # Read the TLV messages
    for tlvIdx in range(numTLVs):

    # word array to convert 4 bytes to a 32 bit number
    word = [1, 2**8, 2**16, 2**24]

    # Check the header of the TLV message
    #print(f"byteBuffer[idX:idX+4] = {byteBuffer[idX:idX+4]}, word = {word}")
    tlv_type = np.matmul(byteBuffer[idX:idX+4],word)
    idX += 4
    tlv_length = np.matmul(byteBuffer[idX:idX+4],word)
    idX += 4
    #print(f"tlv_type = {tlv_type} \t MMWDEMO_UART_MSG_DETECTED_POINTS = {MMWDEMO_UART_MSG_DETECTED_POINTS}")
    # Read the data depending on the TLV message
    if tlv_type == MMWDEMO_UART_MSG_DETECTED_POINTS:

    # word array to convert 4 bytes to a 16 bit number
    word = [1, 2**8]
    tlv_numObj = np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2
    tlv_xyzQFormat = 2**np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2

    # Initialize the arrays
    rangeIdx = np.zeros(numDetectedObj,dtype = 'int16')
    dopplerIdx = np.zeros(numDetectedObj,dtype = 'int16')
    peakVal = np.zeros(numDetectedObj,dtype = 'int16')
    x = np.zeros(numDetectedObj,dtype = 'int16')
    y = np.zeros(numDetectedObj,dtype = 'int16')
    z = np.zeros(numDetectedObj,dtype = 'int16')
    #print(f"tlv_numObj = {tlv_numObj}")
    for objectNum in range(numDetectedObj):

    # Read the data for each object
    rangeIdx[objectNum] = np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2
    dopplerIdx[objectNum] = np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2
    peakVal[objectNum] = np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2
    x[objectNum] = np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2
    y[objectNum] = np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2
    z[objectNum] = np.matmul(byteBuffer[idX:idX+2],word)
    idX += 2

    #print(f"rangeIdx[{objectNum}] = {rangeIdx[objectNum]} \t dopplerIdx[{objectNum}] = {dopplerIdx[objectNum]} \t peakVal[{objectNum}] = {peakVal[objectNum]} \t x[{objectNum}] = {x[objectNum]} \t y[{objectNum}] = {y[objectNum]} \t z[{objectNum}] = {z[objectNum]} \t")

    # Make the necessary corrections and calculate the rest of the data
    rangeVal = rangeIdx * configParameters["rangeIdxToMeters"]
    dopplerIdx[dopplerIdx > (configParameters["numDopplerBins"]/2 - 1)] = dopplerIdx[dopplerIdx > (configParameters["numDopplerBins"]/2 - 1)] - 65535
    dopplerVal = dopplerIdx * configParameters["dopplerResolutionMps"]
    #x[x > 32767] = x[x > 32767] - 65536
    #y[y > 32767] = y[y > 32767] - 65536
    #z[z > 32767] = z[z > 32767] - 65536
    #print(f"tlv_xyzQFormat = {tlv_xyzQFormat} \t x = {x}")
    #x = x / tlv_xyzQFormat

    #y = y / tlv_xyzQFormat
    #z = z / tlv_xyzQFormat

    # Store the data in the detObj dictionary
    detObj = {"numObj": objectNum, "rangeIdx": rangeIdx, "range": rangeVal, "dopplerIdx": dopplerIdx, \
    "doppler": dopplerVal, "peakVal": peakVal, "x": x, "y": y, "z": z}

    dataOK = 1


    # Remove already processed data
    if idX > 0 and byteBufferLength > idX:
    shiftSize = totalPacketLen

    byteBuffer[:byteBufferLength - shiftSize] = byteBuffer[shiftSize:byteBufferLength]
    byteBuffer[byteBufferLength - shiftSize:] = np.zeros(len(byteBuffer[byteBufferLength - shiftSize:]),dtype = 'uint8')
    byteBufferLength = byteBufferLength - shiftSize
    # Check that there are no errors with the buffer length
    if byteBufferLength < 0:
    byteBufferLength = 0

    # ------------------------- MAIN -----------------------------------------

    # Configurate the serial port
    CLIport, Dataport = serialConfig(configFileName)

    # Get the configuration parameters from the configuration file
    configParameters = parseConfigFile(configFileName)

    # START QtAPPfor the plot
    """
    app = QtGui.QApplication([])

    # Set the plot
    pg.setConfigOption('background','w')
    win = pg.GraphicsWindow(title="2D scatter plot")
    p = win.addPlot()
    p.setXRange(-0.5,0.5)
    p.setYRange(0,1.5)
    p.setLabel('left',text = 'Y position (m)')
    p.setLabel('bottom', text= 'X position (m)')
    s = p.plot([],[],pen=None,symbol='o')

    win.show()
    app.exec_()
    """
    #plt.axis([0, 10, 0, 1])
    #plt.show()


    # Main loop
    detObj = {}
    frameData = {}
    currentIndex = 0
    for i in range(20):
    try:
    # Update the data and check if the data is okay
    dataOk = update()


    if dataOk:
    # Store the current frame into frameData
    frameData[currentIndex] = detObj
    currentIndex += 1

    time.sleep(0.033) # Sampling frequency of 30 Hz

    # Stop the program and close everything if Ctrl + c is pressed
    except KeyboardInterrupt:
    CLIport.write(('sensorStop\n').encode())
    CLIport.close()
    Dataport.close()
    #win.close()
    break

    Best Regards,

    James

  • Hi James,

    Yes i can open the comport of the arduino with a different python code and read data from it in the visual studio code terminal.

    This is not what I meant. Let me try to explain more clearly. So you are running some python code on the arduino which attempts to connect to the mmWave EVM, configure the device, and read output UART data, Is this Correct? If that is not working, are you able to run the same code on a PC (probably needs minor change of com port name)?

    Regards,

    Josh