SC16IS740 SPI TLR Interrupt

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

SC16IS740 SPI TLR Interrupt

1,080 Views
satbir7
Contributor III

Hello All,

I am trying to get an interrupt when 4 characters have been received by the SPI to UART bridge, and I do get an interrupt on the IRQ pin, but the interrupt source is always Time Out 0xCC, in IIR, instead of 0xC4. 

Following code is used to set the UART Bridge. 

SPI_Write (0x03, 0x80); // LCR 0x80 to program baud rate
SPI_Write (0x00, 0x0D); // DLL 0xD = 9600 with X1=2 MHz
SPI_Write (0x01, 0x00); // DLH divisor = 0xD for 9600 BPS

SPI_Write (0x03, 0xBF); // LCR access EFR register
SPI_Write (0x02, 0x10); // EFR enable enhanced registers EFR[4] = 1
SPI_Write (0x04, 0x04); // MCR enable TLR registers MCR[2] = 1
SPI_Write (0x07, 0x10); // TLR RX interrupt Trigger Level Set to 4 Characters
SPI_Write (0x04, 0x00); // MCR Disable TLR registers MCR = 0

SPI_Write (0x03, 0x00); // LCR Clear LCR

SPI_Write (0x03, 0x03); // LCR 8 data bit, 1 stop bit, no parity
SPI_Write (0x01, 0x01); // IER Enable RX Interrupt

SPI_Write (0x02, 0x06); // FCR reset TXFIFO, reset RXFIFO, non FIFO mode
SPI_Write (0x02, 0x01); // FCR enable FIFO mode

It interrupts correctly if I send 8 characters. 

Please advice if this is even possible or what am I doing wrong?

Thanks,

Satbir

Tags (3)
0 Kudos
2 Replies

762 Views
satbir7
Contributor III

Thank you David for replying.

Sorry for the late response.

Yes, I have tried reading the 0x07 Register, after I have written to it, and it does return 0x10. 

I am using the CLKOUT feature of the LPC11C14 to provide clock to SPI/UART chip, and the MCU runs of a 16MHz crystal. The PLL loops waits for the clock to get stable and then the Setup is done on the chip. 

Any other advise ?

Regards,

Satbir

0 Kudos

762 Views
david_diaz
NXP Employee
NXP Employee

Hello Satbir,

Can you read the TLR register in order to verify that 0x10 has been written? Can you please share your results?

 

As an additional note, if a crystal is used, the host processor must wait until the crystal is generating a stable clock before accessing the UART transmitter or receiver. Are you waiting for the stable clock?

The crystal’s start-up time depends on the crystal being used, VCC ramp-up time and the loading capacitor values.

Regards,

David

0 Kudos