I am trying to make some counter based on the input (logic 1, 5v) signal. when the Proximity will sense the object pass by it will give output 1 (logic 5v) for the time it detects object. Then it will be 0 again. So i am trying to write one simple program to increment counter, but i am facing some issues.
1) Counter should not increment continuously @ MIPS rate. (i really don't how to use Software interrupt.) (it should count 1 by 1)
2) i have made little program for just testing but i am unable to use software interrupt. is this correct way to keep my code in Main {} or i should use it in While(1) loop for continous monitoring ?
3) can i use Void Interrupt () { ISR } for this ? or it should be only use with hardware interrupt like RB0/INT, TMR0IF etc..