Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 28th November 2007, 02:30 PM   (permalink)
Default Help with PIC-PIC communication

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!
RIP_Polaris is offline  
Old 28th November 2007, 03:19 PM   (permalink)
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 29th November 2007, 07:09 AM   (permalink)
Default

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?
RIP_Polaris is offline  
Old 29th November 2007, 07:14 AM   (permalink)
Default

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
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 29th November 2007, 08:48 AM   (permalink)
Default

Quote:
Originally Posted by RIP_Polaris
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?
The method I mentioned can be used as serial, you just use the simple handshaking to check it's connected first.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 29th November 2007, 04:57 PM   (permalink)
Default

Quote:
Originally Posted by RIP_Polaris
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?

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
Leftyretro is offline  
Old 6th December 2007, 01:21 PM   (permalink)
Default

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.
RIP_Polaris is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
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



All times are GMT. The time now is 12:51 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker