[51] How do detect duration of external input state

Status
Not open for further replies.

hithesh123

Full Member level 6
Joined
Nov 21, 2009
Messages
324
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
lax
Visit site
Activity points
3,548
How do I find out how long an input pin has changed logic state.
Let me explain -

In some buses, the host pulls down the clock or data line for a particular duration to request access.
How can I detect this in a MCU like 8051.
The MCU is C8051F120. The two interrupts (INT0 and INT1) have already been used.
 

You could make the interrupt system more intelligent, if you combine a set og flipflops with a register and use one of the INT inputs to a sum of all interrupt flipflops, you need som more intelligence in the ISR to separate the active interrupt and process this part of the ISR.
You normally use the timer/ counter to calculate elapsed time.

The ideal way to this is to change to a more modern microcontroller, with these functions inbuilt.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…