PWM Interrupt on match

Started by ajellisuk in LPC20009 years ago
PWM

Hi I have an application where I'm controlling a motor with one of the PWM channels (PWM 5). This works fine, I can control the speed...

Hi I have an application where I'm controlling a motor with one of the PWM channels (PWM 5). This works fine, I can control the speed without any problems. I also want the PWM to generate an interrupt on match, for timeing purposes. However I cannot get it to work properly. If I write a vlaue to the PWM register to start the motor it runs fine but I get no interrupts. If I wrtie a ...


LPC2368: PWM1PR (prescale), PWM does not work if > 2

Started by Sergio Sider in LPC200010 years ago 1 reply
PWM

Hi All, I am working with a LPC2368 (I suppose from rev.B). I was trying to vary the PWM frequency changing the prescaler register....

Hi All, I am working with a LPC2368 (I suppose from rev.B). I was trying to vary the PWM frequency changing the prescaler register. (PLL=240MHz, cpu=60MHz, peripheral clock = 60MHz (1:1), PWM set to top = 0x100. Using the same configuration for the other registers in every run: PWMPR1=0 ; pwm works , frequency (f) PWMPR1=1 ; pwm works , frequency = f /2 , ok PWMPR1=2 ; pwm works, fre...


LPC2129 PWM Modified rate not working properly

Started by "ana...@yahoo.com [lpc2000]" in LPC20003 years ago 6 replies

Hi all I am working on single edge PWM generation on LPC 2129 .The summary o my work is as below 1)I am able to see PWM output on Pin 33(PWM...

Hi all I am working on single edge PWM generation on LPC 2129 .The summary o my work is as below 1)I am able to see PWM output on Pin 33(PWM 4).it is as per my clock settings.No problem still here. 2)In the PWM ISR,I am setting 2 flags and in the main loop of the code ,and based on these flag values I am dynamically changing PWM4 rate by changing PWMMR0 ;PWMMR4 PWMLER registers. 3)These above ...


lpc24xx PWM capture timer readout problem

Started by sneh...@gmail.com in LPC20003 years ago 4 replies

Hello everyone. I am a newbie in lpc devices. I have been trying to interface the PWM based max6672 sensor with the PWM capture pin. I want to...

Hello everyone. I am a newbie in lpc devices. I have been trying to interface the PWM based max6672 sensor with the PWM capture pin. I want to read the both the low time and high time of the PWM pulse. I am recieving an interrupt when the PWm input is received. But some how I am not able to calculate the rise and fall time correctly. I need this info to calculate the temperature of the sensor. ...


PWM revisited on 2103

Started by jaydavis95 in LPC20007 years ago 3 replies

I'm having a heckuva time getting a grip on PWM (I have reviewed all the related posts and other websites). I am able to get the PWM to work,...

I'm having a heckuva time getting a grip on PWM (I have reviewed all the related posts and other websites). I am able to get the PWM to work, but ONLY on the ports shown in the code below. (PO_13 P0_0 P0_8 P0_5) but the motors do not respond at all on any other port (for example P0_7 at the end of the code.) Any help appreciated. thanks, Jay // // PWM seems to only work c...


PWM: how do I get the PWM line to go low when I stop ?

Started by armdeveloper in LPC200010 years ago 1 reply
PWM

I'm doing some DC motor control and using PWM to control the motor speed. I only need to run the motor for 5 seconds at a time. My PWM code...

I'm doing some DC motor control and using PWM to control the motor speed. I only need to run the motor for 5 seconds at a time. My PWM code works fine the first time I run it. The second time I run it the PWM line goes high when I am done. I've tried everything I can see in the PWM settings to have the line end low and I can't get it to. What am I missing ? Thanks


LPC2103 no shadow register for the PWM

Started by gaetanbarthelemy in LPC200011 years ago 1 reply

I have started working with a LPC2103 to control a Brushless motor. I just remarked that this microcontroller doesn't use the shadow latch...

I have started working with a LPC2103 to control a Brushless motor. I just remarked that this microcontroller doesn't use the shadow latch mechanism which allows the new PWM values to take effect only at the beginning of a new cycle. I am thinking to generated a fast interrupt every time TC matches MRx.3 (the one fixing the PWM period). The interrupt routine will then update the PWM va...


How to use PWM on LPC2119?

Started by swee...@hotmail.com in LPC20009 years ago 9 replies

I want to know how to use PWM. I use Keil and LPC2119. Please give me some example code. and told me how to set Frequency, duty ratio and...

I want to know how to use PWM. I use Keil and LPC2119. Please give me some example code. and told me how to set Frequency, duty ratio and anything that important to know when use PWM. I'd read in datasheet and try by myself for a month but it's still don't work. Please help me. Thank for advance.


pwm on timer 1

Started by alvingoesdown in LPC200011 years ago
PWM

Using timer one for pwm. Durring my research of the timer1 and timer 0 functions, I have come to the conclusion that if using 3 match...

Using timer one for pwm. Durring my research of the timer1 and timer 0 functions, I have come to the conclusion that if using 3 match registers for generating the pwm outputs, and then using the third match reg for the cycle length to reset the pwm. Am I correct in setting up the MCR register to allow the third match register to clear the timer counter? Or is their a hardware function n


Re: PWM

Started by Ravi in LPC20009 years ago

Hi Paul, My question is how to use single edge/double edge controlled feature of PWM modulator to generate PWM? Ravi =A0 On Tue, 12 Feb 2008...

Hi Paul, My question is how to use single edge/double edge controlled feature of PWM modulator to generate PWM? Ravi =A0 On Tue, 12 Feb 2008 Paul Curtis wrote : > Hi, > > > Dear all, > > Processor:LPC2148 > > IDE:WinARM > > Can any one please explain me how to generate PWM > > with sinewave and trangular wave. > > Do I need to make sinewave lookup table. > > It has been told me to se


