I'm doing a project that serial communication between PIC. I use a PIC 16f877a as master device and another PIC 16f877a as slave device. Also, I'm using MODBUS protocol in the communication. So, in the slave program code, for example, master want to read coil from slave then the slave need to response the status to the master.
My question is, in slave device, how to assign the coils of the ports to read whether it is ON/OFF(1/0)? If master only want to read PORTA & PORTB from the slave device.
My question is, in slave device, how to assign the coils of the ports to read whether it is ON/OFF(1/0)? If master only want to read PORTA & PORTB from the slave device.