pwm_hardware

Hardware PWM control

Author Sebastien Lelong, Copyright © 2008-2009, all rights reserved.
Adapted-by Albert Faber, Rob Hamerling.
Compiler 2.4l

Description

Include this library if you want to use the PWM feature of the CCP module(s).
This library uses conditional compile to selectively include underlying PWM
libraries and number of PWM channels, according to the target PIC configuration.
Ex: - 16f88 has 1 PWM channel: including pwm_hardware will prepare PWM
      for 1 channel (using pwm_ccp1.jal)
    - 16f877 has 2 PWM channels: including pwm_hardware will prepare PWM
      for 2 channels (using pwm_ccp1.jal and pwm_ccp2.jal)
    - etc. for PICs with more CCP or PWM modules
Note: pin_CCPx_directions or pin_PWMx_directions must be set to output
      by the application.
.
With using the PWM hardware a design choice must be made between desired
PWM frequency and desired PWM resolution (number of possible PWM steps).
Choosing maximum PWM resolution implies a relative low PWM frequency and
vice versa: a high frequency limits the number of available PWM steps.
The figures are dependent on the target clock speed.
Refer to pwm_common, pwm_ccp1, pwm_ccp2 ... etc. documentation to
understand how to use these PWM libraries.


Notes

1. Because the PWM libraries use conditional compilation and the 'alias'
   keyword, at least JalV2 compiler version 2.4l is required.
2. These libraries use the pin alias names as declared in Jallib device
   files since revision 1171, so Jallib release 0.4 is a minimum requirement.
3. Some PICs have extended CCP modules.  These will be handled by these
   PWM libraries as 'classic' CCP modules.
4. Some of the newer PICs have PWM module(s) but no CCP module(s) and
   the naming convention of registers and pins differs from the older
   PICs. These PICS are supported as well, with same procedure names as
   PICs with CCP modules.


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

12f68312f683_pwm_adc.jal
12f68312f683_pwm_led_highres.jal
12f68312f683_pwm_led.jal
12f68312f683_pwm_sound.jal
12hv61512hv615_temperature_fan.jal
16f648a16f648a_pwm_led.jal
16f648a16f648a_pwm_led_highres.jal
16f648a16f648a_ir_ranger_gp2d02.jal
16f648a16f648a_pwm_sound.jal
16f72316f723_pwm_led.jal
16f72316f723_pwm_sound.jal
16f72316f723_ir_ranger_gp2d02.jal
16f72316f723_pwm_led_highres.jal
16f7316f73_pwm_led.jal
16f7316f73_pwm_led_highres.jal
16f7316f73_pwm2.jal
16f7316f73_pwm_sound.jal
16f76716f767_pwm_adc.jal
16f87716f877_servo_rc_slave.jal
16f87716f877_pwm_sound.jal
16f87716f877_pwm2.jal
16f87716f877_pwm_led.jal
16f87716f877_pwm_led_highres.jal
16f877a16f877a_pwm_led_highres.jal
16f877a16f877a_servo_rc_slave.jal
16f877a16f877a_pwm_led.jal
16f877a16f877a_pwm_sound.jal
16f877a16f877a_pwm2.jal
16f8816f88_pwm_sound.jal
16f8816f88_pwm_led_highres.jal
16f8816f88_pwm_led.jal
16f88616f886_pwm_adc_res.jal
16f88616f886_pwm_adc_freq.jal
18f14k5018f14k50_pwm_led.jal
18f14k5018f14k50_pwm_sound.jal
18f14k5018f14k50_pwm_led_highres.jal
18f245018f2450_pwm_sound.jal
18f245018f2450_pwm_led_highres.jal
18f245018f2450_pwm_led.jal
18f245018f2450_ir_ranger_gp2d02.jal
18f252018f2520_pwm_sound.jal
18f252018f2520_pwm_led_highres.jal
18f252018f2520_ir_ranger_gp2d02.jal
18f252018f2520_pwm_led.jal
18f255018f2550_pwm_led.jal
18f255018f2550_pwm_led_highres.jal
18f255018f2550_ir_ranger_gp2d02.jal
18f255018f2550_pwm_sound.jal
18f262018f2620_pwm_led.jal
18f262018f2620_ir_ranger_gp2d02.jal
18f262018f2620_pwm_sound.jal
18f262018f2620_pwm_led_highres.jal
18f45218f452_pwm_sound.jal
18f45218f452_ir_ranger_gp2d02.jal
18f45218f452_servo_rc_slave.jal
18f45218f452_pwm_led_highres.jal
18f45218f452_pwm_led.jal
18f452518f4525_servo_rc_slave.jal
18f455018f4550_servo_rc_slave.jal
18f455018f4550_pwm_sound.jal
18f455018f4550_ir_ranger_gp2d02.jal
18f455018f4550_pwm_led_highres.jal
18f455018f4550_pwm_led.jal
18f462018f4620_pwm_sound.jal
18f462018f4620_servo_rc_slave.jal
18f462018f4620_pwm_led_highres.jal
18f462018f4620_ir_ranger_gp2d02.jal
18f462018f4620_pwm_led.jal