Reply by Robert Adsett August 16, 20072007-08-16
At 04:53 PM 8/16/2007 +0200, Bernd Walter wrote:
>I relocated the GPIO initialisation into Cstartup_SAM7.c and the result
>was a much shorter time - arround 5ms, which unfortunately is not short
>enough for the relais not to trigger.

BTW, the English is relays. A very minor nit.

>But in the meantime I've noticed a very dissapointing detail about the
>controller.
>The pullups are enabled on reset and are possibly powerfull enough to
>supply enough current through the ULN2003 :(
>0 in the status register means enabled - sigh.
>It seems that I need external pulldown to compensate them...

That's what inverters are for. Simple cheap and compact.
http://www.aeolusdevelopment.com/

From the Divided by a Common Language File (Edited to protect the guilty)
ME - "I'd like to get Price and delivery for connector Part # XXXXX"
Dist./Rep - "$X.XX Lead time 37 days"
ME - "Anything we can do about lead time? 37 days seems a bit high."
Dist./Rep - "that is the lead time given because our stock is live.... we
currently have stock."
Reply by thomasschulte August 16, 20072007-08-16
> But in the meantime I've noticed a very dissapointing detail about the
> controller.
> The pullups are enabled on reset and are possibly powerfull enough to

Reminds me of my Problems in some way.
I was facing the challenge that on System Power Up some GPIO have to be
DOWN. I ended up using a hand full of Transistors to cover these issues
properly.

one delicate issues like external Pullup +5V for a connected 5V-
Perpihal IC should work okay, but on PowerUp it looked like 3.3V for
some initial time. That was a knock-out for the 5V IC when this is
happening through PowerUp. Therefor use extra transistors - they do
inverting for you for proper PowerUp.

Welcome to the club.

T.
Reply by Rick Collins August 16, 20072007-08-16
--- In A..., Bernd Walter wrote:
>
> * COILS
> * PB30
> * PA30
> * PA29
> * PA28
> * PA27
> * PB26
> * PB25
> * PB24
> * PA22 230V
> * PA23 230V
>
> I relocated the GPIO initialisation into Cstartup_SAM7.c and the result
> was a much shorter time - arround 5ms, which unfortunately is not short
> enough for the relais not to trigger.
> From what I see the PLL wait and bcc init are the long running points
> between.
> Since AT91F_LowLevelInit is almost the first code executed it can't be
> FreeRTOS related.
>
> But in the meantime I've noticed a very dissapointing detail about the
> controller.
> The pullups are enabled on reset and are possibly powerfull enough to
> supply enough current through the ULN2003 :(
> 0 in the status register means enabled - sigh.
> It seems that I need external pulldown to compensate them...
> I'm used that GPIO come up with high impendancy and this behavour is
> really unexpected.

I was going to ask what your drive configuration was. It seems that
you are using a series resistor to the base and letting the I/O pin
drive current to turn on the bipolar transistor. The default pullups
are not uncommon on MCUs and FPGAs. This keeps the I/O pin from
floating to invalid voltages until configuration. Remember that the
inputs are always connected to the I/O pin and CMOS does not like to
float to mid voltage values. It turns on both FETs and can create
problems.

You can provide a pull down, or you can treat the I/Os as open
collector and use your own pullup. Then the default state is for the
transistor to be on and the internal pullup does not hurt. Of course
if you want the default state to be off so it doesn't drive the
relays, then you either need to use a pair of transistors or use a PNP
transistor on the high side instead of an NPN on the low. But then if
you are running the relays at a higher voltage than the CPU, this
won't work either.

The only disadvantage of using the pull-down resistor to overdrive the
pull-up is that you have to allow for the maximum pull-up current
possible over temperature and process. Looks like your PA inputs can
source as much as 600 uA of current. 0.7 volts / 600 uA = 1.167
kOhms. So a 1 kohm pull-down should do the trick.
Reply by Bernd Walter August 16, 20072007-08-16
On Thu, Aug 16, 2007 at 02:58:44PM +0300, Caglar Akyuz wrote:
> Bernd Walter wrote:
> >
> >
> > I'm using an AT91SAM7X256 with some relais driven trough an ULN2003.
> > I know that the ULN2003 is designed for 5V pegel, but 3,3V gives enough
> > current to safely drive my relais.
> > My problem is that I get a high impulse at power on of about 25ms,
> > which is enough for the relais to switch.
> > This pulse is a flat 3,3V signal, no power up glitches or something.
> > Since the GPIO should reset to high-impedance and the ULN2003 are
> > bipolar transistors this shouldn't happen.
> > I didn't find an errata in the Atmel datasheet.
> >
> > My project is based on FreeRTOS lwIP_Demo_Rowley_ARM7 sample.
> > I don't see any code piece in the startup code tampering with the GPIO.
> > The GPIO are initialized early in the prvSetupHardware function.
> > Maybe it will reduce the 25ms
>
> Initialization is not taking that much time in FreeRTOS. Which I/O pins
> are you using to drive relays?

* COILS
* PB30
* PA30
* PA29
* PA28
* PA27
* PB26
* PB25
* PB24
* PA22 230V
* PA23 230V

I relocated the GPIO initialisation into Cstartup_SAM7.c and the result
was a much shorter time - arround 5ms, which unfortunately is not short
enough for the relais not to trigger.
>From what I see the PLL wait and bcc init are the long running points
between.
Since AT91F_LowLevelInit is almost the first code executed it can't be
FreeRTOS related.

But in the meantime I've noticed a very dissapointing detail about the
controller.
The pullups are enabled on reset and are possibly powerfull enough to
supply enough current through the ULN2003 :(
0 in the status register means enabled - sigh.
It seems that I need external pulldown to compensate them...
I'm used that GPIO come up with high impendancy and this behavour is
really unexpected.

--
B.Walter http://www.bwct.de http://www.fizon.de
b...@bwct.de i...@bwct.de s...@fizon.de
Reply by Caglar Akyuz August 16, 20072007-08-16
Bernd Walter wrote:
> I'm using an AT91SAM7X256 with some relais driven trough an ULN2003.
> I know that the ULN2003 is designed for 5V pegel, but 3,3V gives enough
> current to safely drive my relais.
> My problem is that I get a high impulse at power on of about 25ms,
> which is enough for the relais to switch.
> This pulse is a flat 3,3V signal, no power up glitches or something.
> Since the GPIO should reset to high-impedance and the ULN2003 are
> bipolar transistors this shouldn't happen.
> I didn't find an errata in the Atmel datasheet.
>
> My project is based on FreeRTOS lwIP_Demo_Rowley_ARM7 sample.
> I don't see any code piece in the startup code tampering with the GPIO.
> The GPIO are initialized early in the prvSetupHardware function.
> Maybe it will reduce the 25ms

Initialization is not taking that much time in FreeRTOS. Which I/O pins
are you using to drive relays?

Caglar
Reply by Bernd Walter August 16, 20072007-08-16
I'm using an AT91SAM7X256 with some relais driven trough an ULN2003.
I know that the ULN2003 is designed for 5V pegel, but 3,3V gives enough
current to safely drive my relais.
My problem is that I get a high impulse at power on of about 25ms,
which is enough for the relais to switch.
This pulse is a flat 3,3V signal, no power up glitches or something.
Since the GPIO should reset to high-impedance and the ULN2003 are
bipolar transistors this shouldn't happen.
I didn't find an errata in the Atmel datasheet.

My project is based on FreeRTOS lwIP_Demo_Rowley_ARM7 sample.
I don't see any code piece in the startup code tampering with the GPIO.
The GPIO are initialized early in the prvSetupHardware function.
Maybe it will reduce the 25ms if I put it into Cstartup_SAM7.c befor
the PLL setup, but it shouldn't happen in the first place.

--
B.Walter http://www.bwct.de http://www.fizon.de
b...@bwct.de i...@bwct.de s...@fizon.de