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.

IWR6843: Query and can you provide IWR6843 mmWave Sensor schematics and pin diagram

Part Number: IWR6843

Hi Team,

I am working on a custom-built board (ESP32 & mmWave Sensor IWR6843). we're chosen ESP2_U2_Tx /Rx pins are connected to SMD RS232_Tx / Rx. over-on tap of SMD connector we put a mmWave sensor. my question here is, I want to send a configuration file to mmWave using ESP_U2_Tx / Rx and check the output using ESP_DEBUG_TX /Rx pins. I have checked the people count visualizer and MatLab code. but how to identified control port and data ports in the visualizer. how to recognizing this is a control port and this is the data port. how I can send commands over TTL to UART converter. please do the needful.

Here I am attached my c code. Please do the needful. please send me schematics and pin diagram of IWR6843.

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "nvs_flash.h"
#include "driver/uart.h"
#include "freertos/queue.h"
#include "esp_log.h"
#include "soc/uart_struct.h"

#include <unistd.h>
#include <signal.h> 
#include <termios.h>
#include <fcntl.h>  
#include <string.h>  
#include <pthread.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/socket.h>
#include <netinet/in.h> 
#include <arpa/inet.h>

#define ECHO_TEST_TXD  (17)
#define ECHO_TEST_RXD  (16)
 
#define BUF_SIZE (1024)

int i=0;
//int portfd_ZB;

