Vibroplex Iambic Deluxe + homebrew Atmega 8 electronic keyer
Dots and Dashes are automatic
Sorry, the link : mega.co.nz/#!8hpiVKbQ!IVhJ08i...
is broken.
20/3/2020 I put the code down, for BascomAVR and the updated code for Arduino.
BascomAVR code:
$regfile = "m8def.dat"
$crystal = 8000000
'******************************************************************************
' Vibrokeyer and Iambic Morse Code Keyer
'******************************************************************************
' Fernando Daniel Fiamberti - LW7DDH
' January 2014
'******************************************************************************
Config Portb.3 = Input
Da_iambico Alias Pinb.3 'Dash iambic input
Set Portb.3
Config Portd.5 = Input
Di Alias Pind.5 'Dit iambic/vibrokeyer input
Set Portd.5
Config Portd.6 = Input
Da_vibrokeyer Alias Pind.6 'Dash vibrokeyer/straight key input
Set Portd.6
Config Pind.7 = Output 'CW output (0 to 5V)
Salida Alias Portd.7
Salida = 0
'******************************************************************************
' TIMERS and A/D converter
'******************************************************************************
Config Adc = Single , Prescaler = 4 , Reference = Avcc
Start Adc
Enable Interrupts
'******************************************************************************
Dim Raya As Word
Dim Punto As Word
Potenciometro Alias 3 'Adc3 input of velocity potenciometer
Inicio:
Punto = Getadc(3) / 7
Raya = Punto * 3
If Di = 0 Then
Salida = 1
Waitms Punto
Salida = 0
Waitms Punto
End If
If Da_iambico = 0 Then
Salida = 1
Waitms Raya
Salida = 0
Waitms Punto
End If
If Da_vibrokeyer = 0 Then
Salida = 1
Else
Salida = 0
End If
Goto Inicio
End
Arduino code:
/******************************************************************************
Vibrokeyer and Iambic Morse Code Keyer
******************************************************************************
Fernando Daniel Fiamberti - LW7DDH
20 / 3 / 2020
******************************************************************************
Viborkeyer, Iambic and Straight Key INPUTS
******************************************************************************/
int Di = 6; // Dit vibrokeyer input / iambic
int Da_vibrokeyer = 7; // Dash vibrokeyer / straight key input
int Da_iambico = 5; // Dash iambic input
int CW_output = 12; // CW output: "0" and "1" logic level (0 to 5V)
/*****************************************************************************/
int Speaker_output = 11; // Analog CW output
// controlled by an NPN or MosFet transistor.
unsigned int Punto = 0;
unsigned int Raya = 0;
unsigned int i = 0;
unsigned int ON_OFF = 0;
int Potenciometro = A0; // Input of velocity potentiometer
void setup()
{
pinMode (Di , INPUT_PULLUP);
pinMode (Da_vibrokeyer , INPUT_PULLUP);
pinMode (Da_iambico , INPUT_PULLUP);
pinMode (CW_output, OUTPUT);
pinMode (Speaker_output, OUTPUT);
pinMode (LED_BUILTIN, OUTPUT);
digitalWrite(CW_output, LOW);
digitalWrite(Speaker_output, LOW);
digitalWrite(LED_BUILTIN, LOW);
}
void loop()
{
Punto = analogRead(Potenciometro) / 7; // reference delay
if(Punto LESS THAN 5){ // replace with the less than sign
Punto=5;
}
Raya = Punto * 3;
if (digitalRead(Di) == LOW)
{
digitalWrite(CW_output, HIGH);
digitalWrite(LED_BUILTIN, HIGH);
ON_OFF = 1;
Retardo_ms(Punto);
digitalWrite(CW_output, LOW);
digitalWrite(LED_BUILTIN, LOW);
ON_OFF = 0;
Retardo_ms(Punto);
}
if (digitalRead(Da_iambico) == LOW)
{
digitalWrite(CW_output, HIGH);
digitalWrite(LED_BUILTIN, HIGH);
ON_OFF = 1;
Retardo_ms(Raya);
digitalWrite(CW_output, LOW);
digitalWrite(LED_BUILTIN, LOW);
ON_OFF = 0;
Retardo_ms(Punto);
}
if (digitalRead(Da_vibrokeyer) == LOW)
{
digitalWrite(CW_output, HIGH);
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(Speaker_output, HIGH);
delayMicroseconds(608);
digitalWrite(Speaker_output, LOW);
delayMicroseconds(608);
}
else
{
digitalWrite(CW_output, LOW);
digitalWrite(LED_BUILTIN, LOW);
}
}
void Retardo_ms(unsigned int retardo)
{
unsigned tiempo_trascurrido = 0;
do
{
if (ON_OFF == 1)
{
digitalWrite(Speaker_output, HIGH);
delayMicroseconds(625);
digitalWrite(Speaker_output, LOW);
delayMicroseconds(625);
}
else
{
delayMicroseconds(1250);
digitalWrite(Speaker_output, LOW);
}
tiempo_trascurrido++;
} while (tiempo_trascurrido != retardo);
}
5 апр 2013