Tool/software: Code Composer Studio
Cannot send nor recieve data from bluetooth module hc 05 with the following code written in ccs-
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include "driverlib/interrupt.h"
#include <math.h>
#include <string.h>
#include"driverlib/pin_map.h"
#include"driverlib/sysctl.h"
#include"driverlib/uart.h"
#include"driverlib/uart.c"
#include "driverlib/adc.h"
//int32_t d='x';
unsigned char d;
int main(void)
{
int u=0;
/*Set the Bluetooth UART*/
SysCtlClockSet(SYSCTL_SYSDIV_10|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
GPIOPinConfigure(GPIO_PB0_U1RX);
GPIOPinConfigure(GPIO_PB1_U1TX);
/* Pull up the PB0 and PB1 */
GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_0 ,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU);
/* Make the UART pins be peripheral controlled. */
GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);
/* Sets the configuration of a UART. */
UARTConfigSetExpClk(UART1_BASE,16000000, 9600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
// while(UARTCharsAvail(UART1_BASE));
//
// unsigned char d = UARTCharGet(UART1_BASE);
//UARTCharPut(UART1_BASE,'b');
while(1)
{
d = UARTCharGet(UART1_BASE);
UARTCharPut(UART1_BASE,76);
UARTCharPut(UART1_BASE,'b');
UARTCharPut(UART1_BASE,'c');}
return 0;
}