cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 chips with native modbus support

Posted on December 30, 2016 at 22:20

Hello there,

Is there any list of STM32 devices with native ModBus support? I am trying to find a proper mcu and I have to open each datasheet by hand and ctrl+F for modbus. There has to be a better way. So far I have figured out that only the newer devices have it (ie. F0 and F7). I need something in between with modbus support.

I would appreciate all help.

#stm32 #modbus
24 REPLIES 24
Seb
ST Employee
Posted on December 31, 2016 at 07:17

How about STM32L476?

http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32l4-series/stm32l4x6/stm32l476jg.html

 

It's a mid range product based on Cortex M4 at 80MHz ~20mA

mjenabzadeh9
Associate III
Posted on December 31, 2016 at 08:05

Hello 

modbus is protocol and is not related to hardware .

Best regards.

Posted on December 31, 2016 at 08:41

Yes those seem to have enough power and native modbus features, thank you. They have some low power features however that I wont use and I will have to pay for (the chip is quite expensive). So do you think there is a list of devices?

Posted on December 31, 2016 at 08:57

http://www.st.com/en/development-tools/st-mcu-finder.html

 
Posted on December 31, 2016 at 09:04

I tried this application in the first place. The parametric search doesnt allow you to search by modbus support parameter.
AvaTar
Lead
Posted on December 31, 2016 at 11:32

Is there any list of STM32 devices with native ModBus support?

Yes, all STM32 devices have - Modbus RTU and ASCII are plain UART protocols, using RS232 (rarely) or RS485 (most common).

The rest is done in software, no really 'hardware tricks' required. Modbus ASCII is especially trivial to implement. RTU and it's timing requires some more brains.

Just get the specs from

http://www.modbus.org,

or pull a free example stack.

BTW, there is a Modbus TCP as well ...

mjenabzadeh9
Associate III
Posted on December 31, 2016 at 11:54

It just generate Timeout nothing else.

Posted on December 31, 2016 at 11:38

Look guys I know modbus RTU can be implemented on anything really, but I am talking specifically about the hardware modbus support that the newer STM32 bit chips provide.

Here is the description from RM0091:

26.5.8 Modbus communication

The USART offers basic support for the implementation of Modbus/RTU and Modbus/ASCII

protocols. Modbus/RTU is a half duplex, block transfer protocol. The control part of the

protocol (address recognition, block integrity control and command interpretation) must be

implemented in software.

The USART offers basic support for the end of the block detection, without software

overhead or other resources.

Modbus/RTU

In this mode, the end of one block is recognized by a “silence� (idle line) for more than 2

character times. This function is implemented through the programmable timeout function.

The timeout function and interrupt must be activated, through the RTOEN bit in the

USARTx_CR2 register and the RTOIE in the USARTx_CR1 register. The value

corresponding to a timeout of 2 character times (for example 22 x bit duration) must be programmed in the RTO register. when the receive line is idle for this duration, after the last

stop bit is received, an interrupt is generated, informing the software that the current block

reception is completed.

Modbus/ASCII

In this mode, the end of a block is recognized by a specific (CR/LF) character sequence.

The USART manages this mechanism using the character match function.

By programming the LF ASCII code in the ADD[7:0] field and by activating the character

match interrupt (CMIE=1), the software is informed when a LF has been received and can

check the CR/LF in the DMA buffer.

Thus I wanted to know either there is any list of devices that consist of this functionality.

mjenabzadeh9
Associate III
Posted on December 31, 2016 at 12:43

These are futures may useful in modbus implementation from stm32f0 user manual 

*Continuous  communication using DMA 

*Receiver timeout interrupt

*Received/transmitted bytes are buffered in reserved SRAM using centralized DMA

*Hardware flow control for modem and RS-485 transceiver