This is my testprogram , i am using here 30F3012 chip on Easydspic2 .
What is missing / wrong as it never interrupt's
Code: Select all
Program Cnint1;
// Input Change Notification Interrupt
Procedure Cn_interrupt; Org $32;
Var Dum : Word;
Begin
latd := 1; // should turn LED on at first interrupt occurring
Dum := PORTb;
//IFS0.15 := 0; // Clear Flag
End;
Procedure Init;
Var Dum : Word;
Begin
TRISB := $ffff; // All Inputs
PORTD := $0;
TRISD := 0;
TRISC := 0;
CNEN1 := %0000000000000100; // Allow Interrrupts On Cn2 Input which is RB0 also
IPC3.14 := 1; //
IPC3.13 := 1; // Give High Priority
IPC3.12 := 1; //
IFS0.15 := 0; // Clear Cn-interrupt Flag
IEC0.15 := 1; // Allow Cn-interrupts
End;
Begin
delay_ms(100);
Init;
While True Do
Begin
Delay_ms(300);
PORTc.15 := PORTc.15 Xor 1; // flashing LED to have some sign of life
End;
End.