UART RX Interrupt does not work.

cancel
Showing results for 
Search instead for 
Did you mean: 

UART RX Interrupt does not work.

819 Views
phpark
Contributor I

Hello. I work with MPC5606B, C, CodeWarrior. matlab.

I've tried to receive UART using RX ISR.

I add this function in main. 

 ==========================================================

void initUART(void){

LINFLEX_0.UARTCR.B.UART = 1; //enable UART mode
LINFLEX_0.UARTCR.B.WL1 = 1; //set 8-bit data
LINFLEX_0.UARTCR.B.RXEN = 1; //enable RX
LINFLEX_0.LINIER.B.DRIE = 1; //Data Reception Complete Interrupt Enable

}

==========================================================

and this ISR 

==========================================================

void TEST_UART (void)
{

LINFLEX_0.LINSR.R = 0xF23F;
LINFLEX_0.UARTSR.B.DRF = 1; //Data Reception Completed Flag

a++; // checking for ON/OFF

UartRxFillBuf();

linflex_data=UartRxDataByte();

}

==========================================================

each time I send TX, the a increases as my purpose, counting. It means, flag is set when the Board complete data reception.

when I tried to receive RX in main loop, I succeeded. So, There must be no problems in UART configuration. 

I can't find the reason why it doesn't work.

Please help me..

Labels (1)
1 Reply

452 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

I have no experience with matlab tool in this area, but in general, please check the following points:

  1. EE bit in MCR must be set to 1. Please check e200z0 core reference manual
  2. Interrupt service routine must be correctly installed in interrupt vector table at correct position (vector 79)
  3. In INTC_PSR_79 register, priority must be increased from default 0

From my point of view, there will be some problem with interrupt settings. Please check the point above and eventually, send me your project in CodeWarrior.

I have also recommendation for you, do not clear interrupt flags by bit access. Always use register access (.R not .B).

Regards,

Martin