This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to set MCON register in DS5000T from sw applikation

Hi,
If I have bad luck, MCON has change, when I remove the power supply. MCON: 0xc8 -> 0xcc, if it happent dyring a RTC access.
And now I can't start my applikation before I have changed the MCON through the command line interface.
I have tried to set the MCON register in the beginning of the program, through "Timed Access", but in vain!

Can anyone tell me whats wrong with the code?


//DS5000T 32K

     TA   = 0x0AA; // timed access
     TA   = 0x55;
     MCON |= 0x02; // paa=1
     TA   = 0x0AA; // timed access
     TA   = 0x55;
     MCON = 0xD8; // partition adr 6000h


thanks!
Pih Lung

Parents
  • I think your code should be:

    #pragma disable
    void set_mcon (void)
    {
    TA    = 0xAA; // timed access
    TA    = 0x55;
    MCON |= 0x02; // paa=1
    MCON  = 0xD8; // partition adr 6000h
    TA    = 0xAA; // timed access
    TA    = 0x55;
    MCON &= ~0x02; // paa=0
    }

    Jon

Reply
  • I think your code should be:

    #pragma disable
    void set_mcon (void)
    {
    TA    = 0xAA; // timed access
    TA    = 0x55;
    MCON |= 0x02; // paa=1
    MCON  = 0xD8; // partition adr 6000h
    TA    = 0xAA; // timed access
    TA    = 0x55;
    MCON &= ~0x02; // paa=0
    }

    Jon

Children