I have a device (an energy meter) that sends data via RS-485 (Modbus protocol). And I want to collect it with MCU. The important thing is that I'm trying to design a board and I want it to be scalable. That means I might have 1 device connected, or maybe 2 or 3 devices connected (with different Slave IDs). I have the following questions:
- I think that I need MCU with an UART and then I need to add RS-485 driver (like this one) and I'm fine? I mean Modbus is just a protocol, so on the design stage I shouldn't worry about that?
- Should I consider a MCU with 1 UART or I need more? Is MCU with a signle UART is capable of communicating with multiple devices? I mean one UART will provide only Rx and Tx lines, so it is easy to connect to one device. But how to handle more?
- Do I need to handle all the Modbus stuff manually? It can be done easily with PC, but how I can do it with my MCU? I will need to define function codes, data arrangement and all this stuff from scratch? Or there are available libraries for some MCUs?
Thanks in advance!