• sales

    +86-0755-88291180

Modbus RTU PWM Input 8CH User Guide

Hardware Description

Product Parameters

ParameterSpecification
Communication InterfaceRS485
Communication Baud Rate4800, 9600, 19200, 38400, 57600, 115200, 128000, 256000
Default Communication Format9600, N, 8, 1
Modbus ProtocolStandard Modbus RTU Protocol
Supply VoltageDC 7~36 V
Pulse Input Voltage Range3.3 V ~ 30 V
Pulse Frequency Measurement Range400 Hz ~ 50 kHz
Pulse Resolution0.01 Hz
Pulse Accuracy5‰
Duty Cycle Measurement Range0 ~ 100 %
Duty Cycle Resolution0.01 %
Duty Cycle Accuracy5 ‰

Indicator Light Description

Indicator LightStatus Description
STATUS LEDMCU indicator, flashes when the MCU is operating normally
TXD LEDTransmission indicator, lights up when data is being sent
RXD LEDReception indicator, lights up when data is being received

Hardware Description

CHN+ is the positive input, CHN- is the negative input. The PWM measurement frequency range is 400 Hz ~ 50 kHz, and the duty cycle range is 0 ~ 100%.


Hardware Connection Description

Connect the USB TO 485 converter to the target board using jumper wires, connecting A-->A and B-->B as shown in the figure below:



Software Test

SSCOM Serial Debug Assistant

Basic Query Commands

  • Download the SSCOM Serial Debug Assistant and open it on your computer. Open the corresponding port number, set the baud rate to 9600, select SendHex and Receive, and choose ModbusCRC16 check for the checksum.

    Send the following command; under normal conditions, it will return the 8-channel pulse input data.

    01 04 00 00 00 18

Other Commands

  • If you need to send other commands, select SendHEX, choose ModbusCRC16 check for the checksum, enter the first six bytes of the command, and click SEND, it will automatically add the CRC check code. For example, send the following command to query channel 2 pulse input data.

    01 04 00 03 00 03

For more detailed control commands, please refer to the development protocol.

Modbus Poll Software

  • The serial software is not convenient for data observation. You can use the Modbus Poll Software to read data. Download and install the Modbus Poll software.

  • Open the software, select Setup -> Read/Write Definition. Select the actual device address for Slave ID, 04 Read Input Registers (3x) for Function, and 24 for Quantity. Click OK to confirm.


  • Select Connection -> Connect..., choose the corresponding serial port, set baud rate to 9600, 8 data bits, no parity, 1 stop bit. Click OK to connect.


  • After a successful connection, the register data will be displayed. For ease of observation, you need to set the frequency format. Select registers 1, 3, 6, 9, 12, 15, 18, 21, right-click and choose Format -> 32 Bit Unsigned -> Big-endian to set the format to unsigned 32-bit big-endian. You can also add register notes in the Alias column.


  • After setting the correct format, the 8-channel pulse frequency and duty cycle are displayed normally as shown below.


Development Protocol

Function Code Introduction

Function CodeDescription
03Read Holding Registers
04Read Input Registers
06Write Single Holding Register
10Write Multiple Holding Registers

Register Address Description

Address (HEX)Register ContentRegister ValueAccessModbus Function Code
3x0000
3x0001
Channel 1 Frequency High 16 bits
Channel 1 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x0002Channel 1 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
3x0003
3x0004
Channel 2 Frequency High 16 bits
Channel 2 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x0005Channel 2 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
3x0006
3x0007
Channel 3 Frequency High 16 bits
Channel 3 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x0008Channel 3 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
3x0009
3x000A
Channel 4 Frequency High 16 bits
Channel 4 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x000BChannel 4 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
3x000C
3x000D
Channel 5 Frequency High 16 bits
Channel 5 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x000EChannel 5 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
3x000F
3x0010
Channel 6 Frequency High 16 bits
Channel 6 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x0011Channel 6 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
3x0012
3x0013
Channel 7 Frequency High 16 bits
Channel 7 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x0014Channel 7 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
3x0015
3x0016
Channel 8 Frequency High 16 bits
Channel 8 Frequency Low 16 bits
Unsigned 32-bit value, unit 0.01 Hz, range: 40000 ~ 5000000, i.e., 400 Hz ~ 50 kHzRead0x04
3x0017Channel 8 Duty CycleValue is unsigned 16-bit hexadecimal, unit 0.01%, range 0~10000, i.e., 0~100%Read0x04
4x2000Serial Port ParametersHigh byte: parity mode: 0x00~0x02
Low byte: baud rate mode: 0x00~0x07
Read/Write0x03, 0x06
4x4000Device AddressStores Modbus address directly
Device address: 0x0001~0x00FF
Read/Write0x03, 0x06
4x8000Software VersionConvert to decimal, then shift decimal point two places left for version
0x0064 = 100 = V1.00
Read0x03

