About interrupt.

General discussion on mikroPascal PRO for PIC32.
Post Reply
Author
Message
alcidesramos
Posts: 272
Joined: 17 Feb 2009 02:39
Location: Colombia
Contact:

About interrupt.

#1 Post by alcidesramos » 13 Apr 2011 04:38

Hello in timer1 example show.

Code: Select all

procedure Timer1Int(); iv IVT_TIMER_1; ilevel 7; ics ICS_SRS;
begin
  T1IF_bit := 0;             // Clear T1IF
  LATB := not PORTB;         // Invert PORTB
end;

and the mail program put the new the priority 7:
T1IP0_bit := 1;            // set interrupt
  T1IP1_bit := 1;            // priority
  T1IP2_bit := 1;     


it is necesary define in the procedure and the mail program.


i can put only in tha main program?


thank you.


Kind regard.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: About interrupt.

#2 Post by filip » 03 Jun 2011 12:57

Hi,

Yes, you can put the interrupt routine in some other unit, just tested it.

Regards,
Filip.

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

Re: About interrupt.

#3 Post by jpc » 11 Jun 2011 09:00

Filip,

i think you did not understand the question ( maybe i do not either) but the way i read this is : why is it necessary to set the priority-level of an ISR in the initialisation as this is already part of the ISR declaration as produced by the interript assistant.
The way i see this is that this Ilevel is only there to inform the compiler at what interrupt priority this ISR will be operating in order to allow correct handling, the actual priority has to be set by the code and it is the programmers responsability to guarantee that the 2 correspond, correct me if i am wrong please.
Au royaume des aveugles, les borgnes sont rois.

Post Reply

Return to “mikroPascal PRO for PIC32 General”