Skip to main content
Visitor II
January 19, 2009
Question

ST10F276 - Stops running after 3 sec on power up, but OK when reset ?

  • January 19, 2009
  • 5 replies
  • 1204 views
Posted on January 19, 2009 at 14:55

ST10F276 - Stops running after 3 sec on power up, but OK when reset ?

    This topic has been closed for replies.

    5 replies

    Visitor II
    December 12, 2008
    Posted on December 12, 2008 at 13:17

    I have designed my own board for the ST10F276 and written my own software using Tasking.

    However, I have a strange problem when first powering up the board.

    The micro runs fine for about 3 seconds, but then it stops running and just halts.

    With power still applied, if I press the reset button on my board the program restarts and continues to run without any further problems.

    The program only halts when first applying power to the board.

    I have attached the schematic for my ST10 board, showing the reset and RPD pins etc (see attached stpdf).

    I have attached a scope trace which was taken during power up of the board (see attached 5v-rst-rpd.jpg).

    The trace shows the 5V supply, the reset signal and the RPD signal.

    And below is some simple code I wrote to flash an LED every 100ms.

    Like all my other programs, this program halts after 3 seconds when the board is powered up.

    But then works fine when the reset button is pressed.

    /****************************************************/

    #include ''regf276e.h''

    #define Set_Priority_02(reg) (reg |= 0x08)

    sfrbit LED0 _atbit(P1L,0);

    sfrbit LED1 _atbit(P1L,1);

    void main(void)

    {

    DP1L = 0x01; // P1L.0 is an output

    LED0 = 1 ; // Turn LED 0 on

    T2CON = 0x0027 ; // T2 is used in reload mode

    T3CON = 0x0005 ;

    T3UD = 0 ;

    T2 = 49910 ;

    T3 = 49910 ;

    Set_Priority_02(T3IC) ;

    T3IE = 1 ;

    T3R = 1 ;

    IEN = 1 ;

    while(1) { ; } // Just hang around..

    }

    _interrupt( 0x23 ) void T3_overflow( void )

    {

    LED0 ^= 1 ;

    }

    /****************************************************/

    [ This message was edited by: john.lintern on 12-12-2008 17:50 ]

    [ This message was edited by: john.lintern on 12-12-2008 17:51 ]

    [ This message was edited by: john.lintern on 12-12-2008 17:52 ]

    [ This message was edited by: john.lintern on 12-12-2008 17:54 ]

    ________________

    Attachments :

    5v-rst-rpd.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Gq&d=%2Fa%2F0X0000000bXc%2FBPr6YT6tfVNJ1FEKXwFKcFFfB2kGFkuBjuHkzTHuiCU&asPdf=false

    st10.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0EB&d=%2Fa%2F0X0000000bXe%2Fkm7rYv_WXhQ1SXNy9MdhxxNEUVDAO0ZfTSfpGh8edec&asPdf=false
    Visitor II
    January 6, 2009
    Posted on January 06, 2009 at 09:08

    I have resolved this problem - it was a hardware design fault.

    The NMI input to the micro was floating so after a few seconds some noise must have appeared on this input.

    I have now pulled the NMI input up to +5V (via a 10k resistor) and it works fine.

    Strange how the problem only occured on power up and not on reset ?

    Anyway, problem solved :)

    Visitor II
    January 15, 2009
    Posted on January 15, 2009 at 02:09

    How did you work with the internal flash memory? I'm searching the solution, just now have no luck :)

    http://www.st.com/mcu/forums-cat-7833-5.html

    Visitor II
    January 15, 2009
    Posted on January 15, 2009 at 13:46

    im a bit of an amature at all this

    ive had a look but cant really see anything obvious

    have you looked at my circuit diagram attached in this post ?

    it looks like an automotive ecu in your picture ?

    is there a chance this could be protected in some way so that you cant read the code ?

    Visitor II
    January 19, 2009
    Posted on January 19, 2009 at 14:55

    So what answer did you get from the mcu? I have the same answer from the both, so monitor won't be active... maybe just to try another transfer protocol?...