This post is for the next guy that tries to do this. A few things I learned:
- you can put a basic MAX232 on the TX and RX lines and "watch" what is being sent around your network.
- 4K7 pull-up resistors are good for master and slave RX pins (supposedly only necessary in case PIC is disconnected).
- a structured approach to communication helps, ie: a PIC address, a command, data and checksum.
- slaves then look at the PIC address and decide if it applies to them, a "calling all slaves" address is also useful.
- a local command can help support various processing.
- data can be as big as you need it.
- and checksum can be as simple as addition of every byte sent, a word variable has more room.
- RS232 is great for Master to multiple Slaves, as long as only 1 slave replies back UNLESS:
There's more than one way to skin a cat, but this was by far the easiest to have more than 1 slave on the MASTER RX line. There may still be an issue with this solution, but I have 6 slaves sharing a master RX line right now and they're all purring nicely.Code:... TXSTA.5 = 1 ' Enable USART TX function HSEROUT (slave sends reply only when spoken to by master) TXSTA.5 = 0 ' Disable USART TX function ...
Thanks to all that helped me work through this (don't even want to count how many days it took to get this working).
Robert
![]()
Bookmarks