lpcware

Unable to Send data for lpc1769 - xbee wireless communication using tera term

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by PokeDigi on Mon Apr 13 04:43:30 MST 2015
This is my code

#include <stdio.h>
#include <string.h>
#include "lpc17xx_pinsel.h"
#include "lpc17xx_gpio.h"
#include "lpc17xx_i2c.h"
#include "lpc17xx_ssp.h"
#include "lpc17xx_timer.h"
#include "lpc17xx_uart.h"

#include "led7seg.h"
#include "pca9532.h"
#include "acc.h"
#include "oled.h"
#include "light.h"
#include "temp.h"


static char* msg = NULL;

void pinsel_uart3(void){
PINSEL_CFG_Type PinCfg;
PinCfg.Funcnum = 2;
PinCfg.Pinnum = 0;
PinCfg.Portnum = 0;
PINSEL_ConfigPin(&PinCfg);
PinCfg.Pinnum = 1;
PINSEL_ConfigPin(&PinCfg);
}

void init_uart(void){
UART_CFG_Type uartCfg;
uartCfg.Baud_rate = 115200;
uartCfg.Databits = UART_DATABIT_8;
uartCfg.Parity = UART_PARITY_NONE;
uartCfg.Stopbits = UART_STOPBIT_1;
//pin select for uart3;
pinsel_uart3();
//supply power & setup working par.s for uart3
UART_Init(LPC_UART3, &uartCfg);
//enable transmit for uart3
UART_TxCmd(LPC_UART3, ENABLE);
}


int main (void){
uint8_t data = 0;
uint32_t len = 0;
uint8_t line[64];
init_uart();
//test sending message
msg = "Welcome\r\n";
UART_Send(LPC_UART3, (uint8_t *)msg , strlen(msg), BLOCKING);
//test receiving a letter and sending back to port
UART_Receive(LPC_UART3, &data, 1, BLOCKING);
UART_Send(LPC_UART3, &data, 1, BLOCKING);
//test receiving message without knowing message length
len = 0;
do
{ UART_Receive(LPC_UART3, &data, 1, BLOCKING);
if (data != '\r')
{
len++;
line[len-1] = data;
}
} while ((len<64) && (data != '\r'));
line[len]=0;
UART_SendString(LPC_UART3, &line);
printf("--%s--\n", line);
while (1);
return 0;
}

I am able to receive the message - Welcome on Tera term buy I try pressing any keys , there is no signal at all . May I know where gone wrong? It is able to work in a wire communication (able to send and receive) but not in wireless communication

Outcomes