wave generation normal and CTC modes in AVR Atmega32
The AVR ATmega32 microcontroller has several modes for generating PWM (Pulse Width Modulation) signals, which are useful for wave generation. Two common modes for PWM generation are "Normal" mode and "Clear Timer on Compare Match" (CTC) mode. Below is an overview of both modes in the context of the ATmega32:

### 1. Normal Mode

In Normal mode, the Timer/Counter counts from 0 to 255 (for an 8-bit timer) or from 0 to 65535 (for a 16-bit timer) and then rolls over back to 0. The output compare registers are not used to modify the behavior of the timer in this mode. 

- **Use Case**: Normal mode is typically used for simple timing applications or to generate a waveform with a fixed frequency. However, it does not provide PWM capabilities directly. 

- **Registers**: 
  - `TCCR0` (Timer/Counter Control Register for Timer 0)
  - `TCNT0` (Timer/Counter Register for Timer 0)
  - `OCR0` (Output Compare Register for Timer 0)

- **Example Configuration**:
  ```c
  TCCR0 = (1 << CS00); // No prescaler, starts the timer
  while (1) {
      // Main loop
  }
  ```

### 2. CTC (Clear Timer on Compare Match) Mode

In CTC mode
 In AVR Atmega32 microcontroller, there are two modes of waveform generation for timers/counters: Normal Mode and Clear Timer on Compare (CTC) Mode.

Normal Mode:
In Normal Mode, the timer/counter increments on every clock cycle until it reaches its maximum value (0xFF for 8-bit timers, 0xFFFF for 16-bit timers). Once the maximum value is reached, it rolls over to zero and starts counting again from there. In this mode, the waveform generated is a simple up-counting waveform. To generate a square wave, an external interrupt can be used to toggle an output pin on overflow.

CTC Mode:
In CTC Mode, the timer/counter is configured to generate an interrupt or reset the counter value when it matches a specified value in the Output Compare Register (OCR). This allows for the generation of custom waveforms with specific duty cycles and frequencies. When the timer/counter matches the value in the OCR, an output pin is toggled, and the timer/counter starts counting again from zero. This mode is useful for generating PWM signals, frequency division, and time-delay generation.

To configure the timer/counter for Normal or CTC mode, the Waveform Generation mode bits (WGM) in the Timer/Counter Control Register (TCCR) must be set appropri