Skip to content

Releases: Quanoom/Software_PWM_Generator

Software PWM Generator v1.0.0

08 Mar 17:48
ec068ec
Compare
Choose a tag to compare

This release introduces a software-based PWM generator for the PIC18F452 microcontroller. It allows dynamic switching between different duty cycles using an external interrupt and Timer0 for precise control. The software approach makes it useful when hardware PWM modules are unavailable or insufficient.

Features :
✅ Generates PWM signals with 5%, 25%, 50%, 75%, and 90% duty cycles.
✅ Uses Timer0 for accurate timing control.
✅ Supports dynamic duty cycle switching using an external button (INT0 interrupt).
✅ Ensures smooth transitions by updating the duty cycle after the current period ends.
✅ Fully configurable PWM period by adjusting T0CON (prescaler) and MAX_HIGH_LOW.

How It Works :
Pressing the button triggers an external interrupt (INT0).
Each press cycles through predefined duty cycles.
Timer0 controls the high and low states to generate the PWM signal.
The duty cycle update occurs at the end of the current period to avoid glitches.

Changes in This Release :
🔹 Initial release with full software PWM implementation.
🔹 Supports five duty cycle options.
🔹 Software-based interrupt triggering for easy testing.