Content originally posted in LPCWare by dragilla on Mon Dec 31 05:04:10 MST 2012
Hello again. After a longer while I'm back at this topic. Still can't figure it out. Maybe this time someone can help me grasp it?
I'm not sure what priorities I give and it is quite important after all :)
edit: ok, there is a mistake in my calculations in first post. There are 4 interrupts in each register. So it's 9*4*5 = 180 bits. Or 32 bits (register size) * 9 registers = 288. It's not 240 no matter how I try to calculate.
However NVIC->IP[5] is what one's suppose to use when setting the priority for UART0 (UART0_IRQn is defined as 5 in LPC17xx.h) and UART0 is fifth (calculating from 0) interrupt in the IPR registers (it is in second position in second register). Another example of matching (kind of) is RIT_IRQn (which I also happen to use) with number 29 (also 29th in registers). There are 35 iterrupts in IPR regs and 35 indexes (0-34) defined in LPC17xx.h.
I still don't understand. Maybe some guide or clue please? How to debug this?