├── ATTinyKeyer-Mod-II.jpg ├── README.md └── iambic85.c /ATTinyKeyer-Mod-II.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pp5vx/TinyKeyer/HEAD/ATTinyKeyer-Mod-II.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | IAMBIC85: "An Ultra Simple Iambic Keyer with Speed Pot" 2 | 3 | * At 2019 Jun 29: Now for **ALL** ATTiny85 (45/25 and for a 13, too !) 4 | 5 | No "misteries" here, in only 244 bytes of code ! 6 | 7 | * **Speed**: From about 12 wpm to 40 wpm 8 | 9 | * **Iambic Mode**: Iambic "B" ( Yep ! Accu Keyer, you bet... ) 10 | 11 | * **Sidetone**: 500 HZ (_fixed_) 12 | 13 | => At 2019 Jul 18: Changed to 500 HZ pitch (that's more "real World" CW !) 14 | 15 | * **DC Source**: 5V @ .03A ( _30ma_ ) 16 | 17 | => At 2019 Jul 18: Using an **external** 78L05 (better Speed Pot range) 18 | 19 | I loved to put all on **base** of my **Vibroplex Iambic Key** 20 | 21 | My version was done with an **ATTiny 13** (not an **ATTiny85 Board** as in Schematic) 22 | 23 | **Warning** ! 24 | 25 | * Licensed in World (except in Brazil), as: **CC BY-SA-NC 3.0** 26 | 27 | * Licensed **only** in Brazil, as: **©2018 - PP5VX** ( _Todos os Direitos Reservados_ ) 28 | 29 | Enjoy it... 30 | 31 | => At 2019 Jul 18: PSE this modest work **IS NOT** for ANY PROFIT of ANYONE IN WORLD ! 32 | 33 | **73/DX de PP5VX ( Bone )** 34 | -------------------------------------------------------------------------------- /iambic85.c: -------------------------------------------------------------------------------- 1 | // ========================================================================= 2 | // IAMBIC85.c (c)2017, present - PP5VX 3 | // ========================================================================= 4 | // * Title...: "An Ultra Simple Iambic Keyer with Speed Pot" 5 | // * Hardware: (RISC) ATTiny85 - 6012 bytes (with Bootloader) 6 | // ATTiny45 - 2100 bytes (with Bootloader) 7 | // ATTiny25 - 2048 bytes (but with **NO** Bootloader) 8 | // ATTiny13 - 1024 bytes (...no Bootloader of course) 9 | // * Used RAM: 244 bytes (4%) - ...I am getting old for these things ! (LOL) 10 | // ========================================================================= 11 | // Version: 1.0 ( 2012 ) Filename: [ iambic.c ] 12 | // Author.: Gary Aylward Date: 26 Dec 2012 13 | // Site...: www.garya.org.uk 14 | // ========================================================================= 15 | // Version: 2.0b01 Filename: [ IAMBIC85.c ] 16 | // Author.: PP5VX (Bone) at pp5vx .--.-. arrl.org Date: 07 Jan 2018 17 | // Site...: www.qsl.net/pp5vx 18 | // ========================================================================= 19 | // Version: 2.0b02 Filename: [ IAMBIC85.c ] 20 | // Author.: PP5VX (Bone) at pp5vx .--.-. arrl.org Date: 29 Jun 2019 21 | // Added some "confort modifications" (look at new Drawing Schematic) 22 | // => With a lil'ingenuity you can put all this thing on an ATTiny13 ! 23 | // ========================================================================= 24 | // Version: 3.0 Filename: [ IAMBIC85.c ] 25 | // Author.: PP5VX (Bone) at pp5vx .--.-. arrl.org Date: 18 Jul 2019 26 | // Some minor "cosmetic" corrections and use of ONLY "External Power" (5VDC) 27 | // ========================================================================= 28 | // Briefing: ( BUT YOU MUST READ IT ! ) 29 | // ========================================================================= 30 | // * Speed Pot: 100K ( LIN) 31 | // Center ( Viewing from rear ): To ADC1 ( Port B2 ) 32 | // Left ( Viewing from rear ): To 150K @ 1/4W and VDD 5 VDC 33 | // Right ( Viewing from rear ): To 33K @ 1/4W and GND 34 | // * Voltage Values Range: 0.535V and 2.32V (for a nominal 5 VDC input) 35 | // * ADC1 Values (Speed Port): From 27 to 118 (read below) 36 | // Speed Range with these ADC1 values are: From 12 wpm to 40 wpm 37 | // The ADC1 "Reference Voltage" is the VDD Voltage (allways around 5V DC) 38 | // ==> But the Timing DOES NOT work VERY STABLE **BELOW** 5 VDC ! 39 | // This device DOES NOT WORK with "Button Cell" Batteries (3 VDC) 40 | // ========================================================================= 41 | // * Sidetone: From Port P0 to (+) of a (Piezo) Buzzer and to GND 42 | // ========================================================================= 43 | // * TX Key ( Output ): From Port P1 - DIRECT - to GATE (G) of a 2N7000 44 | // Source (S) to GND, and Drain (D) to "CW Key Out" 45 | // ========================================================================= 46 | // * Iambic Key: DOT - from (Port) P4 to TIP of a "TRS Stereo" or P10 47 | // DASH - from (Port) P3 to RING of a "TRS Stereo" or P10 48 | // * Note (29 Jun 2019 ): 49 | // Added a DPDT Switch (a "hardware solution") to Swap the Paddle contacts 50 | // ========================================================================= 51 | // * WARNING ! **DO NOT USE** MORE THAN 5 VDC INPUT 52 | // VIN (on Board): Don't use this input ! 53 | // 5V (on Board): Use this Input from an EXTERNAL 5 VDC SUPPLY 54 | // USB (M3)......: Don't use this input ! 55 | // ========================================================================= 56 | // 57 | // * Brief WARNING for you ( if you are a Programmer, as is me... ): 58 | // ------------------------------------------------------------------------- 59 | // My Programming "taste" don't believe on defaults and standard indentation 60 | // So NEVER use [ CTRL-T ] (on the Arduino IDE) while you are on this code ! 61 | // You can get **very worst troubles** of indentation to fully understand it 62 | // ------------------------------------------------------------------------- 63 | 64 | #include 65 | #include 66 | 67 | #define dKEY_PORT (PORTB) 68 | #define dSIDETONE (PORTB0) // Port B0: Sidetone Output 69 | #define dKEY (PORTB1) // Port B1: TX KEY Output 70 | #define dSPEED (PORTB2) // Port B2: Speed Pot (Center) Input 71 | #define dDOT_KEY (PORTB3) // Port B3: Iambic Key DOT Input 72 | #define dDASH_KEY (PORTB4) // Port B4: Iambic Key DASH Input 73 | 74 | // ================================ Timer0 = Sidetone 75 | #define dMAX_COUNT (60) // Sidetone: 500 HZ (a "real World" CW pitch !) 76 | #define dGTCCR (0x00) 77 | #define dTCCR0A (0x42) 78 | #define dTCCR0B (0x03) 79 | // ==== Timer1 = State Machine Clock 80 | #define dTCCR1 (0x0E) 81 | #define dWPM_COUNT (159) // 256 - 97 82 | 83 | // ====== ADC Control Register Settings 84 | #define dADMUX (0x21) 85 | #define dADCSRA (0xF6) 86 | #define dADCSRB (0x00) 87 | #define dDIDR0 (1<= 3) { vNextState = dWAIT_DASH; 143 | vCount = 0; 144 | } 145 | else vNextState = dDASH; 146 | break; 147 | case dWAIT_DOT: DDRB &= ~(1 << dSIDETONE); 148 | PORTB &= ~(1 << dKEY); 149 | break; 150 | case dWAIT_DASH: DDRB &= ~(1 << dSIDETONE); 151 | PORTB &= ~(1 << dKEY); 152 | break; 153 | } // end SWITCH 154 | } // end IF 155 | 156 | // =========================================================== Speed Change 157 | if ((ADCSRA & (1 << ADIF)) == (1 << ADIF)) // Convert ADC Value and Update 158 | { vPotValue = ADCH; // ADC Rresult 159 | vTimerCount = 256 - vPotValue; // New Timer Value 160 | ADCSRA |= (1 << ADIF); // Restart ADC 161 | } 162 | // ================================= Poll Key Inputs: Idle or a Wait State 163 | switch (vThisState) 164 | { case dIDLE: break; 165 | case dWAIT_DOT: if ((PINB & (1<