LPC24xx PWM pin state after stopping

Started by Markus Korber December 19, 2011
Hello,

when disabling a single PWM channel via the PWMxPCR register the logical
output level depends on the previous pin state. However, I'd like to
always have a 'low' pin state after disabling a particular PWM channel.
I see two possibilities (none of which I really like):

(1) Set a duty cycle of 0 and keep the PWM running.
(2) Generate an IRQ on match and disable the channel from there.

Is there another way to achive what I want? Thanks.

Regards,
Markus Korber

An Engineer's Guide to the LPC2100 Series

Hello Markus,

perhaps it is a possibility to switch output to GPIO
and set it (previously) to low ?

Best regards,

Martin

--- In l..., Markus Korber wrote:
>
> Hello,
>
> when disabling a single PWM channel via the PWMxPCR register the logical
> output level depends on the previous pin state. However, I'd like to
> always have a 'low' pin state after disabling a particular PWM channel.
> I see two possibilities (none of which I really like):
>
> (1) Set a duty cycle of 0 and keep the PWM running.
> (2) Generate an IRQ on match and disable the channel from there.
>
> Is there another way to achive what I want? Thanks.
>
> Regards,
> Markus Korber
>

You could always set the GPIO output level to zero at startup and simply
swap the mode of the pin to GPIO until you want to use PWM again.

Regards

Phil.

From: l... [mailto:l...] On Behalf Of
Markus Korber
Sent: 19 December 2011 08:17
To: l...
Subject: [lpc2000] LPC24xx PWM pin state after stopping

Hello,

when disabling a single PWM channel via the PWMxPCR register the logical
output level depends on the previous pin state. However, I'd like to
always have a 'low' pin state after disabling a particular PWM channel.
I see two possibilities (none of which I really like):

(1) Set a duty cycle of 0 and keep the PWM running.
(2) Generate an IRQ on match and disable the channel from there.

Is there another way to achive what I want? Thanks.

Regards,
Markus Korber



Thus spake capiman26061973:

> --- In l..., Markus Korber wrote:
>
>> when disabling a single PWM channel via the PWMxPCR register the logical
>> output level depends on the previous pin state. However, I'd like to
>> always have a 'low' pin state after disabling a particular PWM channel.
>> I see two possibilities (none of which I really like):
>
>> (1) Set a duty cycle of 0 and keep the PWM running.
>> (2) Generate an IRQ on match and disable the channel from there.
>
>> Is there another way to achive what I want? Thanks.
>
> perhaps it is a possibility to switch output to GPIO
> and set it (previously) to low ?

Thanks for your suggestion, however, how can I ensure that the last PWM
pulse (before switching to GPIO) isn't truncated or extended (because I
have to stop with a 'normal' PWM pulse)?

Regards,
Markus Korber

Il 19/12/2011 11:39, Markus Korber ha scritto:
>
>
> Thus spake capiman26061973:
>
> > --- In l... ,
> Markus Korber wrote:
> >
> >> when disabling a single PWM channel via the PWMxPCR register the
> logical
> >> output level depends on the previous pin state. However, I'd like to
> >> always have a 'low' pin state after disabling a particular PWM channel.
> >> I see two possibilities (none of which I really like):
> >
> >> (1) Set a duty cycle of 0 and keep the PWM running.
> >> (2) Generate an IRQ on match and disable the channel from there.
> >
> >> Is there another way to achive what I want? Thanks.
> >
> > perhaps it is a possibility to switch output to GPIO
> > and set it (previously) to low ?
>
> Thanks for your suggestion, however, how can I ensure that the last PWM
> pulse (before switching to GPIO) isn't truncated or extended (because I
> have to stop with a 'normal' PWM pulse)?
>
Why do you need to disable a single PWM channel? Can't you simply stop it?
> Regards,
> Markus Korber



Il 19/12/2011 11:39, Markus Korber ha scritto:
>
>
> Thus spake capiman26061973:
>
> > --- In l... ,
> Markus Korber wrote:
> >
> >> when disabling a single PWM channel via the PWMxPCR register the
> logical
> >> output level depends on the previous pin state. However, I'd like to
> >> always have a 'low' pin state after disabling a particular PWM channel.
> >> I see two possibilities (none of which I really like):
> >
> >> (1) Set a duty cycle of 0 and keep the PWM running.
> >> (2) Generate an IRQ on match and disable the channel from there.
> >
> >> Is there another way to achive what I want? Thanks.
> >
> > perhaps it is a possibility to switch output to GPIO
> > and set it (previously) to low ?
>
> Thanks for your suggestion, however, how can I ensure that the last PWM
> pulse (before switching to GPIO) isn't truncated or extended (because I
> have to stop with a 'normal' PWM pulse)?
>
I missed a question: are you using a PWM module or a timer module
implementing pwm?
> Regards,
> Markus Korber



