Project Block Diagram:
Project Hardware:
The hardware consists of the following components;
There are six Potentiometers connected to the Analog Inputs of the STM32
microcontroller. The Potentiometers can vary the analog input voltage between Zero and
Vref.
A switch connected to the Digital (or Analog) Input pin. The switch can change the
voltage from Zero to Vcc (or from Vcc to Zero) when pressed.
An LCD screen is connected to the microcontroller that can display the text sent to it.
Four PWM pins. PWM_1 and PWM_2 are complementary with a deadtime of 200 nSec.
PWM_3 and PWM_4 are complementary with a deadtime of 200 nSec. In this project,
the phase difference between the two PWM signals is Zero, so PWM_1 and PWM_3 are
exactly the same. Similarly, PWM_2 and PWM_4 are the same.
Project Specifications:
There are two modes in which the Microcontroller will operate.
a) Setting Mode
b) Output Mode
In the setting mode, the maximum and minimum values for the Frequency and Duty-Cycle are
set. The values of current output frequency and current output Duty-Cycle is set too. The Output,
however, is disabled in this mode. The LCD displays the current values of Max Frequency, Min
Frequency, Max Duty, Min Duty-Cycle, PWM Frequency and PWM Duty-Cycle.
In the output mode, the output is enabled. The PWM pins will output the PWM signals based on
the setting saved during the Setting Mode. The maximum and minimum values of the Frequency
and the Duty-Cycle cannot be changed. The values of current output frequency and current
output Duty-Cycle can be varied using the Freq_Output and Duty_Output inputs. The LCD
displays the Frequency and the Duty-Cycle of PWM signals.
Operation:
Setting Mode:
1) First the system is run in Setting Mode.
2) Using Freq_Min_Setting select Minimum Set Frequency (say 20 kHz).
3) Using Freq_Max_Setting select Maximum Set Frequency (say 100 kHz).
4) Using Freq_Output select current Frequency (say 40 kHz).
Note: After selecting the Maximum and Minimum Frequency, the Freq_Output potentiometer
must choose values between these two limits. For example, in this case, the Zero voltage from
the Freq_Output potentiometer should correspond to Minimum Frequency (20 kHz) and Vref
should correspond to Maximum Frequency (100 kHz).
5) Using Duty_Min_Setting select Minimum Set Duty-Cycle (10%).
6) Using Duty_Max_Setting select Maximum Set Duty-Cyle (90%).
7) Using Duty_Output select current Frequency (say 40%).
Note: After selecting the Maximum and Minimum Duty, the Duty_Output potentiometer must
choose values between these two limits. For example, in this case, the Zero voltage from the
Duty_Output potentiometer should correspond to Minimum Duty-Cycle (10%) and Vref should
correspond to Maximum Duty-Cycle (90%).
8) LCD must display Minimum and Maximum Frequency and Duty-Cycle. It should also
display set Frequency and Duty.
Output Mode:
1) Now change the mode to Output Mode.
2) The PWM signals must appear on the PWM pins.
3) Using Freq_Output, the select current Frequency can be varied between the Minimum
and Maximum Frequency.
4) Using Duty_Output, the select current Duty-Cycle can be varied between the Minimum
and Maximum Duty-Cycle.
5) LCD must display Minimum and Maximum Frequency and Duty-Cycle. It should also
display set Frequency and Duty.
Note: In Output Mode, the Minimum and Maximum Frequency and Duty must not change even
if the corresponding potentiometers are varied. Only the current Frequency and Duty-Cycle
must vary when the corresponding potentiometers are varied.
*******************************