Skip to content

083chandan/SpaceVector_PWM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Space Vector PWM generation using Atmega 2560

(Arduino Mega)

Using Timer 1, Timer 3, Timer 4 and Timer 5 in the microcontroller to generate 6 varying PWMs

PWMmicros: PWM period is in Micro Seconds. Uses 256 as prescaler for the counter.

PWMmillis: PWM period is in Milli Seconds. Uses 1 as prescaler for the counter.

Both PWMmicros and PWMmillis generate same waveform with timing change.

Counter calculation:

counter = (frequency * time)/prescaler

Default prescaler values: 1, 8, 64, 256, 1024

Max counter Values

  • 16Bit: 65536
  • 8Bit: 255


Pin No. Waveform no.
PORTB0 (53) S1 (High side)
PORTB1 (52) S3 (High side)
PORTB2 (51) S5 (High side)
PORTB3 (50) S4 (Low side)
PORTB4 (10) S6 (Low side)
PORTB5 (11) S2 (Low side)

img

1553932476551

img

OUTPUT

alt text


REF

About

Space Vector PWM generation using Arduino.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages