Crustaceans Chirp Chirp Challenge

From John's wiki
Jump to navigation Jump to search
[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

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)

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