pwm lpc1114

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

pwm lpc1114

3,272件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 03:21:43 MST 2012
Hello.

I need help for control with pwm, led 2 of board.
(led 2 at example blinky)

Thanks
0 件の賞賛
返信
15 返答(返信)

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Sep 05 11:27:19 MST 2012

Quote: andrei.badila
Hy Zero thx for all!
Another problem for which you seek advice is:
I have a dac1 pmode from digilent http://digilentinc.com/Data/Products/PMOD-DA1/Pmod%20DA1_rm.pdf, i want to control this with LPC1114.
It posible?
THX



Yes, AD7303 is working with 3.3V SPI :)
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Sep 05 11:06:16 MST 2012

Quote: andrei.badila
I want to control with diferent PWM, because, i want to control a pwm1 to 75% DutyCicle and PMW2 75% dutycicle:rolleyes::(



A single PWM timer can output different duty cycles  :eek:  It can't change the cycle frequency, but different match registers can generate different duty cycles :)
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 10:53:27 MST 2012
Hy Zero thx for all!
Another problem for which you seek advice is:
I have a dac1 pmode from digilent http://digilentinc.com/Data/Products/PMOD-DA1/Pmod%20DA1_rm.pdf, i want to control this with LPC1114.
It posible?
THX
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 10:39:25 MST 2012
Sorry 75 and 50


Quote: andrei.badila
I want to control with diferent PWM, because, i want to control a pwm1 to 75% DutyCicle and PMW2 75% dutycicle:rolleyes::(

0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 10:32:54 MST 2012
I want to control with diferent PWM, because, i want to control a pwm1 to 75% DutyCicle and PMW2 75% dutycicle:rolleyes::(
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Sep 05 08:40:38 MST 2012

Quote:

..want tu use two pwm to control for example PIOI1_9, PIOI2_0,

:confused::(:confused:

Is there a special reason why you don't add 2 lines and expand this sample to use PIO1_10?
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 07:58:53 MST 2012
Sorry again, i want tu use two pwm to control for example PIOI1_9, PIOI2_0,
"LPC_SYSCON->SYSAHBCLKCTRL |=  (1<<8);             // Enable Clock for TMR1
    LPC_IOCON->PIO1_9 |=  (1<<0);                     // PIN1_9 = CT16B1_MAT0
    LPC_TMR16B1->MR0 = 2200;                          // 50% Duty Cycle
    LPC_TMR16B1->MR3 = 4400;                          // Cycle Length
    LPC_TMR16B1->MCR |= (1<<10);                      // TC Reset on MR3 Match
    LPC_TMR16B1->PWMC |= (1<<0);                      // PWM Mode
    LPC_TMR16B1->TCR |= (1<<0);   " it for oen pwm.
Thanks
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 06:17:18 MST 2012
ok thx very much, is more complicated than I thought
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Sep 05 06:08:18 MST 2012
PIO0_7 is no match output, so you can't use this simple sample :)

To use pins without match output you have to:

#1 Enable and set timer match register & interrupts

#2 Use an interrupt handler

#3 Switch your pin in interrupt handler
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 05:57:15 MST 2012
Sorry zero, i used this example code for port 1.9, and i want to use to led2 at platform as in example blinky "GPIOSetDir( LED_PORT, LED_BIT, 1 );   GPIOSetValue( LED_PORT, LED_BIT, LED_ON );"

int main (void) {
SysTick_Config( SysTick->CALIB + 1 );
LPC_SYSCON->SYSAHBCLKCTRL |=  (1<<8);             // Enable Clock for TMR1
    LPC_IOCON->PIO1_9 |=  (1<<0);                     // PIN1_9 = CT16B1_MAT0
    LPC_TMR16B1->MR0 = 2200;                          // 50% Duty Cycle
    LPC_TMR16B1->MR3 = 4400;                          // Cycle Length
    LPC_TMR16B1->MCR |= (1<<10);                      // TC Reset on MR3 Match
    LPC_TMR16B1->PWMC |= (1<<0);                      // PWM Mode
    LPC_TMR16B1->TCR |= (1<<0);                       // GO
while (1)                                /* Loop forever */
{
int i=0;
for(i=0;i<44;i++)
{
delaySysTick(LED_TOGGLE_TICKS/20);
         LPC_TMR16B1->MR0 = i*100;                          // 50% Duty Cycle
    LPC_TMR16B1->MR3 = 4400;                          // Cycle Length
    LPC_TMR16B1->MCR |= (1<<10);                      // TC Reset on MR3 Match
    LPC_TMR16B1->PWMC |= (1<<0);                      // PWM Mode
    LPC_TMR16B1->TCR |= (1<<0);
}
}
}
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Sep 05 05:27:54 MST 2012

Quote: andrei.badila
I don't fiind in this example what port is use to out pwm, where where the duty cycle is set



:confused:

/* Initialize the PWM in [COLOR=Red]timer32_1 enabling match0 output[/COLOR] */
/* Initialize the PWM in [COLOR=Red]timer16_1 enabling match1 output[/COLOR] */
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 05:06:25 MST 2012
i read section PWM in this book.
I start from this example:"

#include "driver_config.h"
#include "target_config.h"

#include "timer32.h"
#include "timer16.h"
#include "gpio.h"

extern volatile uint32_t timer32_0_counter;

volatile uint32_t period = 1000;  //48Khz PWM frequency


/* Main Program */

int main (void) {
/* Initialize 32-bits timer 0 */
init_timer32(0, TIME_INTERVAL);
enable_timer32(0);

/* Initialize the PWM in timer32_1 enabling match0 output */
init_timer32PWM(1, period, MATCH0);
setMatch_timer32PWM (1, 0, period/4);
enable_timer32(1);

/* Initialize the PWM in timer16_1 enabling match1 output */
init_timer16PWM(1, period, MATCH1, 0);
setMatch_timer16PWM (1, 1, period/8);
enable_timer16(1);

/* Enable AHB clock to the GPIO domain. */
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);

/* Set port 2_0 to output */
GPIOSetDir( 2, 0, 1 );

while (1)                                /* Loop forever */
{
/* I/O configuration and LED setting pending. */
if ( (timer32_0_counter > 0) && (timer32_0_counter <= 50) )
{
GPIOSetValue( 2, 0, 0 );
}
if ( (timer32_0_counter > 50) && (timer32_0_counter <= 100) )
{
GPIOSetValue( 2, 0, 1 );
}
else
while ( timer32_0_counter < 100 ); //wait for
  timer32_0_counter = 0;
}
}"
I don't fiind in this example what port is use to out pwm, where where the duty cycle is set
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Sep 05 04:39:21 MST 2012
Then start reading UM10398: http://www.nxp.com/documents/user_manual/UM10398.pdf
0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andrei.badila on Wed Sep 05 04:30:07 MST 2012
Zero i don't understand this example. I'm novice in cortex. Sorry


Quote: Zero
Then use search thread above :)

..and you'll find a lot of samples like:

http://knowledgebase.nxp.com/showthread.php?t=3011

http://knowledgebase.nxp.com/showthread.php?t=163

0 件の賞賛
返信

3,165件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Sep 05 03:45:00 MST 2012
Then use search thread above :)

..and you'll find a lot of samples like:

http://knowledgebase.nxp.com/showthread.php?t=3011

http://knowledgebase.nxp.com/showthread.php?t=163
0 件の賞賛
返信