9 years, 10 months ago.

PWM in KL46Z

I need to generate signal approximately 38 kHz at kit KL46Z.

PwmOut led_IR(PTA1);

led_IR.period_us(26); led_IR.pulsewidth_us(13);

I used for this PWM and it works. Nevertheless, when I use interrupt in the program (Ticker tick; or InterruptIn SW1(SW1);), PWM stops to work. Could anybody help me to tell me what I am doing wrong?

My full code

/media/uploads/kral/main.cpp

Either works PWM or interrupt. PWM function verified oscilloscope.

You will need to add some details what you are doing exactly in those Interrupts and how you are measuring your PWM output: I can pretty much guarantee PWM won't stop during an interrupt, unless you tell it to stop.

posted by Erik - 13 Jan 2015
Be the first to answer this question.