EXM: Relays activated at bootstrap!

Hi everybody.

We are experimenting a strange and dangerous behavior on a FEZ-Cobra-based device.

We have some IOs connected to a relay board (similar to this one:KMtronic Ltd: 8 RELAY BOARD ready for your PIC, AVR project - 12V).

Whenever we bootup our board, such IOs turn on relay coils, making, for example, 220V engines connected move! After boot, our firmware sets such IOs as output and pulls them low, turning off motors.

Note that connecting motors to NC instead of NO (or viceversa) dosn’t solve the problem, since de-powering control device turns on motors again!

Any hints?

P.S. I know that IO pins should boot in input (high impedance) mode, but it seems that this is not enough to keep colis unenergized. Please note that unconnecting IOs from relay board, relay colis turn off (so high impedance and unconnected scenarios don’t show same behavior)

Pull them low by adding resistors

Do you mean some external pull-down resistors between IO and relay-board input pin?

This would compel us to design a custom “passing” expansion board for FEZ-Cobra just to put on 4-8 resistors…quite expensive, isn’t it?

[quote]Do you mean some external pull-down resistors between IO and relay-board input pin?
[/quote]
Yes

:o

Eric Im not hardware guy but does this additional resistor use some mA on output? If yes will not this be dangerous for MCU for example if we connect 32-48 or more relays?

10k will do no harm :wink:

[quote]This would compel us to design a custom “passing” expansion board for FEZ-Cobra just to put on 4-8 resistors…quite expensive, isn’t it?
[/quote]

In prototyping state adding a pull down resistor array to a DIL ULN2803 is easy and takes 1 minute to solder, see picture.

The pins do initialize as input, but with the internal pullup enabled. I don’t know if this is the default for the underlying microcontroller, or whether it’s a conscious choice by GHI.

You need to add an external pulldown that will overcome this internal pulldown. Yes, it will draw power all the time, but not a ton. As Eric said, a 10K pulldown will consume only 0.3mA.

PINMODE 00 is the default value after Reset and it means [quote]Pin has an on-chip pull-up resistor enabled.[/quote].

0.3mA for each IO that has to be pulled down separately is a lot in the Embedded Systems world.

Does the PINMODE can be used or may the mode configuration be directly written on register of NXP chip?.

[quote]PINMODE 00 is the default value after Reset and it means
Pin has an on-chip pull-up resistor enabled.
[/quote]

Aaah, like my good old 8051 family processors…
Then its easier to think of “active low” outputs and change the relay driver cicuit.

In my case IO10 and PWM0are not properly pull down.

Yes, you can, but it wouldn’t take effect until your user code began running. There’s no way to alter the reset state of the chip.