Other Parts Discussed in Thread: CC2650
Hi,
I have been trying to implement communication with 2 different devices through UART. For that I tried to use the same UART to communicate with both but without great success, because one work fine, the other doesn't like it. So I was reading how to implement two UART, as I know that cc2650 only have 1, I know that I need to close one to start the other. The problem is that I need to change the board files to include another UART for different PINs. I did that and I notice that this variable "CC2650DK_5XD_UARTCOUNT" stay always 1 and not two as I need.
CC2650DK_5XD.h
/* UART Board */ #define Board_UART_RX IOID_4 /* P1.7 */ #define Board_UART_TX IOID_3 /* P1.9 */ #define Board_UART_RX1 IOID_12 /* P1.7 */ #define Board_UART_TX1 IOID_11 /* P1.9 */
#define Board_UART CC2650DK_5XD_UART0 #define Board_UART1 CC2650DK_5XD_UART1
typedef enum CC2650DK_5XD_UARTName { CC2650DK_5XD_UART0 = 0, CC2650DK_5XD_UART1 = 0, CC2650DK_5XD_UARTCOUNT } CC2650DK_5XD_UARTName;
now CC2650DK_5XD.c
/* UART objects */
UARTCC26XX_Object uartCC26XXObjects[CC2650DK_5XD_UARTCOUNT];
unsigned char uartCC26XXRingBuffer[CC2650DK_5XD_UARTCOUNT][32];
/* UART hardware parameter structure, also used to assign UART pins */
const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC2650DK_5XD_UARTCOUNT] = {
{
.baseAddr = UART0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_UART0,
.intNum = INT_UART0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.txPin = Board_UART_TX,
.rxPin = Board_UART_RX,
.ctsPin = PIN_UNASSIGNED,
.rtsPin = PIN_UNASSIGNED,
.ringBufPtr = uartCC26XXRingBuffer[0],
.ringBufSize = sizeof(uartCC26XXRingBuffer[0])
},
{
.baseAddr = UART0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_UART0,
.intNum = INT_UART0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.txPin = Board_UART_TX1,
.rxPin = Board_UART_RX1,
.ctsPin = PIN_UNASSIGNED,
.rtsPin = PIN_UNASSIGNED,
.ringBufPtr = uartCC26XXRingBuffer[0],
.ringBufSize = sizeof(uartCC26XXRingBuffer[0])
}
};
/* UART configuration structure */
const UART_Config UART_config[] = {
{
.fxnTablePtr = &UARTCC26XX_fxnTable,
.object = &uartCC26XXObjects[0],
.hwAttrs = &uartCC26XXHWAttrs[0]
},
{
.fxnTablePtr = &UARTCC26XX_fxnTable,
.object = &uartCC26XXObjects[0],
.hwAttrs = &uartCC26XXHWAttrs[0]
},
{NULL, NULL, NULL}
};
Do you know what I'm missing? When this is working with simple RTOS I will add it in a BLE program. Thank you.
Best Regards,
Miguel Vieira