| ??? 11/22/01 16:22 Read: times |
#16825 - RE: Multiproc comm..if 10 pins free :) |
Hi Stephan,
Sorry I took so long, but I hadn't visited the forum for a long time I see there's alot of other solutions to your problem up there too, so read on if this one still seems useful: Take one free port on each uC, say P1 on the master and P2 on the slave. And Erik was right..You will also need 2 pins (Transmit and Receive) free on each uC for the handshake. I would suggest you use an interrupt pin (p3.2 or p3.1) as receiver pin, so that data can be collected as soon as it is recieved. Communcation Master uC uC __________ Data lines ________ | | P2.0 |<------------------>|P1.0 P2.1 |<------------------>|P1.1 P2.2 |<------------------>|P1.2 | . | P1 P2 | . |(Data) Data) | . | | . | P2.7 |<------------------>|P1.7 | | | | | | | | | | P3.3 |------------------->|P3.2 (Txmit)| |(Rec | | | | P3.2 |<-------------------|P3.1 (Rec) | |(Txmit) __________| |_______ The working would be: Communication uC: ================= Serial Interrupt- Check if 8 bits have been accumulated, mov P2,Data setb p3.1 wait for acknowledge on P3.2 clear p3.1 reti External Interrupt(p3.2)- mov Data,P2 strobe p3.1 to acknowledge Put Data into buffer for Serial communication Transmit reti Master uC: ========== External Interrupt(p3.2)- mov Data,P1 strobe p3.1 to acknowledge Use data or Set internal flag to use data reti Transmit- mov P1,Data setb p3.1 wait for acknowledge on p3.2 reti The handshaking part needs to be refined, but that is the basic working. I have also mailed you this stuff Kunal |



