![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hi, I want to connect 2 (or more, but I'll start with 2) PICs using only one I/O pin on each PIC. They need to detect if they are connected to the other PIC or not. The PICs I'm using are from the 16F87X[A] family, since I have some limited experience with them. I don't know how to get them to detect each other (and detect if they got disconnected) while using a shared input/output pin. Can anyone point me in the right direction? Thanks! | |
| |
| | (permalink) |
| Have a pullup resistor pulling the two input pins high, then one PIC can pull the pin low, and the other detects this happening - the second PIC then does the same to acknowledge it's own presence. | |
| |
| | (permalink) |
| Yes, but in the future I may want to have slightly more complex communication.. Are there any protocols that are easy to implement using this PIC? What about serial? | |
| |
| | (permalink) |
| One of the best 1wire communications methods is called 1wire. Developed by Dallas Semiconductor and well documented with PIC source examples. http://www.maxim-ic.com/auto_info.cfm | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) | |
| Quote:
There are several way to have PIC's talk to each other. Selecting the best method depends on how much and type of information needs to be passed, how fast it needs to be sent, if it's two way information sharing or not, how many free pins you have avalible, etc. So your application should determine the best comm method used not visa versa. I like I2C as many devices use that and the latest Picaxe chips I'm using even has functions for the PIC to be either a slave I2C device or a master device. Lefty ]
__________________ Measurement changes behavior | ||
| |
| | (permalink) |
| Thank you all for your help. I've decided to go along with a very simple protocol. This includes dumping the send when sensing crosstalk, waiting a random amount of time, and then re-sending. I thought of doing this with an interrupt - can someone please explain how this can be implemented? (i.e. I need to set off the interrupt only for the pin rising during input, not output, and it should sense this in the delay between transmissions). EDIT: just remembered the RB4-7 pins. From what I understand, they only set off the interrupt when they are in input mode.. Does this mean that they have to always be on input, or will the interrupt still function if I switch between output and input? Last edited by RIP_Polaris; 6th December 2007 at 02:17 PM. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Quik PIC Programming kit | Krumlink | General Electronics Chat | 5 | 28th January 2008 12:27 AM |
| Problems switchin relay with PIC | Andy1845c | General Electronics Chat | 5 | 17th November 2007 07:14 PM |
| High ADC sampling rate PIC, 18F needed? | bananasiong | Micro Controllers | 24 | 28th October 2007 01:13 PM |
| Four PIC with One LCD.. | meera83 | Micro Controllers | 13 | 20th September 2007 07:40 AM |
| serial communication from PIC to PC | flemmard | Electronic Projects Design/Ideas/Reviews | 10 | 11th September 2007 12:07 PM |