Hi all
I am trying to send the word "hello" from CC2540 of keyfob UART0 alt.2
P1.4 for rx
P1.5 for tx
Now , I placed the next code under function SimpleBLEPeripheral_Init in file simpleBLEPeripheral.c
(I don't sure this is the right place)
The code is:
// For keyfob board set GPIO pins into a power-optimized state
// Note that there is still some leakage current from the buzzer,
// accelerometer, LEDs, and buttons on the PCB.
P0SEL = 0; // Configure Port 0 as GPIO
P1SEL = 0; // Configure Port 1 as GPIO
P2SEL = 0; // Configure Port 2 as GPIO
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 = 0x1F; // All port 1 pins (P2.0-P2.4) as output
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
//noam
PERCFG |= 0x01; //usart0 alt.2
U0GCR = 8;
U0BAUD = 59;
U0CSR = 0x80; //uart mode
U0UCR = 0x02; //low start bit, high end bit
U0CSR |= 0x40;
HalUARTInit();
halUARTCfg_t uartConfig;
uartConfig.configured = TRUE;
uartConfig.baudRate = HAL_UART_BR_9600;
uartConfig.flowControl = FALSE;
uartConfig.flowControlThreshold = 0;
uartConfig.rx.maxBufSize = 0;
uartConfig.tx.maxBufSize = 0;
uartConfig.idleTimeout = 0;
uartConfig.intEnable = 0;
uartConfig.callBackFunc = NULL;
HalUARTOpen(HAL_UART_PORT_0,&uartConfig);
My code is under the line "//noam"
in the same file under function I place the code:
static void performPeriodicTask( void )
{
//noam
HalUARTWrite(HAL_UART_PORT_0, "Hello!\r\n", 8);
...
}
I trying to get the message with TeraTerm, But I don't get it. What can be the problem?