Crustaceans Chirp Chirp Challenge: Difference between revisions

From John's wiki
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 18: Line 18:
* [https://www.freqsound.com/SIRA/MIDI%20Specification.pdf The Complete MIDI 1.0 Detailed Specification - Freq Sound] (PDF)
* [https://www.freqsound.com/SIRA/MIDI%20Specification.pdf The Complete MIDI 1.0 Detailed Specification - Freq Sound] (PDF)
* https://midi.org/specs
* https://midi.org/specs
== Notes from @kline on Wednesday, 24 April 2024 ==
[1:43:27 AM AEST] jj5 | kline: I have a few STM32F411 chips. should I be able to compile your code and flash onto that?
[1:43:29 AM AEST] maybe!
[1:43:51 AM AEST] the code should be fairly portable thanks to the support library im using
[1:58:59 AM AEST] jj5, the support libraries are what take the device definitions (where each register is, how wide they are, etc) and turns them into useful bits of code in your programming language. additionally, they will often give you a helpful API to use these definitions
[1:59:05 AM AEST] let me grab the avr-libc version that you're already using
[2:03:53 AM AEST] jj5, so you know in your code you do some manipulation to put timer 2 into CTC mode?
[2:04:18 AM AEST] // 2024-04-23 jj5 - set to CTC Mode
[2:04:19 AM AEST] TCCR2A = 0x02;
[2:04:34 AM AEST] what _is_ TCCR2A ?
[2:05:20 AM AEST] broadly, its a hardware register, but how is it we can write to it like a C variable
[2:05:35 AM AEST] Timer/Counter Control Register (for timer 2, part A)
[2:06:37 AM AEST] if we go to the register summary in the datasheet, we can see where about this is defined: (0xB0) TCCR2A
[2:07:05 AM AEST] so now we have the logical purpose as well as the location the physical bits (and they really are physical) in mapped memory
[2:07:21 AM AEST] avr-libc then does some fiddling like this: https://github.com/vancegroup-mirrors/avr-libc/blob/master/avr-libc/include/avr/iom328p.h#L625
[2:07:53 AM AEST] this is the IO definition for the m328p
[2:08:40 AM AEST] https://github.com/vancegroup-mirrors/avr-libc/blob/06cc6ff5e6120b36f1b246871728addee58d3f87/avr-libc/include/avr/sfr_defs.h#L179
[2:09:10 AM AEST] deeper down we have the definition for SFR_IO8, but basically its a macro that takes an address (0xB0 in this case) and turns it into a nicely wrapped pointer
[2:09:29 AM AEST] #define _MMIO_BYTE(mem_addr) (*(volatile uint8_t *)(mem_addr))
[2:10:04 AM AEST] so when you do TCCR2A = 0x02; that becomes (*(volatile uint8_t *)(0xB0)) = 0x02;
[2:11:49 AM AEST] avr-libc is 1) a small implementation of gnu libc for the AVR architecture, 2) a collection of IO definitions for individual parts, and 3) a collection of additional APIs specific to AVR devices to make manipulating them more convenient
[2:12:39 AM AEST] https://www.nongnu.org/avr-libc/user-manual/group__util__delay.html
[2:12:52 AM AEST] here for example is a small API for busy loop delays
[2:13:17 AM AEST] https://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html
[2:13:53 AM AEST] heres the API for writing to the EEPROM, a small amount of electrically persistent memory that survives reboots (for things like saving serial numbers, user calibration settings, etc)
[2:14:24 AM AEST] libopencm3 is (one example of) a support library that targets a bunch of different devices originally based on the Cortex M3
[2:15:41 AM AEST] jj5 | in this book the author eschews all of the support libraries
[2:15:46 AM AEST] also fine, but much more work
[2:16:40 AM AEST] i personally have no interest in implementing a USB stack when i can just use https://libopencm3.org/docs/latest/stm32f1/html/group__usb__driver__defines.html#ga53f14b18823b0b215f9674dfeedaf8be
[2:23:45 AM AEST] again, you dont need to read it all, just whats relevant. you probably dont care about PWM (which is a fixed-frequency mode, not useful if you need a variable frequency tone)
[2:23:50 AM AEST] for example
[2:25:22 AM AEST] the arduino stuff is a C++ framework on top of avr-libc
[2:26:38 AM AEST] https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/main.cpp


== Plan of attack ==
== Plan of attack ==


@kline says:
=== Phase 1 ===
 
@kline helped me articulate the following course of action:


