Defines | Functions | Variables

/Users/au/Development/AVR C/YACK/main.c File Reference

CW Keyer application. More...

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <util/delay.h>
#include "yack.h"
Include dependency graph for main.c:

Go to the source code of this file.


#define TRAINTIMEOUT   10
#define PITCHREPEAT   10
#define FARNSREPEAT   10


void pitch (void)
 Pitch change mode.
void setfarns (void)
 Farnsworth change mode.
word lfsr (byte n)
 Simple random number generator.
void rndcall (char *call)
 Randomize a callsign.
void cstrain (void)
 Callsign trainer mode.
void beacon (byte mode)
 Beacon mode.
void commandmode (void)
 Command mode.
int main (void)
 Trivial main routine.


const char txok[] PROGMEM = "OK"

Detailed Description

CW Keyer application.

Jan Lategahn DK3LJ (C) 2010

This file implements a sample CW keyer application by using the yack.c library. It is targeted at the ATTINY45 microcontroller but can be used for other ATMEL controllers in the same way. Note the enclosed documentation for further defails.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <>.

15.10.2010 - Created
16.12.2010 - Submitted to SVN
16.11.2011 - Last change

Definition in file main.c.

Function Documentation

void beacon ( byte  mode )

Beacon mode.

This routine can read a beacon transmission interval up to 9999 seconds and store it in EEPROM (RECORD mode) In PLAY mode, when called in the YACKBEAT loop, it plays back message 2 in the programmed interval

modeRECORD (read and store the beacon interval) or PLAY (beacon)
See also:

Definition at line 248 of file main.c.

void commandmode ( void   )

Command mode.

This routine implements command mode. Entries are read from the paddle and interpreted as commands.

Definition at line 340 of file main.c.

Here is the call graph for this function:

void cstrain ( void   )

Callsign trainer mode.

This implements callsign training. The keyer plays a random callsign and the user repeats it on the paddle. If a mistake happens, the error prosign is sounded, the callsign sent again and the user attempts one more time.

Definition at line 181 of file main.c.

Here is the call graph for this function:

word lfsr ( byte  n )

Simple random number generator.

The library function random number generator works fine but is a nightmare in size as it utilizes various multiplications and divisions (+600 Byte). This routine implements a LFSR (linear feedback shift register) in the Galois method which is good enough for this specific application.

na number between 2 and 255
a random number between 0 and n-1

Definition at line 123 of file main.c.

int main ( void   )

Trivial main routine.

Yack library is initialized, command mode is entered on request and both beacon and keyer routines are called in 10 ms intervals.

Not relevant

Definition at line 522 of file main.c.

Here is the call graph for this function:

void pitch ( void   )

Pitch change mode.

This function implements pitch change mode. A series of dots is played and pitch can be adjusted using the paddle levers.

Once 10 dots have been played at the same pitch, the mode terminates

Definition at line 52 of file main.c.

void rndcall ( char *  call )

Randomize a callsign.

This creates a random callsign with 2 letters + 1 digit + 2 letters

calla pointer to a buffer of sufficient size to store the callsign

Definition at line 155 of file main.c.

Here is the call graph for this function:

void setfarns ( void   )

Farnsworth change mode.

This function implements farnsworth pause change mode. Farnsworth pauses can be added or removed with the paddle keys.

Definition at line 87 of file main.c.

 All Files Functions Variables Enumerations Enumerator