Main Site Documentation

EXM: Relays activated at bootstrap!


#1

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:http://www.sigma-shop.com/product/13/eight-relay-board-ready-for-your-pic-avr-project-12v.html).

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)


#2

Pull them low by adding resistors


#3

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?


#4

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

:o


#5

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?


#6

10k will do no harm :wink:


#7

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


#8

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.


#9

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


#10

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


#11

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


#12

In my case IO10 and PWM0are not properly pull down.


#13

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.