Error uploading to arduino mega

I'm trying to upload a code to arduino, but it always gives the same error. When I use arduino uno it sends the code normally, but when I try with Arduino mega it doesn't work, I've tried with two Arduino Mega boards, on two different computers, but it didn't work. The error is as follows:

Arduino: 1.8.19 (Windows 10), Placa:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)" O sketch usa 2692 bytes (1%) de espaço de armazenamento para programas. O máximo são 253952 bytes. Variáveis globais usam 186 bytes (2%) de memória dinâmica, deixando 8006 bytes para variáveis locais. O máximo são 8192 bytes. avrdude: ser_open(): can't set com-state for "\\.\COM6" avrdude: ser_drain(): read error: Identificador inv lido. avrdude: ser_send(): write error: sorry no info avail avrdude: stk500_send(): failed to send command to serial port avrdude: ser_recv(): read error: Identificador inv lido. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: ser_send(): write error: sorry no info avail avrdude: stk500_send(): failed to send command to serial port avrdude: ser_recv(): read error: Identificador inv lido. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: ser_send(): write error: sorry no info avail avrdude: stk500_send(): failed to send command to serial port avrdude: ser_recv(): read error: Identificador inv lido. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: ser_send(): write error: sorry no info avail avrdude: stk500_send(): failed to send command to serial port avrdude: ser_recv(): read error: Identificador inv lido. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: ser_send(): write error: sorry no info avail avrdude: stk500_send(): failed to send command to serial port avrdude: ser_send(): write error: sorry no info avail avrdude: ser_recv(): read error: Identificador inv lido. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: ser_send(): write error: sorry no info avail avrdude: stk500_send(): failed to send command to serial port avrdude: ser_recv(): read error: Identificador inv lido. avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer Este relatório teria mais informações com "Mostrar a saida detalhada durante a compilação" opção pode ser ativada em "Arquivo -> Preferências"
´´´

Did you select the Mega in the Tools menu?

Yes

Please select the "all error" option for uploads in the Settings, and post the entire error message verbatim.

This one?

Arduino: 1.8.19 (Windows 10), Placa:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

O sketch usa 2692 bytes (1%) de espaço de armazenamento para programas. O máximo são 253952 bytes.

Variáveis globais usam 186 bytes (2%) de memória dinâmica, deixando 8006 bytes para variáveis locais. O máximo são 8192 bytes.

C:\Users\guilh\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\guilh\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM6 -b115200 -D -Uflash:w:C:\Users\guilh\AppData\Local\Temp\arduino_build_676470/Sistema_de_Registros.ino.hex:i 



avrdude: Version 6.3-20190619

         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         Copyright (c) 2007-2014 Joerg Wunsch



         System wide configuration file is "C:\Users\guilh\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"



         Using Port                    : COM6

         Using Programmer              : wiring

         Overriding Baud Rate          : 115200

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_ReceiveMessage(): timeout

avrdude: stk500v2_getsync(): timeout communicating with programmer



avrdude done.  Thank you.



Ocorreu um erro enquanto o sketch era carregado



Este relatório teria mais informações com
"Mostrar a saida detalhada durante a compilação"
opção pode ser ativada em "Arquivo -> Preferências"

Which version of Arduino Mega are you using? Does your board have the CH340 USB to TTL converter chip?

Thanks for that. When you plug it into the PC, is it visible as USB serial device in the device manager (assuming Windows)?

When I connect it appears with the name: USB-SERIAL CH340 (COM6)

It has a CH340 office chip

Have you installed the CH340 driver software?

yes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.