40 likes | 513 Views
PWM Pulse Width Modulation API. Achieves PWM by cascading 2 timers… The output of lower order will be fed to input of upper order timer… The output of lower order timer is also used to control the pulse width… The output of higher order timer will decide the period…
E N D
PWMPulse Width Modulation API • Achieves PWM by cascading 2 timers… • The output of lower order will be fed to input of upper order timer… • The output of lower order timer is also used to control the pulse width… • The output of higher order timer will decide the period… • Duty cycle = pulse width/period
Timer/ Counter 2 Pulse width Control PWM1 PWM1 output Timer/ Counter 3 Period Control Pulse width Control Period Control PWM1 output About PWM
API Calls • naPwmOpen • Opens the specified channel and returns the handle • naPwmSetPulseWidth • Sets the pulse width and period in nanoseconds, returns the actual value set • naPwmStart • Enables the PWM channel • naPwmStop • Disables the PWM channel • naPwmClose • Closes the channel and releases the resources