Hardware PWMs


Functions

void InitPWM (int duty, int pwm, unsigned long freq)
void PWMstart (taskdata pwm)
void PWMstop (int pwm)

Detailed Description

This module contains functions for controlling the hardware PWMs of the IPAC. These functions are used to implement the internal DtoA's of the IPAC. Although the hardware PWMs are capable of running at higher speeds than the software ICTs they have the disadvandage of being codependant on one another. That is, altering the settings of one hardware PWM may alter the settings of another, already set PWM. If high frequency PWMs are truly needed then it would probably be more practical to control them directly from the registers, so you have a better idea of whats going on.

Function Documentation

void InitPWM int  duty,
int  pwm,
unsigned long  freq
 

Initialize a hardware pwm and configure it to a certain frequency and duty cycle This does not start the PWM, merely configures it.

Parameters:
duty the duty cycle 0-100
pwm the pwm to change (PORTP0-7) 6 and 7 are used for DtoA's
freq the pwms frequency

void PWMstart taskdata  pwm  ) 
 

start a configured PWM

Parameters:
pwm the pwm to start
See also:
InitPWM

void PWMstop int  pwm  ) 
 

stop a running hardware PWM

Parameters:
pwm the pwm to stop


Generated on Fri Mar 3 17:25:46 2006 for EMAC-HCS12-SDK by  doxygen 1.4.6