This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28377S: Code Composer Forum

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

I am working on building a code for MODBUS slave(I am using Launchpad TMS320F28377S to run slave code). I am done with receiving request from the master(for now I'll be having PC as the Master and only one Slave is there). I have successfully processed the request by making the Modbus Poll Master simulator send the request as broadcast message since the Master will not be expecting a response(I am broadcasting the message since I have not coded for the response part for the slave).

Now,  my doubt is, should we send an idle time of t_3.5 before and after sending the response. If yes, how should we do that. Is it like, before sending the response, we should start running a timer for t_3.5 time? Or we should make some Pin High and then run t_3.5 timer and when it expires, we should start sending the response? Since I am using a Launchpad and connecting it to PC using USB, how can I do that? I am beginner in these things, so I don't know the basic underlying technicalities of these. Someone please explain.

  • Sheshil,
    Not getting into the MODBUS specifics yet, but assuming your scenario of 3.5(s?) before and after seeing the request. You could either use a CPU Timer to initiate a ISR, and then in the ISR call the comms port and send the date. Another method would be to use the PWM as a timer, and PWM ISR to activate the comms port.

    On the F28377S LP GPIO84/85 are routed back to the FTDI chip as SCIATX/RX. The FTDI chip is programmed to allow this back on the USB bus and you should see it enumerate as a COM port in Windows. You'll configure those pins for their SCIA function and use the same USB connection as the emulator.

    Best,
    Matthew
  • Hi Matthew

    Thank you for the response.

    According to MODBUS specification, the Master, after sending a request, will be waiting for the response from the slave for a period of time. I have processed the request successfully at the slave end. Now I want to send the response from slave. Before sending the frame we should send an idle time of 3.5 character times and after the frame also we should send the same idle time. If we run a timer before sending the response, how will the master know that. Is there any mechanism available like pulling the communication line low for that much amount of time? But since we are not using RS-232 or such hardware, will it be possible to pull the communication line low for 3.5 char times. We can access only TX and RX pins right? I am using Modbus Poll Master Simulator in my PC which follows MODBUS spec. So whatever we do at the slave end should match the method used at the Master end also right. How the master will know that this idle time has started? Or is it not required 

  • Sheshil,

    Thanks for the clarification, I'm working on looping in someone more familiar with MODBUS protocol.

    Matt

  • Sheshil,

    After looking around, I think the below E2E thread will give a good starting point.  Since this isn't a native comm protocol on the MCU itself, level we will need to see if there are others on the E2E who have suggestions if needed outside of the link below.  I can assist with any physical level hurdles, if and when it comes to that.

    https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/380010/1406565

    Matt