PWM_Start() turns on the LED

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DzNg_1446756
Level 3
Level 3
First like received First like given

I'm trying to dim an LED usinf PWM.  I have a MOSFET connected to a GPIO, which is the PWM pin.  Whenever PWM_Start() is called for the first time, the LED lights up, then goes away, as in a spike, then the dimming kicks in.  Is there any way to make PWM_Start() to not spike the LED the first time?

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        Check pin output state on program startup. I suspect it is HIGH (for some 100ms while program initializes). If so, change pin startup state in pin properties.   

View solution in original post

0 Likes
2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Consider to negate the output of the PRiSM (which you hopefully use). Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use

   

Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        Check pin output state on program startup. I suspect it is HIGH (for some 100ms while program initializes). If so, change pin startup state in pin properties.   
0 Likes