# read https://www.ladyada.net/learn/arduino/lesson4.html  
# read https://www.ladyada.net/learn/arduino/lesson4.html  
Line 29: Line 66:
# make an LED flash on an Arduino Uno via serial commands ('a' for on, 's' for off)
# make an LED flash on an Arduino Uno via serial commands ('a' for on, 's' for off)
#* use minicom, screen, putty, or Arduino IDE to connect
#* use minicom, screen, putty, or Arduino IDE to connect
# read [https://amzn.to/3JjHBdu Make: AVR Programming: Get Under the Hood of the AVR Microcontroller Family: Learning to Write Software for Hardware]
# read [https://amzn.to/3UdQpYQ Basic Arduino Projects: 26 Experiments with Microcontrollers and Electronics]
# read [https://amzn.to/3VWvt9O Make: Analog Synthesizers: Make Electronic Sounds the Synth-DIY Way]
# watch https://web.eece.maine.edu/~zhu/book/tutorials.php
Results are [https://blog.jj5.net/blog/2024/04/21/controlling-arduino-uno-with-serial-commands/ here].
=== Phase 2 ===
@kline says my next task is to read the [https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf Arduino Uno datasheet] to learn about built-in hardware timer facilities. Particularly section 14.2 and 14.5.
I need to check which timer is in use for millis() and delay(). there are three timers, so two should be available. (Note: it's timer/counter0 used by those libraries, 1 and 2 remain available)
=== Phase 3 ===
More reading!
* https://github.com/vancegroup-mirrors/avr-libc/blob/master/avr-libc/include/avr/iom328p.h#L625
* https://github.com/vancegroup-mirrors/avr-libc/blob/06cc6ff5e6120b36f1b246871728addee58d3f87/avr-libc/include/avr/sfr_defs.h#L179
* https://www.nongnu.org/avr-libc/user-manual/group__util__delay.html
* https://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html
* https://libopencm3.org/docs/latest/stm32f1/html/group__usb__driver__defines.html#ga53f14b18823b0b215f9674dfeedaf8be
* https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/main.cpp
Also @kline says: you probably dont care about PWM (which is a fixed-frequency mode, not useful if you need a variable frequency tone)
=== Phase 4 ===
* setup output to OLED device for debugging without USB
* play a MIDI file from RAM
* create struct to model MIDI message
* handle note on and note off messages
== Arduino Uno ==
Note to self: My Arduino Uno knockoff identifies itself as a "QinHeng Electronics USB Serial" USB device.
The chip is ATmega328P


== AVR reference ==
== AVR reference ==


The Arduinos and ATtiny{85,45,13A} are AVR devices.
The Arduinos and ATtiny{85,45,13A} are [https://www.microchip.com/en-us/products/microcontrollers-and-microprocessors/8-bit-mcus/avr-mcus 8-bit AVR MCUs].


* https://github.com/obdev/v-usb
* https://github.com/obdev/v-usb

Latest revision as of 13:30, 22 May 2024

[08:28] <kline> i dont know what the standard target for "is this embedded system useful" is but id like to propose a midi synth:
[08:28] <kline> * implement serial comms
[08:28] <kline> * needs timers/interrupts
[08:28] <kline> * includes PWM/etc peripherals for IO
[08:29] <kline> * actually fails if you fuck up the hard realtime aspects
[08:29] <kline> * you get a cool toy at the end
[08:29] <kline> bonus: you can scale to things like polyphony

Notes from @kline on Wednesday, 24 April 2024

[1:43:27 AM AEST] jj5 | kline: I have a few STM32F411 chips. should I be able to compile your code and flash onto that?
[1:43:29 AM AEST] maybe!
[1:43:51 AM AEST] the code should be fairly portable thanks to the support library im using
[1:58:59 AM AEST] jj5, the support libraries are what take the device definitions (where each register is, how wide they are, etc) and turns them into useful bits of code in your programming language. additionally, they will often give you a helpful API to use these definitions
[1:59:05 AM AEST] let me grab the avr-libc version that you're already using
[2:03:53 AM AEST] jj5, so you know in your code you do some manipulation to put timer 2 into CTC mode?
[2:04:18 AM AEST] // 2024-04-23 jj5 - set to CTC Mode
[2:04:19 AM AEST] TCCR2A = 0x02;
[2:04:34 AM AEST] what _is_ TCCR2A ?
[2:05:20 AM AEST] broadly, its a hardware register, but how is it we can write to it like a C variable
[2:05:35 AM AEST] Timer/Counter Control Register (for timer 2, part A)
[2:06:37 AM AEST] if we go to the register summary in the datasheet, we can see where about this is defined: (0xB0) TCCR2A
[2:07:05 AM AEST] so now we have the logical purpose as well as the location the physical bits (and they really are physical) in mapped memory
[2:07:21 AM AEST] avr-libc then does some fiddling like this: https://github.com/vancegroup-mirrors/avr-libc/blob/master/avr-libc/include/avr/iom328p.h#L625
[2:07:53 AM AEST] this is the IO definition for the m328p
[2:08:40 AM AEST] https://github.com/vancegroup-mirrors/avr-libc/blob/06cc6ff5e6120b36f1b246871728addee58d3f87/avr-libc/include/avr/sfr_defs.h#L179
[2:09:10 AM AEST] deeper down we have the definition for SFR_IO8, but basically its a macro that takes an address (0xB0 in this case) and turns it into a nicely wrapped pointer
[2:09:29 AM AEST] #define _MMIO_BYTE(mem_addr) (*(volatile uint8_t *)(mem_addr))
[2:10:04 AM AEST] so when you do TCCR2A = 0x02; that becomes (*(volatile uint8_t *)(0xB0)) = 0x02;
[2:11:49 AM AEST] avr-libc is 1) a small implementation of gnu libc for the AVR architecture, 2) a collection of IO definitions for individual parts, and 3) a collection of additional APIs specific to AVR devices to make manipulating them more convenient
[2:12:39 AM AEST] https://www.nongnu.org/avr-libc/user-manual/group__util__delay.html
[2:12:52 AM AEST] here for example is a small API for busy loop delays
[2:13:17 AM AEST] https://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html
[2:13:53 AM AEST] heres the API for writing to the EEPROM, a small amount of electrically persistent memory that survives reboots (for things like saving serial numbers, user calibration settings, etc)
[2:14:24 AM AEST] libopencm3 is (one example of) a support library that targets a bunch of different devices originally based on the Cortex M3
[2:15:41 AM AEST] jj5 | in this book the author eschews all of the support libraries
[2:15:46 AM AEST] also fine, but much more work
[2:16:40 AM AEST] i personally have no interest in implementing a USB stack when i can just use https://libopencm3.org/docs/latest/stm32f1/html/group__usb__driver__defines.html#ga53f14b18823b0b215f9674dfeedaf8be
[2:23:45 AM AEST] again, you dont need to read it all, just whats relevant. you probably dont care about PWM (which is a fixed-frequency mode, not useful if you need a variable frequency tone)
[2:23:50 AM AEST] for example
[2:25:22 AM AEST] the arduino stuff is a C++ framework on top of avr-libc
[2:26:38 AM AEST] https://github.com/arduino/ArduinoCore-avr/blob/master/cores/arduino/main.cpp