Command Operation Introduction

Read Pulse Input Command

Transmission Code: 01 04 00 00 00 03 B0 0B

FieldDescriptionNote
01Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0404 CommandRead Input Registers
00 00Register Start AddressStarting register for channel read. Each channel occupies three registers: first two store frequency, last stores duty cycle
00 03Number of RegistersNumber of registers to read, cannot exceed maximum register count
B0 0BCRC16CRC16 checksum of the first 6 bytes of data

Return Code: 01 04 06 00 3B 83 A5 03 01 7D C1

FieldDescriptionNote
01Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0404 CommandRead Input Registers
06Byte CountData length
3B 83
A5 03
03 01
Register Data
Frequency High 16-bit
Frequency Low 16-bit
Duty Cycle
Each channel occupies three registers: first two store frequency, last stores duty cycle
Frequency is unsigned 32-bit hexadecimal, unit 0.01 Hz, range: 40000~5000000 (400 Hz ~ 50 kHz)
Duty cycle: unsigned 16-bit, unit 0.01%, range 0~10000 (0~100%)
7D C1CRC16CRC16 checksum of the first 6 bytes of data

Example: Device with address 1

Read channels 1-8 : 01 04 00 00 00 18 F0 00
Read channel 2 : 01 04 00 03 00 03 40 0B
Read channels 3-5 : 01 04 00 06 00 09 D0 0D
Read channel 1 : 01 04 00 00 00 03 B0 0B
Return: 01 04 06 00 00 9C 40 13 88 42 41 //Channel 1, 400 Hz, 50% duty cycle

Set Baud Rate Command

Transmission Code: 00 06 20 00 00 05 43 D8

FieldDescriptionNotes
00Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0606 CommandSet baud rate, set device address
20 00Command Register0x2000 for setting baud rate, 0x4000 for setting device address
00Parity Mode0x00 for no parity, 0x01 for odd parity, 0x02 for even parity
05Baud Rate ValueBaud rate value mapping:
0x00: 4800
0x01: 9600
0x02: 19200
0x03: 38400
0x04: 57600
0x05: 115200
0x06: 128000
0x07: 256000
43 D8CRC16CRC16 checksum of the first 6 bytes of data

Return Code: 00 06 20 00 00 05 43 D8

FieldDescriptionNotes
00Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0606 CommandSet baud rate, set device address
20 00Command Register0x2000 for setting baud rate, 0x4000 for setting device address
00Parity Mode0x00 for no parity, 0x01 for odd parity, 0x02 for even parity
05Baud RateBaud rate value mapping:
0x00: 4800
0x01: 9600
0x02: 19200
0x03: 38400
0x04: 57600
0x05: 115200
0x06: 128000
0x07: 256000
43 D8CRC16CRC16 checksum of the first 6 bytes of data

Example: Device with address 1

Set baud rate 4800 : 00 06 20 00 00 00 83 DB
Set baud rate 9600 : 00 06 20 00 00 01 42 1B
Set baud rate 115200 : 00 06 20 00 00 05 43 D8

Set Device Address Command

Transmission Code: 00 06 40 00 00 01 5C 1B

FieldDescriptionNotes
00Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0606 CommandSet baud rate, set device address
40 00Command Register0x2000 for setting baud rate, 0x4000 for setting device address
00 01Device AddressDevice address set, 0x0001-0x00FF
5C 1BCRC16CRC16 checksum of the first 6 bytes of data

Return Code: 00 06 40 00 00 01 5C 1B

FieldDescriptionNotes
00Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0606 CommandSet baud rate, set device address
40 00Command Register0x2000 for setting baud rate, 0x4000 for setting device address
00 01Device AddressDevice address set, 0x0001-0x00FF
5C 1BCRC16CRC16 checksum of the first 6 bytes of data

Example: Device with address 1

Set device address to 0x01 : 00 06 40 00 00 01 5C 1B
Set device address to 0x02 : 00 06 40 00 00 02 1C 1A
Set device address to 0x03 : 00 06 40 00 00 03 DD DA

Read Device Address Command

Transmission code: 00 03 40 00 00 01 90 1B

