I have used this board for years. Successfully used at as ISP just last night to upload code to an ATtiny84. Tried to upload the code again this morning to the same ATtiny and it gave me the following error:
FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: C:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7
Using core 'arduino' from platform in folder: C:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7
Detecting libraries used...
C:\Users\owner\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\cores\arduino -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\variants\standard C:\Users\owner\AppData\Local\arduino\sketches\7263D99E3C4843F4006191072788A1B4\sketch\ArduinoISP.ino.cpp -o nul
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
-> candidates: [SPI@1.0]
C:\Users\owner\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\cores\arduino -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\variants\standard -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\libraries\SPI\src C:\Users\owner\AppData\Local\arduino\sketches\7263D99E3C4843F4006191072788A1B4\sketch\ArduinoISP.ino.cpp -o nul
C:\Users\owner\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\cores\arduino -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\variants\standard -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\libraries\SPI\src C:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\libraries\SPI\src\SPI.cpp -o nul
Generating function prototypes...
C:\Users\owner\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\cores\arduino -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\variants\standard -IC:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\libraries\SPI\src C:\Users\owner\AppData\Local\arduino\sketches\7263D99E3C4843F4006191072788A1B4\sketch\ArduinoISP.ino.cpp -o C:\Users\owner\AppData\Local\Temp\896806571\sketch_merged.cpp
C:\Users\owner\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\owner\AppData\Local\Temp\896806571\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.7\\cores\\arduino" "-IC:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.7\\variants\\standard" "-IC:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.7\\libraries\\SPI\\src" "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4\\sketch\\ArduinoISP.ino.cpp" -o "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4\\sketch\\ArduinoISP.ino.cpp.o"
Compiling libraries...
Compiling library "SPI"
"C:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.7\\cores\\arduino" "-IC:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.7\\variants\\standard" "-IC:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.7\\libraries\\SPI\\src" "C:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.7\\libraries\\SPI\\src\\SPI.cpp" -o "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4\\libraries\\SPI\\SPI.cpp.o"
Compiling core...
Using precompiled core: C:\Users\owner\AppData\Local\arduino\cores\arduino_avr_uno_1f8e581a1cb3d6d60f3bd83bc1c26c8e\core.a
Linking everything together...
"C:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4/ArduinoISP.ino.elf" "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4\\sketch\\ArduinoISP.ino.cpp.o" "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4/..\\..\\cores\\arduino_avr_uno_1f8e581a1cb3d6d60f3bd83bc1c26c8e\\core.a" "-LC:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4" -lm
"C:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4/ArduinoISP.ino.elf" "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4/ArduinoISP.ino.eep"
"C:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4/ArduinoISP.ino.elf" "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4/ArduinoISP.ino.hex"
Using library SPI at version 1.0 in folder: C:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7\libraries\SPI
"C:\\Users\\owner\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\owner\\AppData\\Local\\arduino\\sketches\\7263D99E3C4843F4006191072788A1B4/ArduinoISP.ino.elf"
Sketch uses 4354 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 482 bytes (23%) of dynamic memory, leaving 1566 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\owner\AppData\Local\Arduino15\packages\arduino\tools\avrdude\8.0.0-arduino1/bin/avrdude" "-CC:\Users\owner\AppData\Local\Arduino15\packages\arduino\tools\avrdude\8.0.0-arduino1/etc/avrdude.conf" -v -patmega328p -carduino "-PCOM4" -b115200 -D "-Uflash:w:C:\Users\owner\AppData\Local\arduino\sketches\7263D99E3C4843F4006191072788A1B4/ArduinoISP.ino.hex:i"
Avrdude version 8.0-arduino.1
Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is C:\Users\owner\AppData\Local\Arduino15\packages\arduino\tools\avrdude\8.0.0-arduino1\etc\avrdude.conf
Using port : COM4
Using programmer : arduino
Setting baud rate : 115200
Error: cannot set com-state for \\.\COM4
Error: unable to open port COM4 for programmer arduino
Avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
I have tried a different USB cable, I was not able to use a MEGA to burn a bootloader (UNO is showing solid LED L), I have double checked the COM ports, I have reinstalled Arduino, I have reinstalled CH340 drivers, I have tried to upload the blink sketch. I have used AVRISP mkll as the programmer, I have used Arduino as ISP as the programmer. I have restarted my computer. I have tried uploading a sketch to a different ATTiny.
I have no idea why its not communicating with my board.
I can upload ArduinoISP to my UNO using the MEGA and upload using programmer but I cannot then use that UNO as a programmer.
I can upload all the sketches to the UNO this way.
The board is fine, just can't figure out why the UNO isn't communicating to my computer.
When I try and use the UNO as a programmer to my ATtiny84, it says the device is drawing too much power. The ATtiny84 is a QFN package, maybe I have a short. I hand soldered it with lots of flux, the chip is aligned properly and the SCK, MOSI, MISO, SS pins are all correct.
You have Arduino IDE configured to upload to the UNO board, not for the ATtiny85. You must configure Arduino IDE's Tools > Board menu as is appropriate for the target. In this case, the target is the ATtiny85. The UNO is only acting as a programmer that writes the upload data from the computer to the flash memory of the ATtiny85. The fact that the programmer happens to be an UNO is not relevant to the configuration of the Tools > Board menu.
Correct the Tools > Board menu selection and then try again.
I am trying to just upload any sketch the generic UNO at this point. (Generic UNO has no markings on the CH340 chip, I know this has been a problem for other users but as of yesterday everything worked fine.)
I rolled back the drivers from version 3.9 to 3.4 and now I get this:
Warning: attempt 1 of 10: not in sync: resp=0x00
I can upload a sketch to the UNO if I use my MEGA as Arduino as ISP and then upload using programmer but I cannot directly upload to the UNO, so I know the UNO is working as uploading a blink sketch works fine.
Great news! This means you have solved the cause of the "cannot set com-state"
When you did that, you erased the bootloader from the flash memory of the UNO's ATmega328P microcontroller. The bootloader is required in order to upload sketches to the UNO via a direct USB cable connection to your computer. For this reason, If you perform an "Upload Using Programmer" at some point and then later decide you want to go back to normal uploading to the boards, you must first perform a "Burn Bootloader" operation in order to be able to do so.
The new error you got is normal and expected when you attempt to do a normal upload to an UNO that doesn't have a bootloader.
So try this:
Connect the Mega board to the UNO board in the "Arduino as ISP" configuration.
Select Tools > Burn Bootloader from the Arduino IDE menus.
Wait for the "Burn Bootloader" operation to finish successfully.
Disconnect the Mega from the UNO board.
Connect the UNO board to your computer with a USB cable.
Select Sketch > Upload from the Arduino IDE menus.
AVR device initialized and ready to accept instructions
Device signature = 1E 95 0F (ATmega328P, ATA6614Q, LGT8F328P)
Auto-erasing chip as flash memory needs programming (-U flash:w:...)
specify the -D option to disable this feature
Erased chip
Processing -U flash:w:C:\Users\owner\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.7/bootloaders/optiboot/optiboot_atmega328.hex:i
Reading 502 bytes for flash from input file optiboot_atmega328.hex
in 2 sections of [0x7e00, 0x7fff]: 4 pages and 10 pad bytes
Writing 502 bytes to flash
Writing | ################################################## | 100% 0.63s
Reading | ################################################## | 100% 0.30s
502 bytes of flash verified
Processing -U lock:w:0x0F:m
Reading 1 byte for lock from input file 0x0F
in 1 section [0, 0]
Writing 1 byte (0x0F) to lock, 1 byte written, 1 verified
Avrdude done. Thank you.
Blink sketch upload error
Using port : COM4
Using programmer : arduino
Setting baud rate : 115200
Error: cannot set com-state for \\.\COM4
Error: unable to open port COM4 for programmer arduino
Avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
COM4 confirmed in device manager.
Board set to UNO
Programmer set to AVRISP mkll
same error when I switch to COM5. change baud rate to 9600, same. have programmer in AVRDUDESS set to Arduino bootloader using STK500 v 1 protocol.
Using port : COM5
Using programmer : arduino
Setting baud rate : 115200
Error: cannot set com-state for \\.\COM5
Error: unable to open port COM5 for programmer arduino
Avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
Select View > Devices by type from the Device Manager menus.
Open the "View" menu.
If there is a β to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
Open the "Ports (COM & LPT)" section of the Device Manager tree.
You should see a port identified as "USB-SERIAL CH340 (COMn)" under the "Ports (COM & LPT)" section (where "COMn" is some serial port e.g., COM4). Double click on that item.
The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
Select the "Drivers" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
Now please reply here on this forum topic to tell us the version number you saw after "Driver Version" field in that "USB-SERIAL CH340 (COMn) Properties" dialog.