AnsweredAssumed Answered

Simple UART interrupt problem

Question asked by dbrsdudk on Jun 2, 2010
Latest reply on Jun 2, 2010 by dbrsdudk

Hi,

 

I'm quite new to the Blackfin processor and struggeling with a problem thtat should be simple...

 

I'm using a BF561 processor and gcc as compiler, and trying to get the uart up and running using interrupts. Using polling everything is fine.

 

The problem is that the TX interrupt isr is never called.

 

The code is more or less a copy of the code in the examples that comes with VisualDSP++.

 

My uart initialization procedure looks like this:

void uart_setup(void)

{

     *pUART_GCTL=UCEN;     //enable uart

     *pUART_LCR=DLAB;       //enable divisor latch

     *pUART_DLL=54;            //set baud rate

     *pUART_DLH=0;

     *pUART_LCR=WLS(8);    //set 8N1

 

     *pILAT|=EVT_IVG9;

     *pSICA_IAR3=Peripheral_IVG(29,9);

     asm("ssync;");

     *pSICA_IMASK0|=SIC_MASK(29);

     *pEVT9=UART_TX_ISR;

 

     int temp=*pUART_RBR;

     temp=*pUART_LSR;

     temp=*pUART_IIR;

 

     *pUART_IER=ETBEI;

}

 

and the ISR simply transmits a buffer and looks like this:

void __attribute__((interrupt_handler)) UART_TX_ISR(void)

{

     if (!buffer_isEmpty())

     {

          *pUART_THR=buffer_getChar();

          asm("ssync;");

     }

     else

     {

          temp=*pUART_IIR;

          asm("ssync;");

          asm("ssync;");

     }

}

 

I start the transmission by loading the buffer and copying the first char directly to the UART_THR. The first byte is transferred just fine, but the ISR is never triggered.

 

Any suugestions to why the interrupt is never generated?

Outcomes