FieldDescriptionNotes
00Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0303 CommandRead device address command
40 00Command Register0x4000 for reading device address, 0x8000 for reading software version
00 01Byte CountFixed 0x0001
90 1BCRC16CRC16 checksum of the first 6 bytes of data

Return code: 01 03 02 00 01 79 84

FieldDescriptionNotes
01Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0303 CommandRead software version, read device address command
02Byte CountReturned byte count
00 01Device AddressDevice address set, 0x0001-0x00FF
79 84CRC16CRC16 checksum of the first 6 bytes of data

Example: Device with address 2

Transmission Code: 00 03 40 00 00 01 90 1B
Return code : 02 03 02 00 02 7D 85 //Address 0x02

Read Software Version Command

Transmission Code: 00 03 80 00 00 01 AC 1B

FieldDescriptionNotes
00Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0303 CommandRead software version, read device address command
80 00Command Register0x4000 for reading device address, 0x8000 for reading software version
00 01Byte CountFixed 0x0001
AC 1BCRC16CRC16 checksum of the first 6 bytes of data

Return Code: 01 03 02 00 64 B9 AF

FieldDescriptionNotes
01Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
0303 CommandRead software version, read device address command
02Byte CountReturned byte count
00 64Software VersionConvert to decimal, then shift decimal point two places left for version
0x0064 = 100 = V1.00
B9 AFCRC16CRC16 checksum of the first 6 bytes of data

Example: Device with address 1

Transmission Code: 00 03 80 00 00 01 AC 1B
Return Code: 01 03 02 00 64 B9 AF //0x0064 = 100 =V1.00

Exception Function Codes

If the received command is incorrect or an exception occurs, the device will return an exception response. The exception response format is as follows:

Return Code: 01 85 03 02 91

FieldDescriptionNotes
01Device Address0x00 indicates broadcast address; 0x01-0xFF indicate device address
85Exception Function CodeException function code = Request function code + 0x80
03Byte CountException code
02 91CRC16CRC16 checksum of the first 6 bytes of data

The exception code is a single-byte value indicating the type of error. Several common exception codes defined by the Modbus protocol:

Exception CodeNameDescription
0x01Illegal FunctionThe requested function code is not supported
0x02Illegal Data AddressThe requested data address is incorrect
0x03Illegal Data ValueThe requested data value or operation cannot be performed
0x04Server FailureServer device failure
0x05AcknowledgeRequest received and processing
0x06Device BusyDevice is busy and cannot execute the requested operation


Resources

1. Technical Manuals

2. Software Development Resources


Support

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)

Email: services01@spotpear.com

TAG: Raspberry Pi 11.6 inch LCD HDMI /Type C Display In-Cell Capacitive TouchScreen 1768x828 For Jetson Nano/mini Computer PC Raspberry Pi PICO Keyboard RDK X5 PoE Module For Power Over Ethernet/ IEEE 802.3af/at PoE For D-Robotics RDK X5 UART To CAN Mini FT232RNL USB TO TTL Industrial UART Can For Raspberry Pi 5 Terminal Debug Raspberry Pi 64MP Camera Pi5 Pure-Copper Active Cooler Circular LCD Screen Raspberry Pi 15.6 inch QLED Quantum Dot Display 1920x1080 Capacitive Touchscreen For Computer PC/Jetson/Game $167.99 Industrial Modbus RTU RS485 8-ch 30A High Current Relay Module (E) With Digital Input X1006 Raspberry Pi 5 PCIe To 2.5 SATA And M.2 KEY-B 2280 SSD/HDD Double-SATA (NOT BOOT From SATA/SSD Raspberry Pi 10.1 inch DSI MIPI LCD TouchScreen Display 10.1inch 720x1280 For Luckfox Lyra RK3506/ESP32-P4/Luckfox Omni3576 Sipeed RISCV LicheeRV Nano Super-Mini SG2002 AI RAM-256MB Tang Nano FPGA Demo Code ESP32-S3 Development Board 1.47 inch LCD Screen Display 172x320 SD-Port LVGL USB Serial UART Bus Servo ST3025 TTL 40KG.CM Magnetic Encoder 360° High Precision And Large Torque ESP32 S3 Development Board 1.46 inch Round LCD 1.46inch Display 412x412 QMI8658 Sensor / MIC / SD /MP3 Audio /Battery Port LVGL/HMI For Arduino ESP32 2 inch Capacitive TouchScreen LCD Display ST7789 CST816D 240x320 For Arduino/Raspberry Pi/Pico ESP32 S3 Development Board 2.1 inch Round Rotary Knob LCD Smart Screen 2.1inch Display 480x480 LVGL for Arduino SpotPear