Related questions, Is their a way to check which boot loader is in a board?
I wrote some code to detect chip signatures a while ago which also reports on known bootloaders: http://www.gammon.com.au/forum/?id=11633
It really is too long to post here. The code however is at https://github.com/nickgammon/arduino_sketches in particular in the Atmega_Board_Detector folder.
It's the same processor chip, you shouldn't have problems uploading, provided you use the appropriate clock speed and baud rate.
See my answers here:
Where do I learn what is appropriate?
Well, the bootloaders have hard-coded into them the speed at which they expect the serial data to arrive. In the case of Optiboot it is 115200 baud, some other bootloaders may use 9600, 57600 or other speeds.
Now this baud rate is also dependent on the clock rate of the processor, because the baud rate is derived from the system clock.
So for example, on a Uno, Optiboot "expects" (in the sense that a computer can expect anything) that it will be running on a board at 16 MHz, and that the communication will be at 115200 baud.
So, if you are running at 8 MHz (half that speed) then the baud rate will naturally be 57600. However you can compensate for that by editing the file boards.txt
in your Arduino installation and changing the baud rate, eg.
uno.name=Arduino Uno
uno.vid.0=0x2341
uno.pid.0=0x0043
uno.vid.1=0x2341
uno.pid.1=0x0001
uno.vid.2=0x2A03
uno.pid.2=0x0043
uno.vid.3=0x2341
uno.pid.3=0x0243
uno.upload.tool=avrdude
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.maximum_data_size=2048
uno.upload.speed=115200
uno.bootloader.tool=avrdude
uno.bootloader.low_fuses=0xFF
uno.bootloader.high_fuses=0xDE
uno.bootloader.extended_fuses=0xFD
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.bootloader.file=optiboot/optiboot_atmega328.hex
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.board=AVR_UNO
uno.build.core=arduino
uno.build.variant=standard
Change the line "uno.upload.speed" to read 57600 in this case. That way the program (avrdude) which uploads to the board will upload slower, and since you are running at a slower speed, all will be well.
So, to make it all work:
Find which bootloader you have (by comparing signatures) or simply upload a new bootloader of a known type. I have a page about uploading bootloaders which might help you there.
Look up (eg. in that file) what the baud rate this particular bootloader uses (eg. 115200 for Optiboot).
Set your processor to run at that clock speed with a crystal or resonator. (see the line "uno.build.f_cpu" which is 16000000 in this case).
If you choose to run the processor at a different speed (eg. using the internal clock, at 8 MHz) then either use a bootloader designed for 8 MHz, or change the upload speed baud rate line in the file as mentioned above. I suggest copy/pasting an existing entry, changing for example "uno" at the start of each line to "myboard" or something like that, and the "name" line as well, so it will appear in the drop-down menu of available boards).