I have try the Mat Janssen suggestion, but think is a little bit complicated.
Have anyone some other idea?
Thanks.
I have try the Mat Janssen suggestion, but think is a little bit complicated.
Have anyone some other idea?
Thanks.
Try SERIN2/SEROUT2. Use two pins on each PIC. One pin to SEROUT2 and one to SERIN2. I suggest SERIN2/SEROUT2 because of the time out option.
When PIC #1 is ready for data it will send a signal to PIC #2 from PIN_X.
PIC #2 receives the signal for data on PIN_X.
PIC#2 will then send data one PIN_Y.
PIC#1 receives data on PIN_Y.
Dave
Always wear safety glasses while programming.
Hi Edysan,
It's not hard to do. What Matt and Dave are telling you is the way to go. I have a display board that is connected to 20 other boards in a card cage. ONE wire is the Serial I/O line. Another wire is the busy line. ALL boards including the display board are programmed as inputs. There is one pull up resistor for this line. The BUSY line is the key to the whole process. If a board wants to send a "byte" sized message to the display board, he first checks the status of the busy line. If it is low then the board stays in a loop checking for the low to go back to high. Once the busy line is free, he makes the busy line low and sends his signal and clears the busy line when finished. Just remember, you make each board an input. The SEROUT2 command makes the pin an output. When done "talking" you make the pin an input again. (TRISB.7 = 1 for example makes B7 an input)
I hope this makes sense. The display board simply stays in a loop looking for the busy line to go low. Once it does it gets the "message", it then makes the busy line low until it's done sending a time stamped message to a printer. Once that's done, then it releases the busy line waiting for the next message.
A gentleman by the name of Steve Collins has a program called "SixPICs" available on the melabs website. MisterE also has posted a similar type of program here on this forum. Steve's (MisterE) program uses a code to address each board. The slaves just sit and wait for their code to be sent out, then they respond. These systems can be made to "talk" to each board in a polling type fashion. The Master sends out the code for a specific board. When that board hears its name, it answers, and waits for the message. When done the Master calls for then next board. It will take you a while to get this going. Start with one to one communications then add another board. It was very frustrating for me but Steve Collins called me and explained how to do it and I was off and running after that.
The two examples I've mentioned should help get you going.
HTH,
BobK
PS Make sure there is a 1K resistor in series with each Serial I/O pin to prevent accidents.
Last edited by BobK; - 23rd August 2007 at 03:54.
Sorry for the double posting.
Thanks.
Is exactly what I need.
Bookmarks