Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I am working on LPC2468 and using UART0 of the controller for communication with sim300 gprs module. Sometimes if i send a command for reading the signal strength of the sim the input I receive is not correct. After looking upon the problem I found the problem that sometimes when the UART is receiving information at same time the timer gets called and the software goes to the timer block. in that duration some bytes sent by the module gets missed. To prevent this i want to configure UART0 as FIQ i.e. interrupt having highest priority. can I configure UART0 as FIQ.If yes How?

share|improve this question

2 Answers

up vote 1 down vote accepted

You can use FIQs for UART (or any other interrupt) - you may need to do some fiddling with your compiler's startup code to set it up. However if you are losing characters from a FIFO'd UART, unless you are using a very high baudrate, I'd be looking at why the other interrupts are taking so long to complete and trying to improve this aspect of things.

A cursory web search tells me the max rate for this module is 115200 baud, about 86uS per byte. Using the fifo in 8 byte mode gives you nearly 800uS to service the UART interrupt. If your other interrupts are taking this long to complete you should probably be looking at fixing this this rather than using FIQs for the UART interrupt.

Have you actually measured your worst-case interrupt latency? Are you seeing UART overrun errors?

share|improve this answer

Yes, you can assign UARTs to FIQ.

Most manufacturers have, apart from the datasheets, user manuals for families of microcontrollers, where common features to that family are described. So if you can't find something in the datasheet, get the user manual.

In this case you need the LPC24xx User Manual, in particular table 108 on page 114. In the Interrupt Select Register you assign which of the 32 interrupt sources is assigned to FIQ, and which to IRQ. Table 117 on page 118 tells you that UART0 is bit 6 in that register.

The fastest possible FIQ latency is achieved when only one request is classified as FIQ, because then the FIQ service routine can simply start dealing with that device. But if more than one request is assigned to the FIQ class, the FIQ service routine can read a word from the VIC that identifies which FIQ source(s) is (are) requesting an interrupt.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.