This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

System Reset Interrupt

Other Parts Discussed in Thread: BQ76PL536

Hi all,

I'm trying to use the system reset interrupt service routine and am having some troubles. I have a peripheral which doesn't do well when the host MCU (F5529) loses power and I am trying to make it so that when the host powers up again it simply resets this peripheral. For those interested it is a BQ76PL536. It loses it's address and all functionality and must be reset. The way I see it my two options are:

a) use the service interrupt for a system reset and reset the BQ from there

b) every time I want to use the BQ I must check it's fault flag (which gets set during a power loss) and if so, then reset it then. 

The second option requires checking the fault flag every single time I write to the device which seems sloppy and hack-ish to me. So I want to use the system reset interrupt routine. Thus far I have it as such:

#pragma vector = RESET_VECTOR
__interrupt void RESET_VECTOR_ISR(void){
addr_BQ_devices();
}

However when I run I get this error: a data verifcation error occured, file load failed. Can anybody help me get around this or am I going to have to go with option b)?

Thanks in advance!

  • Hi Trevor,

    In most applications, cstartup (a tool-provided software module) handles reset for you.  Handling reset yourself is somewhat advanced.

    In your case, you may simply want to initialize/reset the BQ early in main( ).  MSP Reset -> cstartup -> main( ).

    Jeff

  • I've actually stumbled across a strange solution. Right now I have a few LEDs and my external memory (Atmel dataflash) connected via breadboard and the BQ through a dev board and if I power them on in a certain order after a reset I don't have an issue! And this is the order the gear will be powered up in its natural environment so I am just going to leave it.

    And I feel I should mention that I do have my BQ init/reset in the main already; that is what I was so confused why it wasn't resetting. I guess it all works out in the end. Thanks for the help :)

  • The reset vector usually initializes your global variables and starts main. There is no "reset ISR". However, you may want to implement a pre-init code that does soem checking, maybe skips variable initialization when it was a 'warm' reset (requires code that can compe with this). But in most cases, reset is reset and you just fire-up your application.

    Trevor Woods said:
    if I power them on in a certain order after a reset I don't have an issue! And this is the order the gear will be powered up in its natural environment [...]I do have my BQ init/reset in the main already; that is what I was so confused why it wasn't resetting.


    Maybe your 'warm start reset' has a different timing, so that the peripheral won't reset while it does so on a real power-up.
    Maybe your original reset code never had any effect, so the peripheral did reset on power-up (of course) but ignored your software reset request. Which made no difference on power-up.
    maybe the reordering your init code changed the timing so the software reset works now. Or you didn't have all ports properly initialized so the reset signal never left the MSP, and in the 'right' order it does.Or one of the peripherals is blocking communication until initialized, so it mus tbe initialized first.
    There are plenty of possible reasons for the bvehaviour. Without knowing the hardware and software details, I can spend the whole evening listing possible causes.

  • Jeff Tenney said:
    Jeff


    I just noticed that you made it to guru level.

    Congratulations!

  • Thank you, Jens-Michael.

    It's official.  The 10k threshold is too low for "guru" status.  ;^)

    Jeff

  • Jeff Tenney said:
    It's official.  The 10k threshold is too low for "guru" status.  ;^)

    Don't make them rise this threshold. There is a discussion about a new "Oracle" level :)
    Well, for TI employees, the threshold for guru is already on 50k.

    But don't be shy. You really deserve it. You did a lot of experimental work (for which I never have the time) and found lots of things thy slipped my attention (including quite a few mistakes of my own)

**Attention** This is a public forum