PDA

View Full Version : Serial Sharing



rocket_troy
- 2nd July 2020, 05:16
I have a system with 2 PIC processors and 1 RF module with a serial interface. Question is: can I connect both PICs to the input of the RF module to broadcast from both (not at the same time obviously) using a software command like Serout2?
When dedicating a pin to be serial output, can you initialise the pin to be an input and let the Serout2 command to automatically switch the pin to an output when called? I ask that because the manual says "DataPin is automatically made an output"? Does that mean the pin is automatically reverted back to whatever I/O state it was set to after the packet it sent?

richard
- 2nd July 2020, 05:22
I ask that because the manual says "DataPin is automatically made an output


a bit further down in the mode description is says


Bit 15 selects whether the data pin is always driven (bit 15 = 0), or is open in one of the states (bit 15 = 1). The open mode can be used to chain several devices together on the same serial bus.

rocket_troy
- 2nd July 2020, 05:24
Legend! Thanks again Richard!

rocket_troy
- 2nd July 2020, 05:40
1 more quicky: so, if you chain 2 or more utilising the "open" state - I'm assuming that the open state is keeping them in high impedance mode when not transmitting - do you need a weak pullup or whatever on the line?

Ioannis
- 5th July 2020, 22:50
Depends on the driver. But does no harm to have a high-ish value, say of 10K just to fix a space condition on the serial bus.

Ioannis

rocket_troy
- 9th July 2020, 13:26
Thanks Ioannis.