Post Go back to editing

timer_with_callback.c Example Question

Hi, I am using the Analog Devices example 'timer_with_callback.c' with IAR and the ADSP-CM408F EZ-Kit.  I want to view the output (of the timer running in PWM mode) on a pin on the PWM probing board.  I see (from a previous post) that I needed to use the Pin Multiplexer code generator, which I did.  I included that file in my project, and added one line of code in the application program 'timer_with_callback.c' program, which reads adi_initpinmux();.  When I run the program I see a signal on Pin 135 (Port B_08) with a period of ~ 10uS, however the amplitude is ~ 50mV.  Why isn't this signal 0 - 3 V?

Also in the include file timer_with_callback.h, how do the parameters TIMER_WIDTH, TIMER_DELAY and TIMER_PERIOD relate to "real world time".  For example, why do I have a 10uS period and how would I change that to a different time?

  • Hi,

    This example demonstrates configuration of GP timer in PWM mode and handling the callback event generated by the timer. After the timer is configured and enabled, the program waits until the timer generates an event which notifies configured Delay + Width expired. Upon receiving the event the program terminates.

    The usage of the TIMER_WIDTH, TIMER_DELAY, and TIMER_PERIOD varies, depending on the mode of the timer specified by the operation mode.Please refer "Period, Width and Delay Register Interaction" in the hardware reference manual

    Also this example uses Continuous PWMOUT operation mode.For detailed information for please refer "Continuous PWMOUT Mode" in the hardware reference manual.
    http://www.analog.com/media/en/dsp-documentation/processor-manuals/ADSP-CM40x-hrm.pdf

    Regards,
    Kader

  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin