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

RSIR LPC2364/66/68

On powerup I want to read the cause of starting with the following code:

  printf("\n\rPowerup Source [%04X]: ",RSIR);
  if(RSIR&(1<<0)) {printf("POR ");  RSIR|(1<<0);}
  if(RSIR&(1<<1)) {printf("EXTR "); RSIR|(1<<1);}
  if(RSIR&(1<<2)) {printf("WDTR "); RSIR|(1<<2);}
  if(RSIR&(1<<3)) {printf("BODR "); RSIR|(1<<3);}


and get the following as output:
Powerup Source [000B]: POR EXTR BODR

It remains the same on PowerOff/On or Reset.
What's wrong with it?
Peter

Parents
  • My code looks this:

          printf("\n\rPowerup Source [%04X]: ",RSIR);
          if(RSIR&(1<<0)) {printf("POR "); RSIR|(1<<0);}
          if(RSIR&(1<<1)) {printf("EXTR ");RSIR|(1<<1);}
          if(RSIR&(1<<2)) {printf("WDTR ");RSIR|(1<<2);}
          if(RSIR&(1<<3)) {printf("BODR ");RSIR|(1<<3);}
    

    I clear the bits individually.

    Then I also tried this code:

          rsir=RSIR;
          RSIR=0x0f;
          printf("\n\rPowerup Source [%04X]: ",rsir);
          if(rsir&(1<<0)) {printf("POR ^");}
          if(rsir&(1<<1)) {printf("EXTR ");}
          if(rsir&(1<<2)) {printf("WDTR ");}
          if(rsir&(1<<3)) {printf("BODR ");}
    

    no difference, output is:
    Powerup Source [000B]: POR EXTR BODR

    Any other idea?

Reply
  • My code looks this:

          printf("\n\rPowerup Source [%04X]: ",RSIR);
          if(RSIR&(1<<0)) {printf("POR "); RSIR|(1<<0);}
          if(RSIR&(1<<1)) {printf("EXTR ");RSIR|(1<<1);}
          if(RSIR&(1<<2)) {printf("WDTR ");RSIR|(1<<2);}
          if(RSIR&(1<<3)) {printf("BODR ");RSIR|(1<<3);}
    

    I clear the bits individually.

    Then I also tried this code:

          rsir=RSIR;
          RSIR=0x0f;
          printf("\n\rPowerup Source [%04X]: ",rsir);
          if(rsir&(1<<0)) {printf("POR ^");}
          if(rsir&(1<<1)) {printf("EXTR ");}
          if(rsir&(1<<2)) {printf("WDTR ");}
          if(rsir&(1<<3)) {printf("BODR ");}
    

    no difference, output is:
    Powerup Source [000B]: POR EXTR BODR

    Any other idea?

Children