Plan of attack

Phase 1

@kline helped me articulate the following course of action:

  1. read https://www.ladyada.net/learn/arduino/lesson4.html
  2. read https://learn.sparkfun.com/tutorials/tags/arduino
  3. read https://www.arduino.cc/reference/en/language/functions/communication/serial/read/
  4. make an LED flash on an Arduino Uno
  5. make an LED flash on an Arduino Uno via serial commands ('a' for on, 's' for off)
    • use minicom, screen, putty, or Arduino IDE to connect
  6. read Make: AVR Programming: Get Under the Hood of the AVR Microcontroller Family: Learning to Write Software for Hardware
  7. read Basic Arduino Projects: 26 Experiments with Microcontrollers and Electronics
  8. read Make: Analog Synthesizers: Make Electronic Sounds the Synth-DIY Way
  9. watch https://web.eece.maine.edu/~zhu/book/tutorials.php

Results are here.

Phase 2

@kline says my next task is to read the Arduino Uno datasheet to learn about built-in hardware timer facilities. Particularly section 14.2 and 14.5.

I need to check which timer is in use for millis() and delay(). there are three timers, so two should be available. (Note: it's timer/counter0 used by those libraries, 1 and 2 remain available)

Phase 3

More reading!

Also @kline says: you probably dont care about PWM (which is a fixed-frequency mode, not useful if you need a variable frequency tone)

Phase 4

  • setup output to OLED device for debugging without USB
  • play a MIDI file from RAM
  • create struct to model MIDI message
  • handle note on and note off messages

Arduino Uno

Note to self: My Arduino Uno knockoff identifies itself as a "QinHeng Electronics USB Serial" USB device.

The chip is ATmega328P

AVR reference

The Arduinos and ATtiny{85,45,13A} are 8-bit AVR MCUs.

ChatGPT says...

MIDI software

User

what is the best MIDI software for Debian and KDE Plasma?

ChatGPT

Choosing the "best" MIDI software can depend heavily on what you're looking for in terms of features, ease of use, and compatibility with your hardware and other software. However, for Debian and KDE Plasma users, several options stand out for their robustness, community support, and integration capabilities. Here are a few options that are highly regarded within the Linux music production community:

  1. LMMS (Linux MultiMedia Studio): LMMS is a free, open-source digital audio workstation (DAW) that offers a variety of features for music production, including MIDI support. It's user-friendly and provides a wealth of synthesizers, samplers, and plugins. It's compatible with KDE Plasma as it uses Qt for its GUI framework.
  2. Ardour: Ardour is a professional-grade DAW that is highly respected in the audio production community. It offers comprehensive support for MIDI recording, editing, and playback. It's known for its flexibility and can be used for both audio and MIDI projects. Ardour runs well on KDE Plasma and integrates smoothly with Jack Audio Connection Kit for advanced audio routing.
  3. Qtractor: Qtractor is an audio/MIDI multi-track sequencer designed specifically for Linux. It's built using the Qt framework, making it a good fit for KDE Plasma. Qtractor supports a wide range of audio and MIDI file formats and plugins, making it a versatile choice for MIDI composition and editing.
  4. Rosegarden: Rosegarden is another excellent MIDI sequencer and score editor for Linux that is compatible with KDE Plasma. It offers a rich set of features for composing, editing, and arranging MIDI music with a focus on notation and score editing.
  5. Muse: Muse is a MIDI/Audio sequencer with recording and editing capabilities. It's designed to be a complete solution for music production on Linux and works well with KDE Plasma. Muse supports standard MIDI files, DSSI, LADSPA, LV2 plugins, and more.

Each of these software options has its strengths and might cater to different aspects of MIDI music production. LMMS and Ardour are perhaps the most comprehensive for those looking to do both MIDI and audio production, while Qtractor, Rosegarden, and Muse offer powerful MIDI sequencing and editing features that might be more appealing to those focusing on MIDI.

I recommend trying out a few of these options to see which one aligns best with your workflow and needs. All are available in the Debian repositories, making installation straightforward on a Debian-based system with KDE Plasma.

Programming

Tiny AVR Programmer

I have a Tiny AVR Programmer from SparkFun. The Tiny AVR Programmer Hookup Guide explains how to use it.

Programming hardware

The Arduino Uno (left) has been programmed as an ISP using File > Examples > 11.ArduinoISP.

The ATtiny85 (right) has been connected with pins as indicated.

The LEDs are as follows:

  • Green: heartbeat
  • Orange: programming
  • Red: error

Test program

This program for the ATtiny85 should flash the LED:

int led_pin=13;

void setup() {

pinMode(led_pin,OUTPUT);

}

void loop()

{

digitalWrite(led_pin,HIGH);
delay(200);

digitalWrite(led_pin,LOW);

delay(2000);

}

Programming ATtiny85

Programmer: Arduino as ISP

Board: "ATtiny25/45/85"
Port: "COM5"
Clock: "Internal 1 MHz"
Processor: "ATtiny85"
Programmer: Arduino as ISP

Then I run: Sketch -> Upload Using Programmer

FQBN: attiny:avr:ATtinyX5:cpu=attiny85
Using board 'ATtinyX5' from platform in folder: C:\Users\jj5\AppData\Local\Arduino15\packages\attiny\hardware\avr\1.0.2
Using core 'arduino' from platform in folder: C:\Users\jj5\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\jj5\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=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_attiny -DARDUINO_ARCH_AVR -IC:\Users\jj5\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\jj5\AppData\Local\Arduino15\packages\attiny\hardware\avr\1.0.2\variants\tiny8 C:\Users\jj5\AppData\Local\Temp\arduino\sketches\8F21679C5B4D8786582C9549E04AD4B0\sketch\sketch_jan3a.ino.cpp -o nul
Generating function prototypes...
C:\Users\jj5\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=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_attiny -DARDUINO_ARCH_AVR -IC:\Users\jj5\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\jj5\AppData\Local\Arduino15\packages\attiny\hardware\avr\1.0.2\variants\tiny8 C:\Users\jj5\AppData\Local\Temp\arduino\sketches\8F21679C5B4D8786582C9549E04AD4B0\sketch\sketch_jan3a.ino.cpp -o C:\Users\jj5\AppData\Local\Temp\691236262\sketch_merged.cpp
C:\Users\jj5\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\jj5\AppData\Local\Temp\691236262\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0\\sketch\\sketch_jan3a.ino.cpp" -o "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0\\sketch\\sketch_jan3a.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\jj5\AppData\Local\Temp\arduino\cores\attiny_avr_ATtinyX5_cpu_attiny85,clock_internal1_295a3a5649ea0dc187eecaa0844f84a9\core.a
Linking everything together...
"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=attiny85 -o "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0\\sketch\\sketch_jan3a.ino.cpp.o" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/..\\..\\cores\\attiny_avr_ATtinyX5_cpu_attiny85,clock_internal1_295a3a5649ea0dc187eecaa0844f84a9\\core.a" "-LC:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0" -lm
"C:\\Users\\jj5\\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\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.eep"
"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.hex"

"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf"
Sketch uses 692 bytes (8%) of program storage space. Maximum is 8192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
"C:\Users\jj5\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\jj5\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -pattiny85 -cstk500v1 -PCOM5 -b19200 "-Uflash:w:C:\Users\jj5\AppData\Local\Temp\arduino\sketches\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.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\jj5\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Failed programming: uploading error: exit status 1

Programmer: Arduino as ISP (ATmega32U4)

Board: "ATtiny25/45/85"
Port: "COM5"
Clock: "Internal 1 MHz"
Processor: "ATtiny85"
Programmer: Arduino as ISP (ATmega32U4)
FQBN: attiny:avr:ATtinyX5:cpu=attiny85
Using board 'ATtinyX5' from platform in folder: C:\Users\jj5\AppData\Local\Arduino15\packages\attiny\hardware\avr\1.0.2
Using core 'arduino' from platform in folder: C:\Users\jj5\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\jj5\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=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_attiny -DARDUINO_ARCH_AVR -IC:\Users\jj5\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\jj5\AppData\Local\Arduino15\packages\attiny\hardware\avr\1.0.2\variants\tiny8 C:\Users\jj5\AppData\Local\Temp\arduino\sketches\8F21679C5B4D8786582C9549E04AD4B0\sketch\sketch_jan3a.ino.cpp -o nul
Generating function prototypes...
C:\Users\jj5\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=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_attiny -DARDUINO_ARCH_AVR -IC:\Users\jj5\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\jj5\AppData\Local\Arduino15\packages\attiny\hardware\avr\1.0.2\variants\tiny8 C:\Users\jj5\AppData\Local\Temp\arduino\sketches\8F21679C5B4D8786582C9549E04AD4B0\sketch\sketch_jan3a.ino.cpp -o C:\Users\jj5\AppData\Local\Temp\958918049\sketch_merged.cpp
C:\Users\jj5\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\jj5\AppData\Local\Temp\958918049\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_attiny -DARDUINO_ARCH_AVR "-IC:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\attiny\\hardware\\avr\\1.0.2\\variants\\tiny8" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0\\sketch\\sketch_jan3a.ino.cpp" -o "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0\\sketch\\sketch_jan3a.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\jj5\AppData\Local\Temp\arduino\cores\attiny_avr_ATtinyX5_cpu_attiny85,clock_internal1_295a3a5649ea0dc187eecaa0844f84a9\core.a
Linking everything together...
"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=attiny85 -o "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0\\sketch\\sketch_jan3a.ino.cpp.o" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/..\\..\\cores\\attiny_avr_ATtinyX5_cpu_attiny85,clock_internal1_295a3a5649ea0dc187eecaa0844f84a9\\core.a" "-LC:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0" -lm
"C:\\Users\\jj5\\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\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.eep"
"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf" "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.hex"

"C:\\Users\\jj5\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\jj5\\AppData\\Local\\Temp\\arduino\\sketches\\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.ino.elf"
Sketch uses 692 bytes (8%) of program storage space. Maximum is 8192 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
"C:\Users\jj5\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\jj5\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -pattiny85 -carduino -PCOM5 -b19200 "-Uflash:w:C:\Users\jj5\AppData\Local\Temp\arduino\sketches\8F21679C5B4D8786582C9549E04AD4B0/sketch_jan3a.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\jj5\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Failed programming: uploading error: exit status 1