ADuC7128 adc w/ pwm conversion type, issues!?

I would like to inquire about how to calculate the pwm1len and pwm1com[3:1] mmr registers. I am implementing an adc with a pwm conversion type and would like to sample input frequencies that range from 1khz to 960khz. The adc is set to sample at 1MSPS in the differential conversion mode. I have set pwmcon1 = 0x01 which enables all pwm outputs and sets pwm prescaler to 2 clocks and I have set pwmcon2 = 0x80 which uses 4 clock pulses for convert start delay and enables the pwm to generate convert start signal.

from past experience I derived the following formula to calculate pwm1len---->   

               pwm freq. =   UClk   /    [  (pwm1len +1) * (delay clock pulses * prescaler clocks) ]..... where pwm1len is a 16bit mmr register.

Thanks in advance, for any helpful suggestions / answers.

  • 0
    •  Analog Employees 
    on May 1, 2013 6:55 PM

    PWM1LEN can be calculated using the following formula:

    PWM period is tUCLK * (PWMxLEN+1)*PWMCP0

    tUCLK is 41.78MHz from the PLL.

    PWMxLEN and PWMCP0 (PWM prescaler) are programmable.

    PWM1COM1/2/3 registers don’t affect the ADC conversion start signal. PWM1LEN configures the rising edge of the low side (figure 49) which triggers the ADC conversion after a programmable delay configured in PWMCON2, as shown in figure 50 of the datasheet.