Pages: [1]   Go Down
Author Topic: How can i change status pin to low on boot  (Read 1603 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear guys,
i wrote also in italian this post...If i connect arduino to a simple led, or a transistor during the boot there is some current passing over it. In the case of a transistor connected with an high power relay can give many problems for 220v dispositive.
I wish to know how avoid this electronically or if i can change status of pin during the boot (before setup routine is called)
Thank you
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Which pins?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27425
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

put pulldown resistors on the pins. I've read here that on reset, the pins are setup as inputs until the sketch kicks in.
You can confirm that by reading the atmel datasheet for your part. (Atmega 168? 328? 1280? other?)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27425
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

From the 328 datasheet
"The port pins are tri-stated when reset condition becomes active,  even if no clocks are running."

So add pull-down resistors if you can't have floating inputs.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Problem is that pins are SDA and SCL pins, that are connected with a I2C port expander pcf8574.
They are pulled up so i think that i cant pull them down too...
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Problem is that pins are SDA and SCL pins, that are connected with a I2C port expander pcf8574.
Eh? Then none of your original examples count. Surely you don't have LEDs, transistors, and relays on the I2C lines smiley

LEDs don't matter, and for a transistor/relay tie the pin low as Crossroads said.
______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

connections are ARDUINO->I2C PORT EXPANDER->TRANSISTOR->RELAY
When i gve power to arduino for 4-5 second (the same time the arduino led blink) all output are set to high.
I obtain the same problem if i connect an lcd display I2C to arduino...it activate baklight for some seconds...pleae help.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So the problem has nothing to do with the Arduino, it's the port expander.

What chip is it?

Quote
I obtain the same problem if i connect an lcd display I2C to arduino...it activate baklight for some seconds..
If the i2c lines are pulled up then no commands or rubbish should go to the LCD, therefore it will do nothing. Normally the back light is a separate connection. Are you saying that this LCD has control over the backlight using i2c commands?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the chip is pcf8574
i do't think it is the problem because if i connect LCD to I2C without pcf the problem persists...
I can add you an information to understand the problem..
if i write analogRead(4)
and analogRead(5)
before calling wire.begin()
i obtain in output 583 and 1023
Are there normal parameters??
Thank you for the help
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So the problem has nothing to do with the Arduino, it's the port expander.

Not necessarily.  There is a similar complaint in the Motors section about an Arduino Uno that is fiddling with the PWM pins while the bootloader runs.  There is nothing blatantly wrong in Optiboot but westfw found a very subtle bug involving the R0 (or R1) register initialization.  It is possible that @gladiatoreAde is effected by that bug (or another very subtle bug).

Quote
I obtain the same problem if i connect an lcd display I2C to arduino...it activate baklight for some seconds..

If the back-light is being controlled by a PWM pin then @gladiatoreAde's problem may be identical to the one reported in Motors.

@gladiatoreAde: Which Arduino are you using?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi coding,
my arduino is 2009.
I discovered that PCF8574 has default output on HIGH state, for te lcd i don't know..but it is not so important (relay all on is worst). I can use a SN74HC540N but i haven't more space on my shield.. :-(
Can you tell me if in your opinion MCP23008 would have the same problem?
Tank you
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
my arduino is 2009

Have you changed the bootloader?  Does the board have the original processor?

Quote
Can you tell me if in your opinion MCP23008 would have the same problem?

I have no idea.

You really need to provide a schematic.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you changed the bootloader?  Does the board have the original processor?

No everithing is original

Logged

Pages: [1]   Go Up
Jump to: