Other Parts Discussed in Thread: CC2540
Hi All,
Use CC2540 in custom board, RF part work properly and can communicate with TI iPhone 5 utility.
I'm debuging digital communication part. As reference I use "SimpleBLEPeripheral". My custom board is identical to CC2540 USB dongle, instead pins of CC2540: P1_7, P1_6 connected to Stellaris UART (PA1,PA0 respectively). I don't want use flow control. (see schematic below for clarification)
I want just send to Uart 1, some peace of data. Here is my way:
1. In options of "SimpleBLEPeripheral"
INT_HEAP_LEN=3072
HALNODEBUG
OSAL_CBTIMER_NUM_TASKS=1
HAL_AES_DMA=TRUE
HAL_DMA=TRUE
xPOWER_SAVING
PLUS_BROADCASTER
HAL_LCD=FALSE
HAL_LED=FALSE
HAL_UART
HAL_UART_DMA=2
xCC2540_MINIDK
2. In "void SimpleBLEPeripheral_Init( uint8 task_id )" I/O and UART configurations:
// IO Config
P0SEL = 0; // Configure Port 0 as GPIO
P1SEL = 0; // Configure Port 1 as GPIO
P2SEL = 0; // Configure Port 2 as GPIO
P0DIR = 0xFF;//P0DIR = 0xFC; // Port 0 pins P0.0 and P0.1 as input (buttons),
// all others (P0.2-P0.7) as output
P1DIR = 0xFF; // All port 1 pins (P1.0-P1.7) as output
P2DIR = 0xEF; // All port 1 pins (P2.0-P2.4) as output
P0 = 0;//P0 = 0x03; // All pins on port 0 to low except for P0.0 and P0.1 (buttons)
P1 = 0; // All pins on port 1 to low
P2 = 0; // All pins on port 2 to low
// Configure UART1 for Alternative 2 => Port P1 (PERCFG.U1CFG = 1)
PERCFG |= 0x02;
// P1SEL.SELP1_4/5/6/7 = 1 => CT = P1_4, RT = P1_5, TX = P1_6, RX = P1_7
P1SEL |= 0xC0;
// Configure relevant Port P0 pins back to GPIO function
// P0SEL &= ~0x3C;
// UART Config
halUARTcfg.configured = TRUE;
halUARTcfg.baudRate = HAL_UART_BR_115200;
halUARTcfg.flowControl = FALSE;
halUARTcfg.flowControlThreshold = 48;
halUARTcfg.rx.maxBufSize = 128;
halUARTcfg.tx.maxBufSize = 128;
halUARTcfg.idleTimeout = 6;
halUARTcfg.intEnable = TRUE;
halUARTcfg.callBackFunc = NULL;//sbpSerialPacketParser; // Call-back function
(void)HalUARTOpen( HAL_UART_PORT_1, &halUARTcfg );
3. In "static void performPeriodicTask( void )" function:
HalUARTWrite(HAL_UART_PORT_1,"qwerty",2);
P1^=0x02; //blink LED
I can see blinking led, but oscilloscope show "0" on TX (P1_6) of CC2540
Please any advice. Why data is not transmited throw UART1?
