2018-04-19 02:07 AM
Hello,
I am want o read Energy Meter through RS485 port with MODBUS RTU protocol. I am using stm32f427 mcu.
is there any one who can help me with this..
who to write cubemx code to read meter values..
2018-04-19 09:58 AM
So what 'help', exactly, do you need?
Both Modbus and RS485 are very well-established and widely-used technologies - you should have no difficulty finding information & support for them ...
https://en.wikipedia.org/wiki/RS-485
2018-04-19 10:31 PM
I'd deem the modbus.org website the best source.
Get the standard description, and study it. At least it sufficed for me.
Start with the lowest level, and contemplate how you properly implement the inter-package timings.
The rest is a 'piece of cake', then.
who to write cubemx code to read meter values..
You, I guess.
There had been a idle time interrupt for several UART peripherals, which are quite useful for your case.
I bet Cube does not support it.
2018-04-19 10:46 PM
First understand basics of Modbus
http://www.modbustools.com/modbus.html
http://www.simplymodbus.ca/FAQ.htm#Modbus
Get UART working on the MCU
Go through the document of that energy meter and obtain which register at what address you need to read
Then arrange your frame accordingly
SLAVE ADDR | FUNCTION CODE | DATA ADDR | NO OF DATA | CRC
and then wait for the response of the device.
I will suggest first start with polling, get a USB to UART connect to your energy meter send the request manually and if see if the device responds that would be the best way to start.