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

Infinieon XC Series: Change of ADDRSEL-Registers after EINIT

Hello,

is there a possibility to change the ADDRSEL1-Register after the EINIT-instruction on Infineon XC16X controllers?
Perhaps with changing the Security Level?
I've tried the following sequence to change the security-level to 0x00 (unprotected mode) but without success.
SCUSLC = 0xAAAA; Command 0, state should change to 0x01, but does not.
SCUSLC = 0x5554; Command 1
SCUSLC = 0x0195; Command 2, password = 0x00; 0x96+0xFF (password invertet) = 0x0195
SCUSLC = 0x0000; Command 3, should: new level = 00, no change of the password (default: 0x00).
Who has any ideas concerning these topics??
Thank you very much
Greetings
Toby

Parents
  • Hi Toby,

    you should not invert 0x96,but the 0x00,
    so it should be 0x96FF.

    Sample:

    SCUSLC = 0xAAAA;     // required command 1
    SCUSLC = 0x5554;     // required command 2
    SCUSLC = 0x96FF;     // 0x96 required +
                         // inverse password to
    		     //  unlock; After
                         // Reset this is
                         // default 0x00
    	             // inverse 0xFF ->096FFh
    SCUSLC = 0;
    //  sequence:
    //  000b + new level + 000b + new password
    //  00 = unprotected   new pw = 00
    
    
    FOCON  = 0x80;       // Clockout signal ist
                         // visible on P3.15
    
    PLLCON = 0x7889;     // Select 20MHz (@8 MHz
                         //crystal) CPU frequency
    
    _nop_ ();            // terminate EXTR
                         // sequence to make
                         // sure that the
                         // following
                         // instructions get an
                         // own uninterruptable
                         // EXTR #4 sequence
    SCUSLC = 0xAAAA;     // Set CPU security
                         //level to protected mode
    SCUSLC = 0x5554;
    SCUSLC = 0x96FF;
    SCUSLC = 0x1800;
    // 000b + new level + 000b + new password
    // 000 0 000 1 1000 0000 0000  = 0x01800h
    //	     1 1 = level -> write protected
    

    Hope this helps,
    Stefan

Reply
  • Hi Toby,

    you should not invert 0x96,but the 0x00,
    so it should be 0x96FF.

    Sample:

    SCUSLC = 0xAAAA;     // required command 1
    SCUSLC = 0x5554;     // required command 2
    SCUSLC = 0x96FF;     // 0x96 required +
                         // inverse password to
    		     //  unlock; After
                         // Reset this is
                         // default 0x00
    	             // inverse 0xFF ->096FFh
    SCUSLC = 0;
    //  sequence:
    //  000b + new level + 000b + new password
    //  00 = unprotected   new pw = 00
    
    
    FOCON  = 0x80;       // Clockout signal ist
                         // visible on P3.15
    
    PLLCON = 0x7889;     // Select 20MHz (@8 MHz
                         //crystal) CPU frequency
    
    _nop_ ();            // terminate EXTR
                         // sequence to make
                         // sure that the
                         // following
                         // instructions get an
                         // own uninterruptable
                         // EXTR #4 sequence
    SCUSLC = 0xAAAA;     // Set CPU security
                         //level to protected mode
    SCUSLC = 0x5554;
    SCUSLC = 0x96FF;
    SCUSLC = 0x1800;
    // 000b + new level + 000b + new password
    // 000 0 000 1 1000 0000 0000  = 0x01800h
    //	     1 1 = level -> write protected
    

    Hope this helps,
    Stefan

Children
No data