BLDC with 3 or 6 PWM?

Started by Gaetan Barthelemy in LPC200011 years ago 5 replies

Hello, I have been working on controlling a BLDC motor with a LPC2103. I wanted to use 6 PWM signals (3 generated by Timer 1 and 3 by...

Hello, I have been working on controlling a BLDC motor with a LPC2103. I wanted to use 6 PWM signals (3 generated by Timer 1 and 3 by Timer2) to control the MOSFETs. The issue is that there is a small time difference (about 330ns) between the PWM generated by Timer1 and the ones generated by Timer2. I have read an application note using only 3 PWM signals for the high side, the low sid...


[LPC2124] A/D + PWM doubt

Started by jadamezmartin in LPC200011 years ago 2 replies

Hello All, I am working with the microcontroller (Philips LPC2124) and I need to use the A/D and the PWM to generate audio. I mean, the...

Hello All, I am working with the microcontroller (Philips LPC2124) and I need to use the A/D and the PWM to generate audio. I mean, the audio signal is going to be the input of the A/D and then I have to "rebuild" it using PWM. Has anyone done it? Is there something "special" to be considered? Thanks in advance. Jesus


LPC24xx PWM pin state after stopping

Started by Markus Korber in LPC20006 years ago 14 replies
PWM

Hello, when disabling a single PWM channel via the PWMxPCR register the logical output level depends on the previous pin state. However, I'd...

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 the...


PWM VS TIMERS

Started by "joris.mushrooms" in LPC20008 years ago 5 replies
PWM

Hello everybody, I'm quite a newbie in ARM programming (even if i met this =B5 in the past) = and i have a question about PWM...

Hello everybody, I'm quite a newbie in ARM programming (even if i met this =B5 in the past) = and i have a question about PWM implementations.=20 I'm planning to use a lpc2460 and especially PWMs and timers. Are the 2 fon= ctions linked? can i use all PWM channels and still have my timers free?=20 i've read the manual again again and still, i dont find the answer. also, does anyone got...


Help with LPC2148 PWM?

Started by "J.C. Wren" in LPC20009 years ago 1 reply

I'm trying to get PWM working, and obviously missing something. I want to use PWM5 as the output, and have it run continuously at a 50% duty...

I'm trying to get PWM working, and obviously missing something. I want to use PWM5 as the output, and have it run continuously at a 50% duty cycle. The rate is unimportant at the moment, I can fix that later. Here's the initialization code: SCB_PCONP |= SCB_PCONP_PCPWM0 /* 0x20, enable PWM block */; PCB_PINSEL1 |= PCB_PINSEL1_P021_PWM5 /* 0x400, P0.21 is PWM5 */; PWM_PR = 0 /...


PWM edge position

Started by vineet jain in LPC200011 years ago 3 replies
PWM

Hello all, I was able to initiate the PWM. Now, how do I change the PWM edge positio= n during run time? I am using PWM4. I was changing...

Hello all, I was able to initiate the PWM. Now, how do I change the PWM edge positio= n during run time? I am using PWM4. I was changing the value of PWMMR4 keeping it within limits specified by PW= MMR0. But the LED connected does not change the shade? Any ideas? Thanks, Vineet. __________________________________________________ =20 ------------------------ Yahoo! Group...


Re: Possible race condition when writing to PWMLER

Started by reallygene in LPC200010 years ago

--- In l...@yahoogroups.com, Tom Walsh wrote: > > reallygene wrote: > > > > Greetings. > > > > I have an application running on...

--- In l...@yahoogroups.com, Tom Walsh wrote: > > reallygene wrote: > > > > Greetings. > > > > I have an application running on the LPC2210 that uses several PWM > > outputs. I found that often, I would write a new match value to a > > particular PWM, and set its latch enable bit, but the PWM output would > > NOT change. > > > > After an hour of investigation, I believe I have


Is it possible to invert PWM output on LPC1114?

Started by bobryanmm in LPC20004 years ago 8 replies
PWM

I am trying to drive a servo using the following function and I've messed with the EMR register but I think the values are basically ignored...

I am trying to drive a servo using the following function and I've messed with the EMR register but I think the values are basically ignored because I've got PWM output enabled for MR0/MR1. The datasheet says we need to read a set of rules that apply when PWM mode is used. I know I can get around this by triggering interrupts with the timers/compare modules then toggling the IO pins in the interru...


Re: [LPC2148] R/C Servo's and PWM/Timers

Started by sumi...@yahoo.com in LPC20009 years ago

I have bought Suppo 18A ESC which is AVR based ESC(Electronic speed controller). I would like to have a PWM signal generated by LPC2148(ARM based...

I have bought Suppo 18A ESC which is AVR based ESC(Electronic speed controller). I would like to have a PWM signal generated by LPC2148(ARM based microcontroller). This PWM signal will be the input for the 18A ESC which will drive a BLDC motor. I had a few questions: Is it possible to drive the AVR based ESC and the motor with an external PWM signal from the LPC2148. The PWM signal from the LP...


error while compiling pwm.c

Started by Mitali in LPC20009 years ago

Hi, I am trying to compile pwm.c and I am getting few errors in the nested interuppt region. Please see the picture under album pwm_error...

Hi, I am trying to compile pwm.c and I am getting few errors in the nested interuppt region. Please see the picture under album pwm_error for a list of errors. The code for pwm.c can be found at: http://www.standardics.nxp.com/support/documents/microcontrollers/zip/co de.bundle.lpc213x.lpc214x.uvision.zip Any idea what is causing this? Thanks. Mitali. -------------------------...