Hi,
As far as I understood you want to have a network of PICs on a common drop down serial bus and address them on specific requests . So your protocol may be a simple two byte thing, the first byte mentioning which PIC and the second what to do actually. Well if you are putting a DIP switch on a portb and using your entire portb as inputs then you can compare it with incoming address. In all PICs the ports are memory mapped registers so you can do a read directly.
So as you did, It should work, like:
IF incoming_address = portb then
or you can have your own byte variable
myvariable = portb
Then compare or process your variable.
Bookmarks