Go Down

Topic: How can i change status pin to low on boot (Read 1 time) previous topic - next topic

gladiatoreAde

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

Coding Badly


CrossRoads

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?)
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.

CrossRoads

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.
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.

gladiatoreAde

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...

Graynomad

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 :)

LEDs don't matter, and for a transistor/relay tie the pin low as Crossroads said.
______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

gladiatoreAde

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.

Graynomad

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
Rob Gray aka the GRAYnomad www.robgray.com

gladiatoreAde

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

Coding Badly

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?

gladiatoreAde

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

Coding Badly

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.

gladiatoreAde


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

No everithing is original


Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview