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.
If you checked your F020 datasheet more thoroughly, you would find it on page 117. Take your time, man !
several datasheets will number interrupts without taking skips in the sequence into account.
THUS, I would never use the "interrupt number" from the datasheet, but always use (vector address - 3)/8
Erik
Thank you for pointing out the interrupt table. I actually wanted to know what VECTOR should i write in the ISR function. For eg: A timer 0 isr is defined as "void Timer0_ISR(void) interrupt TF0_VECTOR" What VECTOR must i write for ADC0??
For eg: A timer 0 isr is defined as "void Timer0_ISR(void) interrupt TF0_VECTOR" misleading name, Keil requires interrupy number. Of course, you can call it Ralph or whatever you want, but since the interrups have both numbers and vectors, this is really an awful name
What VECTOR must i write for ADC0?? if you pay me my hourly rate for one hour, I will look it up in the datasheet for you.
How many times do people have to be told?
Hit the preview button first to see how your post will appear, then hit the post button.
That is a good way of detecting a crazy name before releasing a post into the wild world.
... look at anyhing but the text field on preview
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)!