UART ISR for K70 in MQX

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

UART ISR for K70 in MQX

1,200件の閲覧回数
akshatsaraf
Contributor II

Hello,

I use interrupt driven UART ("ittyb:") in my project and wanted to send and receive strings over the UART.

I am able to receive the string, but only one byte is transmitting from the UART, Here is my sample uart ISR


void serial_isr(void *user_isr_ptr)

{

     UART_MemMapPtr sci_ptr = _bsp_get_serial_base_address (1);      //DES get base address for UART5

     uData = sci_ptr->S1;                                                                       //DES read status register.  Part of two step process to clear the interrupt flag.

     uData = sci_ptr->D;                                                                       //DES get the character

     //printf("%c", uData);

     switch(uData)

     {

          // Data processing...

     }

}

In main task:

void SerialZero_Task(uint32_t initial_data)

{

     serial_ptr = fopen (SERIAL_CHANNEL_ZERO, BSP_DEFAULT_IO_OPEN_MODE);

     if( serial_ptr == NULL )

     {

          printf("Error: Unable to open IO channel\n");

          _task_block();

      }

     param = TRUE;

     result = ioctl( serial_ptr, IO_IOCTL_SERIAL_SET_FLAGS , &param );

     if( MQX_OK != result )

     {

          _task_block();

     }

     result = ioctl(serial_ptr, IO_IOCTL_SERIAL_SET_BAUD, &baudrate);

     if (MQX_OK != result)

     {

          _task_block();

     }

     _nvic_int_init(INT_UART1_RX_TX, 2, TRUE); 

     _nvic_int_enable(INT_UART1_RX_TX); 

     _int_install_isr(INT_UART1_RX_TX, serial_isr, serial_ptr);

     while()

     { }

}

タグ(2)
0 件の賞賛
返信
1 返信

722件の閲覧回数
Luis_Garabo
NXP TechSupport
NXP TechSupport

Hi Saraf,

We have an appnote that shows how to use the UART with interrupts ( ittyx: ):

http://cache.freescale.com/files/32bit/doc/app_note/AN4022.pdf

This is the source code:

http://cache.freescale.com/files/32bit/doc/app_note/AN4022SW.zip

Take special attention to the file camera_task.c, in the function Camera_Init() and snapShot()


Regards,
Garabo

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信