Hi,
I have got the Olimex LPC2000 ARM board, Wiggler HARDWARE and Lynch's article on this board. He advises to download OCDRemote V2.14 which downoads hwSupport-2.14.exe. I could find it anywhere except version hw_support_9.5.exe, can I use this for JTAG debugging with this board? Please let me know or if you have hwSupport-2.14.exe. could you send me?.

 
Best Wishes!
Noman
________________________________
From: M. Manca
To: l...
Sent: Monday, December 19, 2011 8:46:36 AM
Subject: Re: [lpc2000] Re: LPC24xx PWM pin state after stopping


 
Il 19/12/2011 11:39, Markus Korber ha scritto:
>
>
> Thus spake capiman26061973:
>
> > --- In l... ,
> Markus Korber wrote:
> >
> >> when disabling a single PWM channel via the PWMxPCR register the
> logical
> >> output level depends on the previous pin state. However, I'd like to
> >> always have a 'low' pin state after disabling a particular PWM channel.
> >> I see two possibilities (none of which I really like):
> >
> >> (1) Set a duty cycle of 0 and keep the PWM running.
> >> (2) Generate an IRQ on match and disable the channel from there.
> >
> >> Is there another way to achive what I want? Thanks.
> >
> > perhaps it is a possibility to switch output to GPIO
> > and set it (previously) to low ?
>
> Thanks for your suggestion, however, how can I ensure that the last PWM
> pulse (before switching to GPIO) isn't truncated or extended (because I
> have to stop with a 'normal' PWM pulse)?
>
I missed a question: are you using a PWM module or a timer module
implementing pwm?
> Regards,
> Markus Korber
>
>






Hi,
sorry I had the wrong Re: in my previous letter.

I have got an Olimex LPC2000 ARM board and Wiggler Hardware. Lynch's
article on this board advises to download OCDRemote V2.14 which
actually downloads hwSupport-2.14.exe. I could not find it anywhere apart from the version
hw_support_9.5.exe, can I use this for JTAG debugging with this board?
Please let me know or if you have

hwSupport-2.14.exe. could you send
me?.


Best Wishes!
Noman
________________________________








Thus spake M. Manca:

> Il 19/12/2011 11:39, Markus Korber ha scritto:
>
>> Thus spake capiman26061973:
>
>>> --- In l... ,
>> Markus Korber wrote:
>
>>>> when disabling a single PWM channel via the PWMxPCR register the
>>>> logical output level depends on the previous pin state. However,
>>>> I'd like to always have a 'low' pin state after disabling a
>>>> particular PWM channel. I see two possibilities (none of which I
>>>> really like):
>
> [...]
> I missed a question: are you using a PWM module or a timer module
> implementing pwm?

The PWM module.

Regards,
Markus Korber

Thus spake M. Manca:

> Il 19/12/2011 11:39, Markus Korber ha scritto:
>
>> Thus spake capiman26061973:
>
>>> --- In l... ,
>> Markus Korber wrote:
>
>>>> when disabling a single PWM channel via the PWMxPCR register the
>>>> logical output level depends on the previous pin state. However,
>>>> I'd like to always have a 'low' pin state after disabling a
>>>> particular PWM channel. I see two possibilities (none of which I
>>>> really like):
>>>>
>>>> (1) Set a duty cycle of 0 and keep the PWM running.
>>>> (2) Generate an IRQ on match and disable the channel from there.
>>>>
>>>> Is there another way to achive what I want? Thanks.
>>>
>>> perhaps it is a possibility to switch output to GPIO
>>> and set it (previously) to low ?
>>
>> Thanks for your suggestion, however, how can I ensure that the last PWM
>> pulse (before switching to GPIO) isn't truncated or extended (because I
>> have to stop with a 'normal' PWM pulse)?
>
> Why do you need to disable a single PWM channel?

Because other channels should continue to run and I want to selectively
enable or disable specific channels.

> Can't you simply stop it?

No, since stopping (i.e., stop on match) disables all PWM outputs.
However, nevermind, I've already implemented (2) from above.

Regards,
Markus Korber