AnsweredAssumed Answered

MPC5744P, LinFlexD in UART mode affecting Hall sensor capture interrupts

Question asked by Azeem UH on May 7, 2019
Latest reply on May 12, 2019 by Petr Stancik

Hi

I am facing an issue with the BLDC motor commutation speed when LINFlexD communication is in progress. When I send the measured speed information to PC terminal using LINFlexD in UART mode, I find that the motor commutation is affected. Thinking this is due to the interrupt priorities, I have set the Hall sensor capture interrupt priority to a high value.

INTC_0.PSR[611].R = 0x801D;  //Set priority for external eTimer interrupt.

I am using the below example code for transmitting the values using LINFlexD

 

/*******************************************************************************
Function Name : TransmitData
Parameters : pBuf - input string. won't be modified by the function
: cnt - input number of characters to be transmitted
Notes : Tx data on LINFlexD_1. polled mode.
*******************************************************************************/
void TransmitData(const char *pBuf, uint32_t cnt)
{
uint8_t j = 0; // Dummy variable

for (j=0; j< cnt; j++)
{ // Loop for character string
LINFlexD_1.BDRL.B.DATA0 = *(pBuf+j);
//write character to transmit buffer
while (1 != LINFlexD_1.UARTSR.B.DTFTFF) {}
// Wait for data transmission completed flag
LINFlexD_1.UARTSR.R = 0x0002;
// clear the DTF flag and not the other flags
}
}

 

Can anyone help please?

Outcomes