Page 1 of 1

Dual DAC problem

Posted: Tue Mar 17, 2015 1:02 pm
by RichAdili1
My app has been successfully using DAC0 as well as PWM_A3 and PWM_B3 as independent channels. The DAC as well as the two PWMs are each configured for trivial use, i.e. I simply write new pulse widths or a DAC value as needed. Attempting to add DAC1 causes PWM_B3 to reload erratically. Obviously I'm missing something but cannot find the cause. Where is the connection between power-up of DAC1 and reload of PWM_B3?

Re: Dual DAC problem

Posted: Tue Mar 17, 2015 3:36 pm
by dciliske
Any chance you're using the ADCs on the second submodule to trigger a PWM reload?

Re: Dual DAC problem

Posted: Tue Mar 17, 2015 11:43 pm
by RichAdili1
No, not using ADC triggers. My PWM code was copied from the MOD54415-PWM example code EdgeAlignedPWM() function, which contains the line:
sim1.mcpwm.sm[submod].val[0] = reset/2; //Median 0

The MCF54415 reference manual is not terribly clear regarding this register. However, commenting out this line appears to solve the problem. Is this a bug in the example code?