i am putting it in sleep mode and wakeup only when PICU interrupt occures.
when it wakes up i start 1msec timer interrupt and set one flag which I use for changing the state in while(1) loop.
my sleep current is 40usec. and active current is 20mA
I have noticed that when there is any transition of pins other than external interrupt pins PICU, controller wakes up and current is also increases.
for this I wrote a code such as if by accident controller wakes up then start 1msec timer interrupt and again go back to sleep but my interrupt is not working and even if I directly put to sleep mode, it is not going to sleep.
It is a bit difficult to make a guess right into the blue, I'm afraid we need some more information to help you out of this.
Best would be to post the complete project here, use Creator's "Create Workspace Bundle" and upload the resulting archive. DO NOT USE CHROME when uploading, some bug preventst the file from getting into the forum.