Pages: 1 [2]   Go Down
Author Topic: both USB and 5v external power  (Read 1100 times)
0 Members and 1 Guest are viewing this topic.
The Netherlands
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It works, I can upload without problems on the LiPo battery when the 5v+ is cut on the usb.

Another "problem".
When the Arduino starts, my powerleds are on full power for 2 sec, and also when I upload.
Is it posible to solves this with a resistor between the PWM pin and ground?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 551
Posts: 46266
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
When the Arduino starts, my powerleds are on full power for 2 sec, and also when I upload.
Is it posible to solves this with a resistor between the PWM pin and ground?
It seems more likely that you could solve this with proper code, setting pin mode first, for example. We'd need to see what code you have, though, to make any real suggestions.

There is no where near a two second delay between the reset button release and setup() being called.
Logged

The Netherlands
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The delay is not in the code, even if I use a 3 line code to define pins and analogwrite the pin, no change at power up.
It's not the reset button I use.
I power up the flashlight, the led drivers and arduino power up at the same time. But the arduino needs to start up I gues.
Durring this time (around 2-3 sec) the led drivers do not get a signal, and go full power, thinking they don't have a dim pin in use.
The powerleds are also going full power during upload (up to 4-5 sec) and connecting to the pc (1-2 sec).
They are verry bright, and covering my eyes every time I test new code, get anoying, and LiPo runs out of juice.

I'am not installing a resistor before I know it works. (need to open the flashlight).
But I gues if I use a 10K or 100K resistor between PWM pin 9 and GND, when the arduino gives no signal, the signal is low.
I hope that when the arduino gives a PWM signal, it won't stay low.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31554
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The delay is caused by the bootloader looking for some serial communications. During this time all the pins are set to inputs (following the reset) and so they float. This can cause trouble with outputs. One way round this is to use a pull down resistor.
However there is a bug in the arduino code where by if a pin had been used as a PWM output it gives one pulse before this delay, there was a thread about this a few months back.
Logged

The Netherlands
Offline Offline
Jr. Member
**
Karma: 0
Posts: 88
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, good to know.
Can I use a 10K or 100K resistor for this?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31554
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would use 10K.
Logged

Pages: 1 [2]   Go Up
Jump to: