TI Stellaris Launchpad

> Modbus RTU

  Function Subset 

  Implementation

Date : September 08, 2021

Hey, this is Shaunak !

In this blog, I will demonstrate and explain the Modbus RTU Function Subset Implementation in Texas Instruments (TI) Stellaris Launchpad.  It has LM4F120H5QR Arm Cortex M Microcontroller.

Click/Tap Here to get the resources like SDK, IDE for the Development Kit. Kindly download the "StellarisWare and Code Composer Studio for the Stellaris LM4F120 LaunchPad" from the list given in the link.

Click/Tap Here to download the LM Flash Programmer.

The motive to accomplish this project was to test the generic Modbus Function Subset C Library that I have created. I had already tested it on Cypress PSoC5. Click/Tap Here to go through the blog.

Modbus is a data communication protocol widely used in industries. Click/Tap here to know more about it.

For this project, as a reference, I have referred the following document in order to understand its working :


PI_MBUS_300.pdf

The project implements 8 Modbus RTU Functions with a dedicated  C library that can be used in general. The 8 Modbus Functions are as below :

1. 0x01 : Read Coils

2. 0x02 : Read Discrete Inputs

3. 0x03 : Read Holding Registers

4. 0x04 : Read Input Registers

5. 0x05 : Write Single Coil

6. 0x06 : Write Single Register

7. 0x0F : Write Multiple Coils

8. 0x10 : Write Multiple Registers

The working of all the functions has been tested on a Modbus Master Tool called qModbus.

Download qModbus from Here

Code Philosophy

Click/Tap Here to download the entire project.

Here is video explaining how the system works :