Programming via RS485 from Master Device to Slave Device

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

         In My project i have one Master controller (Atmega2560) and 5 slave devices (Atmega8). Communication protocol used is RS485. Is there any possibility to download firmware to slave devices from Master controller via RS485 inter face?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Absolutely. Why not. There is no software "protocol" for RS232 or RS422/485. There is only a hardware specification. RS422/485 goes through a UART at each end, and there is no way for the device to know that it is NOT RS232. What you WILL need is a boot loader in the M8s.

 

A bigger question is how you are going to get the firmware update into the M2560. Are you going to store it in RAM from some external source, then send it to the slave. Or, is the M2560 simply going to forward the update, character by character (as a relay device)?

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am going to use M2560 as forwarding the firmware byte by byte to slaves. I have boot loader for M2560 and i have programmed via UART.

I have following doubts.

 

1. How can i identify the slaves?i.e in which slave i am going to update the firmware in those 5 slaves. ( Is there any id based procedure?)

2. Do you have any document related to that for reference?

3.or both Do i need to modify the boot loader program f M2560 and M8 for this procedure?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to build some form of addressing into your protocol. I used modbus rtu on a project many years ago and mapped the flash into the modbus register space. The project used modbus as the protocol so i made sense to use it for the bootloader. The network gateways only spoke modbus as well.