HWPWM
 
Syntax


void HWPWM (int cycletime,int itemCnt, int *hightimeList );

Description

 

ARMmite and Wireless ARMmite version

The ARMmite supports up to 8 channels of hardware driven PWM.  The IO direction of the pin will be set to output.  Once programmed these will continue to generate the specified PWM until re-programmed or reset.

Cycletime is in microseconds, is the time for a single PWM cycle. Hightimes are also in microseconds and represent the amount of time during the cycle that the corresponding outputs are high. It is assumed, but not enforced that cycletimes for all channels will be the same.

 channel1  IO(0)          
 channel2  IO(1)
 channel3  IO(2)
 channel4  IO(3)
 channel5  IO(4)
 channel6  IO(9)
 channel7  IO(10)
 channel8

 IO(11)


 
ARMmite PRO version

The ARMmite PRO also supports up to 8 channels of hardware driven PWM.  The IO direction of the pin will be set to output.  Once programmed these will continue to generate the specified PWM until re-programmed or reset.

Cycletime is in microseconds, is the time for a single PWM cycle. Hightimes are also in microseconds and represent the amount of time during the cycle that the corresponding outputs are high. It is assumed, but not enforced that cycletimes for all channels will be the same.

 channel1  IO(0)          
 channel2  IO(1)
 channel3  IO(8)
 channel4  IO(5)
 channel5  IO(14)
 channel6  IO(10)
 channel7  IO(11)
 channel8

 IO(3)



ARMexpress LITE version

The ARMexpress LITE supports up to 6 channels of hardware driven PWM.  The IO direction of the pin will be set to output.  Once programmed these will continue to generate the specified PWM until re-programmed or reset.  2 of the channels are not available on the pins.

Cycletime is in microseconds, is the time for a single PWM cycle. Hightimes are also in microseconds and represent the amount of time during the cycle that the corresponding outputs are high.  It is assumed, but not enforced that cycletimes for all channels will be the same.

 channel1  IO( 5 )
 channel2  IO( 6 )
 channel3  IO( 3 )
 channel4  not available
 channel5  IO( 14 )
 channel6  not available
 channel7  IO( 13 )
 channel8

 IO( 15 )


Example

times[0] = -1
times[1] = 750
times[2] = 100
HWPWM (1000, 3, times)       'generate 1KHz 75% and 10% signals on pins 1,2

times[0] = 2000
times[1] = 1000
times[2] = 500
HWPWM (4000, 3, times)       'gen 250 Hz 50%, 25% and 12.5% signals on pins 0,1,2



 
See also