Hi everyone. I got a Mega 2560 from Aliexpress for about 15€, and although it is printed as if it was an original Arduino, with the logo, the arduino website and all, I'm pretty sure it's a knock off (I guess it wouldn't have costed me that little if it was original).
In any case, I've read that those might have older firmwares that prevent them from going into DFU mode, which is what's happening to me.
I'm using IDE 1.8.19. Can anybody confirm if this instructables site is still valid? I don't want to brick it.
I actually think this is not going to help me, as it's an instructable for something else. It already assumes that you can put your board in DFU mode.
I read this thread, I think this is what I need to go for first.
Clone Megas often use the CH340 TTL-to-USB converter; you can not put that in DFU mode. Does your Mega have two 6-pin headers? One in the center and one closer to the USB connector? See the image in the instructable.
If you want to use your Mega as a HID, you're usually better off using something like a Leonardo. If you need more pins, add shift registers / port expanders for digital pins and multiplexers for analogue pins. Only limitation will be the amount of memory (and there are more modern boards that can solve that).
Yes, it does. I made sure of that when I purchased it. If it's a clone, it is to the point that they even printed the Arduino logo and everything on it. I've checked and it does not have a CH340 chip, but a ATMEL MEGA16U2.
I'm very familiar with other projects using leonardos or pro micros, but for this project I need a large number of inputs, and I've not been successful with PCF8575s, partially successful with a nano acting as a port expander via I/C (an option I have not yet disregarded), and to simplify things, I want to try the MEGA to HID option. I'm just exploring the different possibilities and seeing which one is the best/easiest.
It is possible to add the missing DFU functionality to the ATmega16U2 chip on your Mega counterfeit by following that instructable. It is not necessary to put the chip into DFU mode because the instructable is using an ISP programmer to flash the firmware to the chip. Putting the chip into DFU mode is only necessary if you want to update the firmware via the board's USB cable using the Atmel FLIP tool (or an equivalent tool).
The "HoodLoader2" boards platform mentioned in the instructable is also definitely worth checking out.
Thank you. That's good to know. I do have a USBasp device. Does that mean that I do not need FLIP at all? My final goal is to upload MegaJoy to it. Do I need to update the 16U2 firmware in that case, if I have the USBasp? I might not need to put the board in DFU either for the MegaJoy firmware update in that case
I've been trying to flash the firmware, but I haven't been able to do it. For something to even pop up in the cmd screen, I had to be in the avrdude folder and executed this line:
But then I got the following message and nothing happened:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x6d3332
avrdude: Expected signature for ATmega16U2 is 1E 94 89
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude done. Thank you.
Make sure the programmer’s cable is correctly connected to the target board. Pin 1 on the cable is indicated by a small triangle embossed on the plastic of the connector housing. You can see the position of pin 1 on the Arduino board’s ICSP header in this graphic:
Yes, it's properly plugged in. I have this:
with a 10 to 6 pin labeled converter, so I know what each pin is, and yes, it's matching your above image.
I thing the ATMEL chip that I have, which is a MEGA16U2 1722 PH A972GB may have a different device signature, and I can't connect to it. I tried FLIP, PROGISP, and none of them detect them. At this point, I either try to get another Mega, or replace the 16U2 chip, which I really don't want to do.
The board works, if I upload sketches, so I may use it for something else. It's just that I can't put it in DFU mode, so I can't use it for this project.