Hello,
i'm new to using msp430fr5969 i'm trying to transmit data using a bluetooth module (pan1026).
whenever i try to send a bit sequence from my processor to the bluetooth module (in order to set it up) i get the flag overrun error set.
would it be possible to help me control the flag to create a delay between sent bits.
#include "driverlib.h"
unsigned char TCU_HCI_RESET_REQ[4] = {0x01, 0x03, 0x0c, 0x00};
void main(void) {
P2SEL1 |= BIT5| BIT6; // Configure UART pins
P2SEL0 &= ~(BIT5| BIT6);
// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
// Startup clock system with max DCO setting ~8MHz
CSCTL0_H = CSKEY >> 8; // Unlock clock registers
CSCTL1 = DCOFSEL_3 | DCORSEL; // Set DCO to 8MHz
CSCTL2 = SELA__VLOCLK | SELS__DCOCLK | SELM__DCOCLK;
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers
CSCTL0_H = 0 ; // Lock CS registers
// Configure USCI_A1 for UART mode
UCA1CTLW0 = UCSWRST; // Put eUSCI in reset
UCA1CTLW0 |= UCSSEL__SMCLK; // CLK = SMCLK
UCA1BR0 = 4; // 8000000/16/115200
UCA1BR1 = 0x00;
UCA1MCTLW |=0x55; //UCOS16 | UCBRF_1;
UCA1CTLW0 &= ~UCSWRST; // Initialize eUSCI
UCA1IE |= UCRXIE; // Enable USCI_A0 RX interrupt
USART1_SendData(TCU_HCI_RESET_REQ,4);
while(1);
}
void USART1_SendByte (unsigned char data) {
while(!(UCA1IFG & UCTXIFG));
UCA1TXBUF = data;
}
void USART1_SendData (unsigned char data[], unsigned char length) {
unsigned char i;
for(i=0; i<length; i++) {
USART1_SendByte(data[i]);
}
}