MKE02Z16VLC4 Uart Interrupts Not Firing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MKE02Z16VLC4 Uart Interrupts Not Firing

561 Views
AnangBohra
Contributor I

Hi,

I am have some trouble getting the two uarts of the MKE02Z16VLC4 to work properly on my board. Both the uarts are interrupt driven but only one of them works. I am able to send and receive from one uart but not the other.

The problem specifically lies to UART0, which has same configuration as UART1 (9600 8N1 no flow control) but the interrupts wouldn't work at all. I am trying to send a stream of data but I get only one Tx Interrupt (I am using XX_OnTxChar interrupt).

My code also has a PWM interrupt, a timer interrupt, an ADC interrupt and all of them function well except the UART.

 

Can anyone point me to the right direction?

thanks

Labels (1)
0 Kudos
3 Replies

465 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Anang

When disable the UART1, whether the UART0 can work well ?

If yes, maybe the interrupt problem.

If no, there is some problem about the configuration , please check .

you can also show me you configuration code .

Hope it helps

Alice

0 Kudos

465 Views
AnangBohra
Contributor I

Hello Alice,

I am using KDS along with PE and it seems UART0 is not getting configured with PE so not sure where to look at.

I am basically just sending data every 50ms over UART0 or UART1 and have used PE to configure the UART0 on PIN 23, Pin24 of the micro (PA2, PA3).

If I send over UART1 then it works fine but if I send over UART0 then nothing comes out of the pin..Not sure if it has to do with UART0 clock or something..I am too new to Kinetis so dont know much.

void TransmitReedSwitchData(void)
{
    unsigned char i;
    unsigned char retVal;
    reedSwData[2] = GetReedSwitchInfo();
    for(i = 0; i < 4; i++)
    {
        SystemBusClearTransmitterReady();
        retVal |= SysBusIF_SendChar(reedSwData[i]); //USART1Write(bufferPtr->data[i]);
        if(retVal)
        {
            break;
        }
        while(!SystemBusIsTransmitterReady());
    }

}

the flag below is set in the events.c file (interrupt routines)

void SystemBusSetTransmitterReady(void)
{
    SB_DEVICE_SCI1_TX_EMPTY = 1;
}

Events.c file code..

void SysBusIF_OnTxComplete(void)
{
  /* Write your code here ... */
    SystemBusSetTransmitterReady();
}

All the above code works fine with UART1 but not with UART0 ..

0 Kudos

465 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Anang,

 - First please confirm the hardware is connect right, when use UART0 , use the pin of 23, 24

It is different with UART1 .

- After configure the PE component , the init code is in the function of "LDD_TDeviceData* ASerialLdd1_Init()" .

- You can set breakpoint to check whether it run to the function " SysBusIF_SendChar()", then step by step check

whether sand data .

- I recommend you can directly use the component of "Serial_LDD " .

Hope it helps

Alice

0 Kudos