cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while updating PWM

luter
Associate II
Posted on October 20, 2005 at 11:13

Problem while updating PWM

4 REPLIES 4
luter
Associate II
Posted on May 17, 2011 at 10:19

Hi, All.

I discovered a very strange behaviour while updating PWM.

Now in details:

Settings: autoswitch, sensor, voltage, 8-bit PWM mode. PWM is generated on odd MCOx channels only.

Problem: while continuously !!!DECREASING!!! MCPUH value PWM disappears on odd MCOx outputs until MCPUH gets stable value. On even MCOx outputs signal is stable. At the same time i have the same PWM on MCPWMW output. It looks always perfect. It means that problem is somewhere in pwm-manager block (and in my brain :) )

One more thing i don't understand.

The same mc settings. Outputs are on, MTC clock is off. MCPUH has value, let's say, 2 times lower than MCP0L (it means 50% duty cycle by edge-aligned mode). I have signal on some odd MCO output where PWM is generated. as far as MTC clock is off, there is logical 1 on this output. What do i do? Just switch MTC clock on. Theoretically on this output PWM should appear immediatelly. But it appears in some hundred millisec. I need PWM without any delay. Any update of MCPUH doesn't bring effect.

P.S.: Writing this post i have got an idea. If all pwm related registers have preload registers, it means they have to be updated everytime PWM update has occured. Am I right?

luter
Associate II
Posted on May 17, 2011 at 10:19

Hi, All.

First problem solved!!! :-] :-] :-]

But how!!!

I just deleted line which updates MCPWH register. Why do I use it? Just for debugging purposes. What kind of influence gives MCPWH? As far as I am using voltage mode, PCN bit is reset, should be no influence of MCPWH on the motor block.

I am totaly confused :-?

I am about investigation second problem i have mentioned in prev post.

luter
Associate II
Posted on May 17, 2011 at 10:19

Second problem solved in this way as well.

Really, I don't understand it. Whatever, I am happy :-] :-] :-]

gaetano
Associate II
Posted on May 17, 2011 at 10:19

Hi Luter,

congratulations!! That's what I call a perfect case: you submit the problem :-[ and YOU solve the problem :-]

By the way, it should be investigated further. I will let you know when I have the solution.

For now, my afternoon is free... ;)

Best regards,

Tanio