Rancang Bangun Generator PWM Berbasis Mikrokontroler AVR ATmega

  • Firdaus firdaus politeknik negeri padang
  • Rivanol Chadri Politeknik Negeri Padang
  • Nasrullah Nasrullah Politeknik Negeri Padang
Keywords: PWM, microcontroller, AVR, timer, counter


PWM is widely used in the fields of automatic control, power electronics and cellular communications. Previous research designed a PWM generator using the OMAP-L138 chip to produce a simple, high-precision, flexible and portable circuit. Another generator uses a single board computer FEZ Panda III and an Arduino board for power inverters. While the FPGA Spartan 3 is also used to generate PWM signals that can vary the duty cycle. In this paper, the PWM signal generator is made using the AVR ATmega8535 microcontroller where the frequency parameters and the output signal duty cycle can be adjusted via the keypad. The signal is tested using a measuring instrument for its accuracy. The ATmega AVR microcontroller family has a timer / counter with one of its operating modes, namely fast PWM. In order to change the frequency and duty cycle as desired, the ICR register is used to store the TOP value and the OCR register for the MAX value. The OCR value determine the duty cycle and the ICR value specify the frequency. The results are the higher the PWM frequency, the greater the value of the measured and desired frequency difference, this is because the large frequency makes ICR register value becomes small even though the frequency divider at minimum value. The difference between measurements and calculations on the Duty Cycle gives the result under 1%. This difference also occurs due to the rounding of the ICR and OCR values, but at a frequency of 20 kHz and a 25% Duty Cycle where the ICR value is 599 and OCR is 116 resulting in the minimum difference in frequency and Duty Cycle. From the experiments that have been carried out, the design of the PWM generator based on the AVR ATmega microcontroller has been successfully realized



Download data is not yet available.


[1] L. C.-H. 5. Lin Bor-Ren, “Analysis, design and implementation of an interleaved three-level PWM DC/DC ZVS converter,” Int. J. Electron., vol. 2, p. 103, 2016.
[2] S. Bhattacharya, P. Deb, S. K. Biswas, and S. Karchowdhury, “Performance and design of an open-delta connected grid tied bidirectional PWM converter,” Int. J. Electr. Power Energy Syst., vol. 78, no. 78, pp. 183–193, 2016, doi: 10.1016/j.ijepes.2015.11.079.
[3] W. C. 7. ZHA Guo-xiang, MA Yong, “Design of PWM generator based on FPGA,” vol. 8, no. 48, p. 135, 2016.
[4] Z. Q. 8. WU Cai-yuan, ZHOU Hua, “Design of Multichannel PWM to DAC Module Based on Dual Communication,” Mech. Electr. Eng. Technol., vol. 6, no. 46, p. 7, 2017.
[5] X. Zhang, T. Qu, D. Yin, and Y. Liu, “Design and Implementation of PWM Generator Based on OMAP-L138,” IOP Conf. Ser. Mater. Sci. Eng., vol. 381, no. 1, 2018, doi: 10.1088/1757-899X/381/1/012137.
[6] S. Rao, S. R. Mn, S. N. Syed, and S. K. Tummala, “Gate driver circuit design, PWM signal generation using FEZ Panda III and Arduino for inverter,” E3S Web Conf., vol. 87, no. 201 9, 2019, doi: 10.1051/e3sconf/20198701003.
[7] S. Suneeta, R. Srinivasan, and R. sagar, “Generation of Variable Duty Cycle PWM using FPGA,” IOSR J. VLSI Signal Process., vol. 4, no. 6, pp. 01–03, 2014, doi: 10.9790/4200-04620103.
[8] C. Hung, W. Liu, H. Su, J. Chen, and B. Chiu, “PIC-Based Multi-Channel PWM Signal Generation Method and Application to Motion Control of Six Feet Robot Toy,” Int. J. Circuits, Syst. Signal Process., vol. 3, no. 2, pp. 73–81, 2009.
[9] Atmel Corporation, “ATmega8535 8-bit Microcontroller with 8K Bytes In-System Programmable Flash,” Datasheet. p. 87, 2003.
How to Cite
firdaus, F., Chadri, R., & Nasrullah, N. (2020, December 2). Rancang Bangun Generator PWM Berbasis Mikrokontroler AVR ATmega. Elektron : Jurnal Ilmiah, 61-66. https://doi.org/https://doi.org/10.30630/eji.12.2.171