asking
Full Member level 5
- Joined
- Sep 21, 2010
- Messages
- 279
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 1,298
- Activity points
- 3,377
Just use Timer/counter on capture mode... Make sure your 50Hz is a squre wave I/P......
give both of them to a OR gate for both positive triggered or AND gate for both negatively triggered and give it to the INT pin,
If you got INT then check for the INT using port pins......
Yes..Input signal is PWM Square wave... can you throw some more light or any resources how to use capture mode on pic ? actually i am new to it.
Thanks...
Hi you will get the interrupt for both the signals and in ISR check it, wheather It is phase 1 or phase 2 using the port pin inputs
Hi your interrupt is set to positive or negative triggered???
Hello,
My interrupt is set on Negative (Falling edge) detector.
Then you have to use AND gate not OR gate..
PORTB will have four interrupts. See RBIF in datasheet.
Hi you will get the interrupt for both the signals and in ISR check it, wheather It is phase 1 or phase 2 using the port pin inputs
Hi finaly you got positive edge triggered input OR negative edge triggered input??
Use RBIF for port pin 1 and port pin 2. It should also be PORTB pins which support RBIF. Polling will not help.
void interrupt()
{
// RB Port Change Interrupt
if(PIR1.RBIF == 1) // if the RB Port Change Interrupt flag is set...
{
x = PORTB; // Need to read or write to the port to clear mismatch condition
PIR1.RBIF =0;
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?