Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Digital Visitor Counter using Pic18f4520

Status
Not open for further replies.
Use two interrupt inputs (most microcontrollers have more than one), or an XOR gate into a single interrupt, or an I2C port expander which has an interrupt pin (e.g. NXP PCA9554).
 

thank u ...i'l do that. I wrote statediagram as u suggested . I want to achieve wat sunnyskyguy suggested. but i dont know how exactly to do that. can u please help me with that. my apologises if i'm troubling u.. but please guide me. thank u..
 

hi everyone,
i'm stuck in programming can u guys help me out. i'm taking the output from the 2 sensors n giving it to microcontroller. i'm taking it for falling edge(external interrupt), when d first interrupt occurs , i want to check whether the second interrupt has occured or not ...how to achieve this??
 

Hi - you need two flags. One for each sensor.

I'll use the simple method of going into a waiting loop after you detect an interrupt in either sensor.

During the waiting loop, see if the other sensor's flag changes to True (detects an interrupt). If it is True, then that counts as an event, and you know the motion of the object.

If there is no further change within the time limit, then reset both flags to False. Resume idle mode, waiting for the next sensor interrupt.

If you are not in a loop, and the other sensor's flag is False, then start a timer. The other sensor may go True within the time limit. If it does then count that as an event (per above).

If you wish, you can use one variable as a status flag, and set individual bits to zero or one.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top