I am trying to migration a program from PIC18F26K22 to PIC24FJ256GA702.
On the PIC18, everything works fine. In PIC24 I can't drive any interrupt.
There are only two interrupts - from UART and from TIMER1.
The interrupt flag is raised normally, ie. if I check in the Main Loop whether
Code: Select all
If IFS0.3 = 1 then
begin
IFS0.3 := 0;
Refresh;
end;
If I use an interrupt procedure
Code: Select all
procedure Timer1Int; iv IVT_ADDR_T1INTERRUPT; ics ICS_AUTO;
begin
IFS0.T1IF := 0;
Refresh;
end;
The compiler is MikroPascal PRO for dsPIC v.7.1.0.
Just to note that this is my first time writing about the PIC24 and I'm obviously missing something.
I enable interrupt from Timer1, enable global interrupts (which I don't think is needed by default), set interrupt priority
Code: Select all
IEC0.T1IE := 1; { Timer 1 Interrupt Enable }
IFS0.T1IF := 0;
IPC0.T1IP0 := 0; { Timer 1 Interupt Priority = 4 }
IPC0.T1IP1 := 0;
IPC0.T1IP2 := 1;
INTCON2.GIE := 1;