Skip to main content
Hhope.1
Associate
October 9, 2021
Solved

I am using STM32F070F6P6 Help me about modbus/SPI

i want to build continuous potentiometer with dma which is sensing wind direction .

I have to use modbus because send data on an another STM32F070F6P6 microcontroller, but in the reference manual pdf(page 22) it says we can't work modbus communication with usart, is this true? Can anyone help me about modbus and spi ?

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
October 10, 2021

The automatic direction control ("Drive Enable") is present, so the only modbus-specific feature missing is idle detection (for RTU) and CR detection (for ASCII).

I would use interrupt-driven implemetation, and there the idle can be detected by (re-)starting a timer whenever a character is received and having a timer interrupt after the required IDLE time; CR detection in the receiver interrupt is trivial.

JW

3 replies

waclawek.jan
Super User
October 9, 2021

That's Datasheet. Reference Manual is https://www.st.com/resource/en/reference_manual/rm0360-stm32f030x4x6x8xc-and-stm32f070x6xb-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

> it says we can't work modbus communication with usart

No, it says that the USART does not have the features which make Modbus implementation easier (automatic direction control, IDLE detection). It does not mean that Modbus is impossible to be implemented, just it's inconvenient and you would need to have a deeper understanding of the controls.

JW

Hhope.1
Hhope.1Author
Associate
October 9, 2021
  1. thank you for answering can you give more advice in that topic and link for help that

waclawek.jan
waclawek.janBest answer
Super User
October 10, 2021

The automatic direction control ("Drive Enable") is present, so the only modbus-specific feature missing is idle detection (for RTU) and CR detection (for ASCII).

I would use interrupt-driven implemetation, and there the idle can be detected by (re-)starting a timer whenever a character is received and having a timer interrupt after the required IDLE time; CR detection in the receiver interrupt is trivial.

JW