AnsweredAssumed Answered

UART in interrupt mode

Question asked by Matias Ferrari on Dec 13, 2010
Latest reply on Dec 13, 2010 by Matias Ferrari

Hi everyone,

 

My problem is when isrUART2 runs because I can't read the data received. I don't know how I read URB2 register (data is correctly stored into URB2).

 

I show step by step my code:

 

fh_ptr = fopen("ittyc:", (pointer)(IO_SERIAL_XON_OFF | IO_SERIAL_TRANSLATION);

_int_install_isr(BSP_UART2_INT_VECTOR, uart_isr, fh_ptr);

for(;:smileywink:;

 

then my isr function is:

 

void uart_isr((pointer user_isr_ptr){

MQX_FILE_PTR fd;

fd = (MQX_FILE_PTR)user_isr_ptr;

read(fd,&buffer[0],1);

}

 

read function never returns because into fd there isn't any data to read. But, as I mention before, into URB2 register the data that I sent is correctly stored.

 

Obviously, the pointer to file that I'm passing to uart_isr don't aim to the registers of UART2. How do I have to pass this pointer?

 

Thanks in advance

 

 

Outcomes