Hello Community Members
I am currently working on UART communication with RS-485 physical interface. There are 8 different boards as slave in line. We are using Tiva TM4C123GH6PM MCU.
When I communicate independently with boards, there is no problem at all. But when these boards are on same line , I can't handle buffer. I mean for example, Master request is in certain length, and if SLAVE_ID and FUNCTION_CODE is true for me, I response to master. But when other slaves responses to master, these responses come to my RX_Buffer too and I can't know when I should make rx_index to 0.
Since I can't know when I should make my rx_index to 0, everything goes wrong when one of other slaves response to Master.
As summary when there is only one slave
RX_Buffer[rx_index++] = PLC_Request;
Since PLC_Request is in defined length, I can know that when RX_index is 8 or whatever, Make it 0.
if there is more than slave in line
RX_Buffer[rx_index++] = PLC_Request + Slave_Reponse;
In this case Since I can't know length of slave_response, I can not make RX_index to 0 in correct index.
What should I do in this case ?
Thanks in advance
Serkan