cancel
Showing results for 
Search instead for 
Did you mean: 

I am using STM32F070F6P6 Help me about modbus/SPI

Hhope.1
Associate

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

3 REPLIES 3

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

  1. thank you for answering can you give more advice in that topic and link for help that

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