\chapter{Signal generation}

The different signal generation modes are only available with a ATmega328 processor.
You must also enable the dialog function with the Makefile option WITH\_MENU.
The menu is called by a long key press. The available functions are shown in the
second row of the LCD. You can select the shown function by a long key press.
The next function in automatically shown after 5 seconds or after a short key press.

\label{sec:generation}
\section{Frequency Generation}
The frequency generation is started, if you select the ''f-Generator'' function by
a long key press.
The frequency output is done with the \(680\Omega\) resistor at measurement port TP2.
The measurement port TP1 is switched to GND.
The frequencies are build with the 16~bit counter from the CPU clock frequency 
(\(8MHz\) or \(16MHz\)).
Currently a list of predefined frequencies (\(2MHz\) down to \(1Hz\)) can be selected with short key press.
If you hold the key pressed for a long time, you can return to the dialog function and select
the same or another function.

\section{Puls width generation}
The Puls Width generator is started, if you select the ''10-Bit PWM'' function by
a long key press.
The frequency output is done with the \(680\Omega\) resistor at measurement port TP2.
The measurement port TP1 is switched to GND.
The frequency of the output signal is always the CPU clock divided by 1024.
This gives a result of \(7812.5Hz\) for the 8 MHz CPU clock.
Only the positive pulse width can be changed by a key press. With a short key press
you can increase the positive puls width up to \(99\%\) in \(1\%\) increments.
With a longer key press you can increase the pulse width in \(10\%\) increments.
The pulse width reaches a value above \(99\%\) 100 is subtract from the result.
The pulse width \(0\%\) generates a very small positive puls width.

