Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

doubt related to ISR in PIC18f

Status
Not open for further replies.

vinodstanur

Advanced Member level 3
Joined
Oct 31, 2009
Messages
751
Helped
114
Reputation
234
Reaction score
114
Trophy points
1,333
Location
Kerala (INDIA)
Activity points
7,054
I have used msp430 and I found an interrupt vector table which in which different interrupts like adc, uart, int, tmr0 etc could be configured individually.. I mean its not a single ISR in which we check the flag using if else ...

I am new to PIC18F.

Now I thought a similar setup will be there in PIC18F. But unfortunately, I couldn't find such vector table etc in data sheet. So in PIC18F also, there is a single ISR in which we need to perform a software check (if else) to know if it is a tmr0 interrupt or an external interrupt or uart interrupt etc ?
 

There are two vector tables for PIC18F

Low-Priority Interrupt and High Priority Interrupt

High Priority is located at address 0x0008H (By default)
Low Priority Interrupt is located at address 0x0018H

So whenever an interrupt occurs you moves to address 0x008H (if using default configuration)
At that address you have to check which occurs..

following is an example code in Hi-Tech C
Code:
void interrupt check_isr()
{

	if(PIR1bits.TMR1IF == 1)
		T1_ISR();
	if(INTCONbits.INTF == 1)
		Phase_ISR();
}

and then define these routine at some other place..

---------- Post added at 20:26 ---------- Previous post was at 20:24 ----------

Now I thought a similar setup will be there in PIC18F. But unfortunately, I couldn't find such vector table etc in data sheet. So in PIC18F also, there is a single ISR in which we need to perform a software check (if else) to know if it is a tmr0 interrupt or an external interrupt or uart interrupt etc ?

There is such vector table for each interrupt in PIC18F and PIC16F..
I am having knowledge of these two ..


Hope this helps you..
 
So we need a software check inside the ISR for the flag to decide which interrupt is actually interrupted the cpu... am I right ?
 
Yes you are right...
at vector table 0x08H..
redirect your controller to some other memory location and check there or you can check at 0x08 and then redirect ur controller to desired ISR.


Hope This Helps
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top