CCS News

Get Caught Red-handed and Use the New Capture/Compare and PWM Libraries!

Wednesday 24 October, 2012

CCS has added new #use capture() and #use pwm() libraries that makes it easier to use the PIC® MCU capture/compare/PWM, input capture and output capture peripherals. There are sometimes challenges in using these peripherals when designing the PWM to operate at a desired frequency and resolution, or configuring the capture peripheral to measure events at a known time duration. Another challenge is that the configuration is generally only valid for certain PIC families and one oscillator speed; changing the PIC® or the oscillator would mean reviewing and updating the way those peripherals are configured.

CCS’s new #use capture() and #use pwm() libraries solve these problems by making it easy to use these peripherals and making the code portable to different PIC® MCUs and oscillator speeds.


  • #use capture() is when the input capture peripheral samples and holds a timer value when the peripheral’s input pin reaches the desired level. This peripheral is useful for measuring the time duration between two events.

  • #use pwm() is for Pulse-width modulation (PWM), the method of pulsing a digital signal on/off to represent an analog signal. A PWM’s two properties are its frequency and duty cycle. A duty cycle is the ratio the digital signal is on versus off.


See examples of these libraries with further details by clicking through to: Version 5

Additional configurations and control options will also be available in Version 5. Feel free to contact us with any comments or questions about the serial library upgrades.....(support@ccsinfo.com)
Want to be a beta tester* for Version 5.... or make suggestions on what you would like to see in Version 5....click thru to the above link!

*All customers with active maintenance are eligible to apply for V.5 betas.
All customers with active maintenance when V.5 is released will receive V.5 at no additional cost.

Resources
To learn more about CCS's C Compiler, visit: Our Compiler Page

To see more helpful hints and tips, visit: Our FAQ Page or Our Customer Forum


Follow us on Facebook and Twitter