LPC11C24 PWM problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC11C24 PWM problem

1,169件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Tue Jan 31 07:55:57 MST 2012
Hi

I'm having a problem getting the PWM to work on PIO0_11 on the LPC11C24 controller. The PIO0_11 is on CT32B0 MAT3, if I choose MAT2 it works, but not on MAT3. I think my problem is that the PIO0_11 is also the JTAG_TDI. Does anyone know what to do to make MAT3 work?

Best regards
Casper
0 件の賞賛
返信
6 返答(返信)

1,096件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Wed Feb 01 03:19:21 MST 2012

Quote: Zero
Do you understand how PWM is working?

Your init is setting MR3 as reset :eek:

LPC_TMR32B1->MR3 = timer32_1_period;
LPC_TMR32B1->MCR = 1<<10;                /* Reset on MR3 */
If you want to use MR3 as PWM you have to use another match register to reset PWM :eek:



I trusted the driver too much, the driver it programmed to always reset on MR3, I've made it work with some adjustments

Thanks to you all!
0 件の賞賛
返信

1,096件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Feb 01 01:33:45 MST 2012
Do you understand how PWM is working?

Your init is setting MR3 as reset :eek:

LPC_TMR32B1->MR3 = timer32_1_period;
LPC_TMR32B1->MCR = 1<<10;                /* Reset on MR3 */
If you want to use MR3 as PWM you have to use another match register to reset PWM :eek:
0 件の賞賛
返信

1,096件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Wed Feb 01 00:57:43 MST 2012
This works:

init_timer32PWM( 0, 480000, 0x04 );
setMatch_timer32PWM( 0, 2, 240000 );
enable_timer32( 0 );


This don't:

init_timer32PWM( 0, 480000, 0x08 );
setMatch_timer32PWM( 0, 3, 240000 );
enable_timer32( 0 );



Quote: RodColeman
Casper, I think that some of the driver (HAL Layer) files will refuse to configure the IOCON for IO or Timer function, unless JTAG functionality has been un-DEFINEd somewhere.

As a quick test, (if you do not use JTAG)  you could repeat the LPC_IOCON->PIO0_11 = statement in your timer initialisation function, and see if it works like that.



After my initialization of the PWM, the register for LPC_IOCON->PIO0_11 is this:

FUNC   3
MODE   2
HYS    0
ADMODE 1
0 件の賞賛
返信

1,096件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by stalisman on Tue Jan 31 11:30:16 MST 2012
You generally set the width up om MAT3 and the cycle on MAT0,1 or 2.  Is that what you are trying to do?
0 件の賞賛
返信

1,096件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jan 31 08:43:39 MST 2012

Quote: CasperH
Does anyone know what to do to make MAT3 work?



There's nothing special about this pin if you use SWD. So a valid PWM setting is working :eek:
0 件の賞賛
返信

1,096件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by RodColeman on Tue Jan 31 08:30:26 MST 2012

Quote: CasperH
Hi

I'm having a problem getting the PWM to work on PIO0_11 on the LPC11C24 controller. The PIO0_11 is on CT32B0 MAT3, if I choose MAT2 it works, but not on MAT3. I think my problem is that the PIO0_11 is also the JTAG_TDI. Does anyone know what to do to make MAT3 work?

Best regards
Casper



Casper, I think that some of the driver (HAL Layer) files will refuse to configure the IOCON for IO or Timer function, unless JTAG functionality has been un-DEFINEd somewhere.

As a quick test, (if you do not use JTAG)  you could repeat the LPC_IOCON->PIO0_11 = statement in your timer initialisation function, and see if it works like that.
0 件の賞賛
返信