Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to say which board was the first to detect a transition

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
PIC micro 16F family.

There are four boards, each one detecting the high to low transition in the eight pins of PORTB from the micro in charge, with weak pull ups enabled..

Depending of which board detects a change first, the rest should react differently to further changes in their "own" pins.

My question is: How could I make any of the boards to tell the others "I got a change in one of my pins", so the rest knows that they are not the first anymore in detecting a change?

I started to consider something like a common point for all boards, linking their open drain RA4 pins. What I can not see is how could I use that pin also for polling any signal "mine was first" from the other boards.

Or should I use a second pin in every micro for the polling?.

My last point is: would all this change if I do it with three instead of four boards? A resistor, common to all of them or "distributed" should change value accordingly, I think.
 
If you have the pins to spare use 1 (I saw it first) ISIF line for each PIC.
These lines are common for all PICS.
Best if all are on the same port.
Make the ISIF lines active low. Because only 1 PIC is allowed to drive each line they do not need to be open collector.

When a PIC sees the signal it checks the other 3 ISIF lines.

If they are all inactive it lowers its ISIF.
Then it checks to see if any other PICs ISIF are also low, if so there is a tie, then what?

If any ISIF line is active/low it does whatever it should do if it is not first.

EDIT: Cleared up muddy text.
 
Last edited:
A master PIC with X number of slaves will work best in this case. Your problem is going to be one of latency. It is going to take time for any one PIC to detect a input change and then signal the others. Then it's going to take time for the others to recognize the signal. What happens when one of the "other" PICs receives an input change during this time window? By using a master PIC and slaves with identical code (Thus equal time latency) this problem becomes a whole lot simpler with only one PIC deciding who is on first. ;)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top