We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am writing a ADC0 ISR for 8051f020. But i dont know the interrupt no. for ADC0 Interrupt(AD0INT). Hence i need a interrupt vector table where interrupt nos. may be listed. I am unable to find it on net and have read datasheet but could not find it. I cant poll the interrupt.
Kindly help.
First, you must look in the manufacturer's Datasheet for the specific chip to see what hardware vector address it uses for its "ADC0" (this has nothing to do with Keil).
Then you look at this table to see how Keil C51 maps the address to its own "interrupt number":
http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm
Simples.
Similarly for any other chip-specific interrupts...
I have added this in header file (main.h)
//----------------------------------------------------------------------------- // Interrupt Priorities //----------------------------------------------------------------------------- #define IE0_VECTOR 0 // External Interrupt 0 #define TF0_VECTOR 1 // Timer0 Overflow #define IE1_VECTOR 2 // External Interrupt 1 #define TF1_VECTOR 3 // Timer1 Overflow #define UART0_VECTOR 4 // Serial Port UART0 #define TF2_VECTOR 5 // Timer2 Overflow #define SPIF_VECTOR 6 // SPI0 Interface #define SI_VECTOR 7 // SMBus0 Interface #define AD0WINT_VECTOR 8 // ADC0 Window Comparison #define CF_VECTOR 9 // PCA0 Peripheral #define CP0FIF_VECTOR 10 // Comparator0 Falling Edge #define CP0RIF_VECTOR 11 // Comparator0 Rising Edge #define CP1FIF_VECTOR 12 // Comparator1 Falling Edge #define CP1RIF_VECTOR 13 // Comparator1 Rising Edge #define TF3_VECTOR 14 // Timer3 Overflow #define AD0INT_VECTOR 15 // ADC0 End Of Conversion #define TF4_VECTOR 16 // Timer4 Overflow #define AD1INT_VECTOR 17 // ADC1 End Of Conversion #define IE6_VECTOR 18 // External Interrupt 6 #define IE7_VECTOR 19 // External Interrupt 7 #define UART1_VECTOR 20 // Serial Port UART1 #define XTLVLD_VECTOR 21 // External Crystal Oscillator Ready
Dejan, Thank you for pointing out.
And Sorry guys, for not searching the datasheet properly.
As already noted, they are very bad names!!
Your definitions are interrupt Numbers - they are not vectors!!
From where can i get the list of this vectors???
You don't actually need the list of vectors; you just need to rename your constants to reflect what they actually are - interrupt numbers!!
However, for completeness, see the link which I posted on 5-Oct-2012 at 18:56 GMT...
on page: http://www.keil.com/dd/chip/3312.htm you will find all about C8051F020 and long datasheet is there! http://www.keil.com/dd/docs/datashts/silabs/c8051f02x.pdf
on page 117 are all interrupts with vectors (starting absolute addres of interrupt) and interupt numbers(=Priority order)!