Hello Team,
We are working on Address-Bit Multiprocessor Format where i have referred (slau445i) section 22.3.3.2. I have an issue with this its not working as i expected.
I tested the code with real term sent data through terminal by setting MARK and NONE. when i sent byte from real term setting NONE, it is entering into ISR (actually interrupt should not rise) and also into if condition and same happening by setting MARK(9th bit, here should rise interrupt) too. Why it is happening like that, am i mistake in configuration? below is the code i'm trying. can anyone help me in "Address-Bit Multiprocessor Format ". I'm very thankful if it is done through example.
int main(void)
{
static const uint8_t True = 1;
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
clock_setup();
initialize_gpio();
data_transfer_switch();
initialise_uart();
while (True)
{
if ((in_ptr) != (out_ptr))
{
UCA0TXBUF = array[out_ptr];
out_ptr++;
out_ptr &= 0x0F;
}
}
}
void initialise_uart()
{
UCA0IFG &= ~UCTXIFG; // Disable Enhanced Universal Serial Communication Interface(eUSCI)
// before UART configuration
// Configure UART pins
P1SEL0 |= BIT6 | BIT7; // set 2-UART pin as second function
// Configure UART
UCA0CTLW0 |= UCSWRST; // Put Enhanced Universal Serial Communication Interface in reset
UCA0CTLW0 |= UCTXADDR_1;
UCA0CTLW0 |= UCDORM_1;
UCA0CTLW0 |= UCSSEL__SMCLK; // clock source select is SMCLK
UCA0CTLW0 |= UCMODE_2;
// Baud Rate calculation
UCA0BR0 = baudrate_integer; // 24000000/1000000 = 24.0
UCA0MCTLW = baudrate_fractional; // 24000000/1000000 - INT(24000000/1000000) = 0
UCA0CTLW0 &= ~UCSWRST; // Initialize Enhanced Universal Serial Communication Interface(eUSCI)
UCA0IE |= UCRXIE; // Enable USCI_A0 Receive interrupt
__bis_SR_register(GIE); // To enter UART Interrupt Service Routine
}
/********** UART ISR *********************/
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch (__even_in_range(UCA0IV, USCI_UART_UCTXCPTIFG))
{
case USCI_NONE:
break;
case USCI_UART_UCRXIFG:
while (!(UCA0IFG & UCTXIFG));
status = (UCA0STATW & UCADDR);
if(status)
{
array[in_ptr] = UCA0RXBUF;
in_ptr++;
in_ptr &= 0x0F;
}
break;
case USCI_UART_UCTXIFG:
break;
case USCI_UART_UCSTTIFG:
break;
case USCI_UART_UCTXCPTIFG:
break;
default:
break;
}
}
