Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: float in interrupt function?

2005-04-09 by ed_hage

--- In lpc2000@yahoogroups.com, "Dan Beadle" <dan.beadle@i...> wrote:
> I would first try hard coding MR4.    
> 
>  
Hello Dan,

That's the point. I have it already running hard coded! I have a
simular setup in a PWM_Init () function and I get great 5% DC on my
output-pin  when I have the following:

PWM_MR4 = (PWM_MR0 * 5) / 100; 

Also tried (DC1 defined in the function):
int DC1 = 5;
PWM_MR4 = (PWM_MR0 * DC1) / 100; 

and that works, but what I want and does not work is defining DC1 as a
global (outside the function) so I can change it with other functions.
How can I solve this problem 

(we have evolved to a problem that has nothing to do with floats
anymore ;-} )

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.