The first one have a atmega1281-16au microcontroller on a board, and the bootloader has been burned in atmega1281 when I buy it from a factory, I can program this board using the USB cable.
The second board is the same with the first, but with a empty new atmega1281-16au microcontroller on it.
I want to program the second board using the USB cable too, but I don't have the bootloader(I need the bootloader the same with the first board), I want to copy the bootloader from the first board to the second board, How do I implement it?
I downloaded a ISP programming software, and I read the flash and eeprom from the first board using this software, it seems to read successfully.
then I write the binary file has been read into the second board's flash and eeprom, it seems to write successfully too.
But I failed, the second board didn't work properly, I don't know why, can someone help me? how can I achieve my goal.
'2561 is similar to '2560 for bootloading; 64 pin package vs 100 so fewer ports are available to the user.
On the 2nd board, did you set the fuses?
If not, system clock will default to 8 MHz internal oscillator with divide-by-8 prescaler, resulting in 1 MHz operation, 1/16 of what everything else may be expecting in Arduino-land for comparison.
There are 3 fuse bytes - High Fuse, Low Fuse, Extended Fuse.
These need to be programmed by the ISP. Read the data sheet, then look the Mega section of boards.txt to see how the Mega sets them.
29.2 Fuse Bits
The ATmega640/1280/1281/2560/2561 has three Fuse bytes. Table 29-3 through Table 29-5 on
page 337 describe briefly the functionality of all the fuses and how they are mapped into the
Fuse bytes. Note that the fuses are read as logical zero, “0”, if they are programmed.
Then I write the Fuse&Lock into the second empty new board, and write successfully.
I also read the Flash and Eprom from the first board, and read successfully.
This is tip of read bytes. Flash: 129202/131072, Eprom:4096/4096.
Then I write the Flash and Eprom into the second empty new board, and write successfully.
I think the bootloader and sketch has been write in successfully, because when I turn on the switch, the new board's led lights flashing as same as the first board, this is due to the control of the bootloader.
But the second board still can't programming via USB, and not output anything to serial monitor, and can't work normally, where am I still wrong?
I want to program the second board using the USB cable too, but I don't have the bootloader(I need the bootloader the same with the first board), I want to copy th