0
Offline
Newbie
Karma: 0
Posts: 25
Arduino rocks
|
 |
« on: March 03, 2011, 05:13:02 pm » |
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
Shannon Member
Karma: 118
Posts: 10148
|
 |
« Reply #1 on: March 03, 2011, 06:06:48 pm » |
Which pins?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 242
Posts: 16507
Available for Design & Build services
|
 |
« Reply #2 on: March 04, 2011, 01:52:30 am » |
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
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 242
Posts: 16507
Available for Design & Build services
|
 |
« Reply #3 on: March 04, 2011, 01:58:58 am » |
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
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 25
Arduino rocks
|
 |
« Reply #4 on: March 12, 2011, 05:16:22 am » |
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
Online
Tesla Member
Karma: 71
Posts: 6820
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #5 on: March 12, 2011, 06:23:45 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 25
Arduino rocks
|
 |
« Reply #6 on: March 12, 2011, 07:53:21 am » |
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
Online
Tesla Member
Karma: 71
Posts: 6820
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #7 on: March 12, 2011, 08:01:28 am » |
So the problem has nothing to do with the Arduino, it's the port expander. What chip is it? 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
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 25
Arduino rocks
|
 |
« Reply #8 on: March 12, 2011, 08:57:52 am » |
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
Shannon Member
Karma: 118
Posts: 10148
|
 |
« Reply #9 on: March 12, 2011, 01:42:29 pm » |
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). 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
Newbie
Karma: 0
Posts: 25
Arduino rocks
|
 |
« Reply #10 on: March 14, 2011, 02:38:14 pm » |
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
Shannon Member
Karma: 118
Posts: 10148
|
 |
« Reply #11 on: March 14, 2011, 03:37:13 pm » |
my arduino is 2009 Have you changed the bootloader? Does the board have the original processor? 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
Newbie
Karma: 0
Posts: 25
Arduino rocks
|
 |
« Reply #12 on: March 20, 2011, 06:44:25 am » |
Have you changed the bootloader? Does the board have the original processor?
No everithing is original
|
|
|
|
|
Logged
|
|
|
|
|
|