hi all i want to detect proxy output any pin of 8051 but i want to detect on rising edge only. i know with external interrupts its possible only falling edge
no i don't need interrupts. as you said it is rising edge but how to detect in c i know "0" to "1" also consider as state change for that pin i need to take action only while perticular pin goes from"0" to towards "1" not when its become after complete "1".
What i understand that u want to take action in time between a particulate pin start changing its state from "0" to "1".
If yes then i think that is not possible using a digital input. You can use an analog input for this purpose. When ADC goes from low value to high value you can take action.
hi all i want to detect proxy output any pin of 8051 but i want to detect on rising edge only. i know with external interrupts its possible only falling edge
#include<reg51.h>
sbit in=P2^0;//input for rising edge
sbit led=P2^1;//led toggle on rising edge
bit flag;//for lavel chang on input pin void main(){
led=0;
in=1;//for inputwhile(1){if(!in)
flag=1;//flage set on input pin is lowif(flag&&in)//for pin state change low to high{
led^=1;
flag=0;//flag reset while pin is high}}}