Other Parts Discussed in Thread: CC3220S, TEST2
Hi Team,
I want to use the UART in a "multiprocessor format".
(The first byte of data is transmitted with parity bit 1.
Subsequent data is transmitted with the parity bit set to 0. )
Code Composer Studio Version: 10.2.0.00009
SimpleLink CC32xx SDK (4.40.00.07)
So, I changed the program from "C: \ ti \ simplelink_cc32xx_sdk_4_40_00_07 \ examples \ rtos \ CC3220S_LAUNCHXL \ drivers \ uartecho" and tested it.
* ======== uartecho.c ======== */ #include <stdint.h> #include <stddef.h> /* Driver Header files */ #include <ti/drivers/GPIO.h> #include <ti/drivers/UART.h> /* Driver configuration */ #include "ti_drivers_config.h" #include <ti/devices/cc32xx/inc/hw_memmap.h> #include <ti/drivers/uart/UARTCC32XXDMA.h> #include <ti\devices\cc32xx\inc\hw_uart.h> /* * ======== mainThread ======== */ void *mainThread(void *arg0) { char input; const char echoPrompt[] = "Echoing characters:\r\n"; UART_Handle uart; UART_Params uartParams; /* Call driver init functions */ GPIO_init(); UART_init(); /* Configure the LED pin */ GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW); /* Create a UART with data processing off. */ UART_Params_init(&uartParams); uartParams.writeDataMode = UART_DATA_BINARY; uartParams.readDataMode = UART_DATA_BINARY; uartParams.readReturnMode = UART_RETURN_FULL; uartParams.baudRate = 115200; uart = UART_open(CONFIG_UART_0, &uartParams); if (uart == NULL) { /* UART_open() failed */ while (1); } /* Turn on user LED to indicate successful initialization */ GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON); UART_write(uart, echoPrompt, sizeof(echoPrompt)); input = '5'; /* Loop forever echoing */ while (1) { // UART_read(uart, &input, 1); UARTParityModeSet( UARTA0_BASE, UART_PAR_ONE ); //Step1 UART_write(uart, &input, 1); //Step2 UARTParityModeSet( UARTA0_BASE, UART_PAR_ZERO ); //Step3 UART_write(uart, &input, 1); //Step4 usleep(20000); } }
When I Step Over the line of "Step 2", 1 byte was sent. This is the TX line of UART.
Next, when I Step Over the line of "Step 3", the TX line became Low.
I don't know the cause.
Then the "step 4" line doesn't work.
When I stepped in, I got an error in UART Busy.
Please tell me how to communicate in the multiprocessor format.
Thank you
Seitaro