Shop OBEX P1 Docs P2 Docs Learn Events
Proper SX reset when power applied — Parallax Forums

Proper SX reset when power applied

Tony LeylandTony Leyland Posts: 71
edited 2005-02-28 12:31 in General Discussion
Hi all,

Can anyone help me with a strange problem I'm experiencing.

I have 3 SXs linked together via a common serial bus and all connected to a BS2.
The power for the whole lot is coming from the STAMP BOE.

When power is applied (thru BOE switch), the STAMP resets correctly but 50% of the time all the
SXs don't reset and hence don't run properly. The SXs are running from their own 50Mhz resonators.
Each SX has a 10K pull up resistor on MCLR. I've even tried putting a capacitor between MCLR and ground
hoping that it would bring it low for a short time. 0.1uF decoupling caps are present and 10 uF cap is also
across the supply lines on my development board.

Any ideas ?

Thanks in advance for your help.
Tony

Comments

  • ForrestForrest Posts: 1,341
    edited 2005-02-25 15:55
    If you're running the BOE off a 9 volt battery - then you probably don't have enough power to run 3 SX processors at 50 MHz. According the the SX28 spec sheet, you'll draw a maximum of 82 mA at 50 MHz x 3 = 246 mA. The current draw for a BS2 and you're over 1/4 Amp.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2005-02-25 15:59
    Hi Tony,

    the three additional SXes clocked @ 50 MHz "eat" some remarkable power. Are you sure that the STAMP BOE regulator is capable of this additional load? Maybe, it is an idea that you measure the total current drawn by the three SXes.

    Do you have brownout detection active in the SXes? Maybe, the supply voltage drops for a short moment when you power up, but long enough for the brownout detection.

    Here is a "reset phenomenon" I once had:

    A while ago, I had real trouble with an SX application (just one SX on board). It did a proper reset only about every second try. I added the external RC reset circuit - no success, I tried an external reset controller - no success. Days later, I again looked at the source code. Usually, at the beginning of the main program, I add code to clear all RAM locations, like shown below:

       clr    fsr
    ClearLoop
       sb      fsr.4               
          setb   fsr.3               
       clr      ind                 
       incsz   fsr                 
       jmp    ClearLoop
    



    In most cases, I copy these lines from some other program, and paste it into the new code. So I also did for this application but I forgot to copy the very first line

    clr    fsr
    
    



    This means that the fsr contained some random value when the loop was entered, causing that not all RAM locations were cleared, and this again caused code executed later to run wild because it was assuming a "clean" RAM. IOW, the SX always did a reset (I only thought it didn't) but got locked somewhere else in the program.

    As a matter of fact, I never could reproduce this with the SX-Key debugger because the debugger always clears the FSR when you start it.

    I learned that copy/paste is a nice feature but it can cost you a lot of hairs too. Since then, I use an include file containing this clear RAM stuff smile.gif .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • Tony LeylandTony Leyland Posts: 71
    edited 2005-02-25 16:16
    Hi,

    The power to the whole circuit comes from an AC adapter. I've just disconnected 2 SXs and left 1 remaining.
    The SX still does not reset properly. I have even tried leaving the BOE on and switching power to the SX board.
    Still no proper reset.

    Hi G
  • BeanBean Posts: 8,129
    edited 2005-02-25 16:28
    I have startup problems if I don't use the brownout detection and the supply risetime is too long.
    I use the brownout BOR42 (for a 5v unit) and it works fine.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out· the "SX-Video Display Module"

    www.sxvm.com
    ·
  • Tony LeylandTony Leyland Posts: 71
    edited 2005-02-25 19:53
    Thanks for that Bean, I'll try that when I'm back in work next week.

    Tony
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-02-26 07:10
    Yeah that power supply isn't going to cut it with 4 processors running from it, also the current your supply can source dictates how fast the power supply rises. It follows the charge law for capacitance (all those traces, wires and bypass caps add up to the total capacitance that needs to be charged upon powerup). The user manual details acceptable risetimes, with an oscilloscope you can measure what the risetime is.
  • Tony LeylandTony Leyland Posts: 71
    edited 2005-02-28 11:01
    Just letting you know that using a 2A PSU had no affect, the SXs still did not reset properly. What did
    make a difference is changing the device directive from BOROFF to BOR42. The SXs now all reset
    properly when power is applied.

    Thanks guys.

    P.S. One thing I did notice however, is that the BOR42 directive needs to be on ALL 3 SXs. If just one
    has the BOROFF directive then all 3 SXs won't reset after power is applied !
  • BeanBean Posts: 8,129
    edited 2005-02-28 12:13
    Hmmm, that is strange. I can't think of any reason why that would be.
    Do you have de-coupling caps at each SX ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out· the "SX-Video Display Module"

    www.sxvm.com
    ·
  • Tony LeylandTony Leyland Posts: 71
    edited 2005-02-28 12:31
    I have 0.1u caps at each SX close to power pins.

    I'm not too worried by what I've seen, I'll just remember to use BOR42 in all my projects !

    Thanks,

    Tony
Sign In or Register to comment.