//an example of echo test with hardware flow control on UART1
static void echo_task()
{
    const int uart_num0 = UART_NUM_0;
    uart_config_t uart_config0 = {
        .baud_rate = 115200,
        .data_bits = UART_DATA_8_BITS,
        .parity = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,    //UART_HW_FLOWCTRL_CTS_RTS,
        .rx_flow_ctrl_thresh = 122,
    };
 
    const int uart_num2 = UART_NUM_2;
    uart_config_t uart_config1 = {
        .baud_rate = 115200,
        .data_bits = UART_DATA_8_BITS,
        .parity = UART_PARITY_DISABLE,
        .stop_bits = UART_STOP_BITS_1,
        .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,    //UART_HW_FLOWCTRL_CTS_RTS,
        .rx_flow_ctrl_thresh = 122,
    };
    //Configure UART1 parameters
    uart_param_config(uart_num0, &uart_config0);
    uart_param_config(uart_num2, &uart_config1);
 
    uart_set_pin(uart_num0, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
    uart_set_pin(uart_num2, ECHO_TEST_TXD, ECHO_TEST_RXD, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
    
    //Install UART driver (we don't need an event queue here)
    //In this example we don't even use a buffer for sending data.
    uart_driver_install(uart_num0, BUF_SIZE * 2, 0, 0, NULL, 0);
    uart_driver_install(uart_num2, BUF_SIZE * 2, 0, 0, NULL, 0);
 
    uint8_t* data = (uint8_t*) malloc(BUF_SIZE);
	char config6843[24][64]={//"sensorStop\n",
		 /*"flushCfg\n",
		 "dfeDataOutputMode 1\n",
		 "channelCfg 15 5 0\n",
		 "adcCfg 2 1\n",
		 "profileCfg 0 60.6 30 10 62 0 0 53 1 128 2500 0 0 30\n",
		 "chirpCfg 0 0 0 0 0 0 0 1\n",
		 "chirpCfg 1 1 0 0 0 0 0 4\n",
		 "frameCfg 0 1 128 0 50 1 0\n",
		 "lowPower 0 0\n",
         "guiMonitor 1 1 0 0\n",
         "cfarCfg 6 4 4 4 4 16 16 4 4 55 67 0\n",
         "doaCfg 600 1875 30 1 1 0\n",
		 "SceneryParam -6 6 0.5 6\n",
		 "GatingParam 3 2 2 0\n",
		 "StateParam 10 5 100 100 5\n",
		 "AllocationParam 250 250 0.25 30 1 2\n",
		 "trackingCfg 1 2 250 20 52 82 50 90",*/
         "sensorStart\n"			
		} ;
		
	/*if((portfd_ZB =	uart_num2)<0){
	   		printf("%s: %s (%d)zigbee open port failed,portfd_ZB=%d\n",__FILE__,__func__,__LINE__,portfd_ZB); 
	   		
	  }
	  else*/
     for(i=0;i<24;i++){
	  	uart_write_bytes(uart_num2, (const char*)config6843[i], sizeof(config6843[i]));
		usleep(1000);	
	  }
	 // char* test_str = "This is a test string.\n";
	  //uart_write_bytes(uart_num2, (const char*)config6843[i], sizeof(config6843[i]));
     // usleep(1000);
				
    while(1) {
		
		//char* test_str = "This is a test string.\n";
		//uart_write_bytes(uart_num2, (const char*)test_str, strlen(test_str));
        //usleep(1000);
		
		// Read data from UART.
		int length = uart_read_bytes(uart_num2, data, BUF_SIZE, 200);
		printf("Received Data %.2x\n", length);
		for(int i=0;i < length; i++){
		printf("%.2x ", data[i]);
		}
		esp_err_t uart_flush(uart_port_t uart_num2);
    }
}
 
void app_main()
{
    //A uart read/write example without event queue;
    xTaskCreate(echo_task, "uart_echo_task", 1024, NULL, 10, NULL);
}

  • Hello Srikanth,

        RS232 lines are connected to control input port and MSS_logger (UART_TX) is the data output from the mmWave sensor. 

    You could refer below app-note for the command format.

    https://www.ti.com/lit/ug/swru529c/swru529c.pdf

    Thanks and regards,

    CHETHAN KUMAR Y.B.

  • I think you do not understand my problem statement. I have checked above mentioned pdf file and I have people count config file. but how to identify control input pins and MSS_logger(UART_Tx) pins in mmWave sensor. can you please provide schematics of the mmWave sensor or pin diagram? Have you checked the c code I provided in the previous message? I write code for sending config file commands through TTL to UART convert, this will connect to ESP32_U2_Tx / Rx pins. these pins are connected to RS232_Tx / Rx. but how will send these commands using I mentioned flow. again I have attached the c code for your reference. Please do the needful.

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include "freertos/FreeRTOS.h"
    #include "freertos/task.h"
    #include "esp_system.h"
    #include "nvs_flash.h"
    #include "driver/uart.h"
    #include "freertos/queue.h"
    #include "esp_log.h"
    #include "soc/uart_struct.h"
    
    #include <unistd.h>
    #include <signal.h> 
    #include <termios.h>
    #include <fcntl.h>  
    #include <string.h>  
    #include <pthread.h>
    #include <time.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <dirent.h>
    #include <sys/socket.h>
    #include <netinet/in.h> 
    #include <arpa/inet.h>
    
    #define ECHO_TEST_TXD  (17)
    #define ECHO_TEST_RXD  (16)
     
    #define BUF_SIZE (1024)
    
    int i=0;
    //int portfd_ZB;
    
    //an example of echo test with hardware flow control on UART1
    static void echo_task()
    {
        const int uart_num0 = UART_NUM_0;
        uart_config_t uart_config0 = {
            .baud_rate = 115200,
            .data_bits = UART_DATA_8_BITS,
            .parity = UART_PARITY_DISABLE,
            .stop_bits = UART_STOP_BITS_1,
            .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,    //UART_HW_FLOWCTRL_CTS_RTS,
            .rx_flow_ctrl_thresh = 122,
        };
     
        const int uart_num2 = UART_NUM_2;
        uart_config_t uart_config1 = {
            .baud_rate = 115200,
            .data_bits = UART_DATA_8_BITS,
            .parity = UART_PARITY_DISABLE,
            .stop_bits = UART_STOP_BITS_1,
            .flow_ctrl = UART_HW_FLOWCTRL_DISABLE,    //UART_HW_FLOWCTRL_CTS_RTS,
            .rx_flow_ctrl_thresh = 122,
        };
        //Configure UART1 parameters
        uart_param_config(uart_num0, &uart_config0);
        uart_param_config(uart_num2, &uart_config1);
     
        uart_set_pin(uart_num0, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
        uart_set_pin(uart_num2, ECHO_TEST_TXD, ECHO_TEST_RXD, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
        
        //Install UART driver (we don't need an event queue here)
        //In this example we don't even use a buffer for sending data.
        uart_driver_install(uart_num0, BUF_SIZE * 2, 0, 0, NULL, 0);
        uart_driver_install(uart_num2, BUF_SIZE * 2, 0, 0, NULL, 0);
     
        uint8_t* data = (uint8_t*) malloc(BUF_SIZE);
    	/*char config6843[24][64]={"sensorStop\n",
    		 "flushCfg\n",
    		 "dfeDataOutputMode 1\n",
    		 "channelCfg 15 5 0\n",
    		 "adcCfg 2 1\n",
    		 "profileCfg 0 60.6 30 10 62 0 0 53 1 128 2500 0 0 30\n",
    		 "chirpCfg 0 0 0 0 0 0 0 1\n",
    		 "chirpCfg 1 1 0 0 0 0 0 4\n",
    		 "frameCfg 0 1 128 0 50 1 0\n",
    		 "lowPower 0 0\n",
             "guiMonitor 1 1 0 0\n",
             "cfarCfg 6 4 4 4 4 16 16 4 4 55 67 0\n",
             "doaCfg 600 1875 30 1 1 0\n",
    		 "SceneryParam -6 6 0.5 6\n",
    		 "GatingParam 3 2 2 0\n",
    		 "StateParam 10 5 100 100 5\n",
    		 "AllocationParam 250 250 0.25 30 1 2\n",
    		 "trackingCfg 1 2 250 20 52 82 50 90",
             "sensorStart\n"			
    		} ;
    		
    	for(i=0;i<24;i++){
    	  	uart_write_bytes(uart_num2, (const char*)config6843[i], strlen(config6843[i]));
    		usleep(1000);	
    	  }*/
    				
        while(1) {
    		
    		char* test_str = "This is a test string.\n";
    		uart_write_bytes(uart_num2, (const char*)test_str, strlen(test_str));
            usleep(1000);
    		
    		// Read data from UART.
    		int length = uart_read_bytes(uart_num2, data, BUF_SIZE, 200);
    		printf("Received Data %.2x\n", length);
    		for(int i=0;i < length; i++){
    		printf("%.2x ", data[i]);
    		}
    		esp_err_t uart_flush(uart_port_t uart_num2);
        }
    }
     
    void app_main()
    {
        //A uart read/write example without event queue;
        xTaskCreate(echo_task, "uart_echo_task", 1024, NULL, 10, NULL);
    }

  • Srikanth,

       We need to know which mmWave sensor board you are using? Is it IWR6843ISK or IWR6843ODS board within this board there are multiple versions of the board are present. Could you please provide this information? 

    Thanks and regards,

    CHETHAN KUMAR Y.B.

  • I am using IWR6843ISK (IWR6843 QG) with 60GHz frequency. please check the provided code. I'm doing correct or wrong. 

    Regards,

    Srikanth

  • Srikanth,

        As I mentioned before IWR6843ISK comes with multiple versions of hardware, you need to provide details in terms of which version of IWR6843ISK you are using?

    E2E forum is providing the support for the TI silicon, We cannot give feedback on the non-TI chipset such as ESP32.

    For the code reviews of ESP32 you may have to take help from the corresponding chip vendor. We could provide support at interface boundary in-terms of specifications and requirements. 

    Thanks and regards,

    CHETHAN KUMAR Y.B.

  • Hi Chethan,

    Ok. but how to identify control port pins and data ports pins in mmWave sensor. do you have any pin diagram? 

    Regards,

    Srikanth

  • Hi Srikanth,

        We could point to the diagram, when you specify version of the IWR6843ISK board. Circuits are different between IWR6843ISK Rev B and IWR6843ISK Rev C/D. Hence If you confirm which version of the EVM you are using we could appropriately point to relevant locations.

    Thanks and regards,

    CHETHAN KUMAR Y.B.

  • Hi Chethan,

    Thank you for the update.

    I could not find the revision of the IWR6843ISK module. can you share all versions of the schematic and pin diagram? I will compare it to my IWR6843ISK sensor.

    Regards,

    Srikanth

  • Srikanth,

         All the versions of the schematic and Layout are in the IWR6843ISK product folder itself. 

    https://www.ti.com/tool/IWR6843ISK 

    Thanks and regards,

    CHETHAN KUMAR Y.B.

  • Thank you for the update Chetan,

    Actually, we're using the ESP32 module which is a global-wide wireless MCU with an IWR6843ISK mmWave sensor. you know very well, the working principle of the mmWave sensor is the config file is send through the Control port and the data will receive through the Data port using UART ports right. Is there any sample program to write the config parameters and read the data using UART communication? if you have can you please provide the sample code?

    Regards,

    Srikanth

  • Srikanth,

        There is no automated way to generate the config files, You may have to generate the configuration file by yourself. 

    You may want to review below sensing estimator which generates the json file after you chose the configuration and save the file. Some portion of the configuration could be used for creating the config file. But there is no sample code available for this.  

    https://dev.ti.com/gallery/view/1792614/mmWaveSensingEstimator/ver/1.3.0/ 

    However, you may want to review the secondary boot loader for this application. 

    /cfs-file/__key/communityserver-discussions-components-files/1023/6607.SBL_5F00_design.pdf

    And example code you could find in the below SDK section.

    D\ti\mmwave_sdk_03_0x_00_0x\packages\ti\utils\sbl

    Thanks and regards,

    CHETHAN KUMAR Y.B.

  • I have a configuration file. Everything I have like Config file, esp32 MCU, and IWR6843ISK mmWave sensor.  I'm asking about is there any sample code to send those parameters to the mmWave sensor and read data which is coming from the mmWave sensor. i have written c code and passing parameters like this. see the below format. like way is there any sample code?

    const char *test_str[] = {"dfeDataOutputMode 1\r",

    "channelCfg 15 5 0\r",
    "adcCfg 2 1\r",
    "adcbufCfg 0 1 1 1\r",
    "profileCfg 0 60.6 30 10 62 0 0 53 1 128 2500 0 0 30\r",
    "chirpCfg 0 0 0 0 0 0 0 1\r",
    "chirpCfg 1 1 0 0 0 0 0 4\r",
    "frameCfg 0 1 128 0 50 1 0\r",
    "lowPower 0 1\r",
    "guiMonitor 1 1 0 0\r",
    "cfarCfg 6 4 4 4 4 16 16 4 4 50 62 0\r",
    "doaCfg 600 1875 30 1 1 0\r",
    "SceneryParam -6 6 0.5 6\r",
    "GatingParam 4 3 2 0\r",
    "StateParam 10 5 100 100 5\r",
    "AllocationParam 250 250 0.25 10 1 2\r",
    "AccelerationParam 1 1 1\r",
    "PointCloudEn 0\r",
    "trackingCfg 1 2 250 20 52 82 50 90\r",
    "sensorStart\r"

    };

    Regards,

    Srikanth

  • Hi Srikanth,

    Its not evident from this discussion if you have looked at the various demos provided in the mmWave Industrial Toolbox. There are multiple demos which send a config file to the device code over UART and parse the output to visualize it using either Matlab or Python based GUI (source code is provided for all visualizers).

    Example:

    People Counting Visualizer: C:\ti\mmwave_industrial_toolbox_4_4_1\labs\people_counting\visualizer. The  user guide for this visualizer is available here.

    Area Scanner Visualizer: C:\ti\mmwave_industrial_toolbox_4_5_0\labs\area_scanner\68xx_area_scanner\gui.

    If you are looking for sample code to send a hardcoded config file from within C code to UART, you can look at the multiple E2E threads on this subject. Here are a couple of such threads which discuss this topic and the provided solution. Note that this example runs on the mmWave device itself, so you will need to extract and port the corresponding code from mmwave_cli.c to run it on your external microcontroller.

    CCS/IWR1642BOOST: How to run independently from the host computer

    CCS/IWR6843: Hard-code configuration commands

    To get an example of this approach with configuration commands that work with the latest SDK, please look at the 68xx AoP_ODS - Multiple Gesture and Motion Detection Lab in Industrial Toolbox.

    Regards

    -Nitin