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

XC16X: No extern interrupt on Port9.2

Hi, I use an XC164CM controller (on a Infineon Evalboard). My problem is, thats not possible to start an extern interrupt (EX4IN) on Portpin P9.2.
The register values are correct for the simulation with µVision3. Probably I have a hardware problem.
The positive trigger edge is from a 74LS00. But the controller can't detect the edge and no interrupt is started.
Some ideas?
Kindly regards
Rainer

Parents
  • Hi Chris,

    yes - this was the solution, much thanks!
    Rainer

    Here is the code snippet from Infineon(DAvE):
    void UnlockProtecReg(void)
    { uword uwPASSWORD;

    if((SCUSLS & 0x1800) == 0x0800) // if low protected mode {

    uwPASSWORD = SCUSLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCUSLC = 0x8E00 | uwPASSWORD; // command 4

    } // end if low protected mode

    if((SCUSLS & 0x1800) == 0x1800) // if write protected mode { SCUSLC = 0xAAAA; // command 0 SCUSLC = 0x5554; // command 1

    uwPASSWORD = SCUSLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF;

    SCUSLC = 0x9600 | uwPASSWORD; // command 2 SCUSLC = 0x0800; // command 3; new PASSWOR is 0x00

    uwPASSWORD = SCUSLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCUSLC = 0x8E00 | uwPASSWORD; // command 4

    } // end if write protected mode
    }

Reply
  • Hi Chris,

    yes - this was the solution, much thanks!
    Rainer

    Here is the code snippet from Infineon(DAvE):
    void UnlockProtecReg(void)
    { uword uwPASSWORD;

    if((SCUSLS & 0x1800) == 0x0800) // if low protected mode {

    uwPASSWORD = SCUSLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCUSLC = 0x8E00 | uwPASSWORD; // command 4

    } // end if low protected mode

    if((SCUSLS & 0x1800) == 0x1800) // if write protected mode { SCUSLC = 0xAAAA; // command 0 SCUSLC = 0x5554; // command 1

    uwPASSWORD = SCUSLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF;

    SCUSLC = 0x9600 | uwPASSWORD; // command 2 SCUSLC = 0x0800; // command 3; new PASSWOR is 0x00

    uwPASSWORD = SCUSLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCUSLC = 0x8E00 | uwPASSWORD; // command 4

    } // end if write protected mode
    }

Children
  • Please read the instructions for how to post code on this forum. They are not hard to find. Just two lines above the text box where you enter your message.

    The code you have posted is unreadable!

  • Sorry,

    void UnlockProtecReg(void)
    {
      uword uwPASSWORD;
      if((SCUSLS & 0x1800) == 0x0800)      // if low protected mode
      {
        uwPASSWORD = SCUSLS & 0x00FF;
        uwPASSWORD = (~uwPASSWORD) & 0x00FF;
        SCUSLC = 0x8E00 | uwPASSWORD;      // command 4
      }  // end if low protected mode
      if((SCUSLS & 0x1800) == 0x1800)      // if write protected mode
      {
        SCUSLC = 0xAAAA;                   // command 0
        SCUSLC = 0x5554;                   // command 1
        uwPASSWORD = SCUSLS & 0x00FF;
        uwPASSWORD = (~uwPASSWORD) & 0x00FF;
        SCUSLC = 0x9600 | uwPASSWORD;      // command 2
        SCUSLC = 0x0800;                   // command 3; new PASSWOR is 0x00
        uwPASSWORD = SCUSLS & 0x00FF;
        uwPASSWORD = (~uwPASSWORD) & 0x00FF;
        SCUSLC = 0x8E00 | uwPASSWORD;      // command 4
      }  // end if write protected mode
    }
    

    Thanks all for help!
    Rainer