AnsweredAssumed Answered

TWRK512 - K60 Tower board - Using serial port under interrupt under mqx for Kinetis K60Tower Board

Question asked by baljeet singh on Feb 10, 2011
Latest reply on Feb 14, 2011 by Petr MacHala

Description: Using serial port under interrupt under mqx for Kinetis K60 Tower Board

 I am trying to get the serial port working under ISR but having an issue to get it up and running.

I am using two uart ports - TTYD running under Interrupt (ITTYD and TTYD both are  enabled in user_config.h - is it legal to have both modes enabled at the same time)

TTYF: is the standard default port that runs in polling mode and is connected to PEMicro serial port.

 

Test:

  To send characters from theTTYF: toTTYD: and see those on theTTYD: terminal

  To send chars from TTYD: terminal to TTYF: in the same manner

   Only difference between the two is that one is on interrupt mode and one in polled mode.

   When a char is typed on TTYD: it should interrupt  and go to ISR routine.

 

Observations:

1. When a char is typed on TTYF: The char shows up on TTYD: but the interrupt forTTYD:is not triggered (does not get to any break point in the ISR. Who is sending char to TTYD: (may be the ISR is not installed and the default isr is doing it?)

 

How the interrupt is being installed:

1. I am following the example for installing user interruot given under mqx/examples/isr

2. Need to know if the isr has been installed correctly

3. I need to know how to read the data in interrupt mode after the interrupt starts working. A code example will go a long way.

This is what I have done so far:

1. Under the config directory modified: user_config.h Enabled ITTYD - #define BSPCFG_ENABLE_ITTYD 1
2. twrk60n512.h Added: #define BSP_UART3_INTERRUPT_VECTOR INT_UART3_RX_TX #define BSP_UART3_INTERRUPT_PRIORITY 2 Built psp and bsp package under config/twrk60n512
3. Ran the attached file that has been modified for ISR handling. ISR routine just counts the number of times it has been interrupted and the main routine prints the count. Code builds and runs but it never gets to the interrupt routine.-- 

 

 What other setup needs to be done? Also, Is there example code for the serial interrupt code Baljeet Singh

 

Outcomes