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?
|
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? |
|||
|
|
|
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.
|
||||
|
|