Topic : uPSD ISR Vectors

Forum : 8051

Original Post
Post Information Post
April 17, 2007 - 11:31pm
Guest

How is the ISR Vector address specified for UART1 on a uPSD. According to the help files in RIDE the following is demonstrated:

Priority Source Flag Vector address Interrupt number
1 INT0 IE0 03H highest priority 0
2 Timer 0 TF0 0BH 1
3 INT1 IE1 13H 2
4 Timer 1 TF1 1BH 3
5 PCA CF,CCFn 33H 6
6 Serial I/O RI,TI 23H 4
7 Timer 2 TF2/EXF2 2BH lowest priority 5

According to the ST datasheets the Vector Address for the uPSD is 004Bh. Any ideas?

Replies
Post Information Post
+1
0
-1
April 18, 2007 - 9:32am
Guest

Hello,

This list is not exhaustive. In fact here is the algorithm used (0x03 and 0x08 are modifiable values but here is the default behavior):

int_addr = 0x03 + (0x08*int_number), which leads to int_number = (int_addr - 0x03) / 0x08.

In your case, with int_addr = 0x4B, you get the interrupt number 9. So you can define your routine like this :

void uart1_isr(void) interrupt 9
{
   [...]
}

Addition for uPSD devices :
The interrupt numbers and vector addresses are already defined in the header files. For example, you have
#define UART1_VECTOR            9                  //0x4B Serial Port 1
#define UART1_VECTOR_ADDR       0x4B

in upsd3300.h.

so you can use

void uart1_isr(void) interrupt UART1_VECTOR
{
   [...]
}

Easy, isn't it?

regards,
Lionel