Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/21/06 07:40
Read: times


 
Msg Score: +1
 +1 Informative
#118699 - Now it works !
Responding to: ???'s previous message
My assumption was right, the Philips bootloader never initialize the stackpointer and expect the reset state.

Because my routine call the bootloader, SP must be loaded with 5, so the bootloader was entered with SP = 7.

Following the complete code:

#define CALL(addr)      (((void(*)(void))(char code *)addr)())


void emergency_exit(void)
{
  unsigned char i;

  for( i = 1; i; ){             // 8 consecutive zeros = run Philips bootloader
    i += i;
    if( P3_7 && P3_6 )
      i++;
    if( i == 0xFF )             // 8 consecutive ones = run user bootloader
      return;
  }

  EA = 0;

  SP = 7 - 2;                   // Stackpointer = reset value !!!

  AUXR1 |= AUXR1_ENBOOT;        // enable boot
  CALL( 0xFC00 );               // invoke Philips bootloader
}


Peter


List of 20 messages in thread
TopicAuthorDate
P89C668 emergency exit            01/01/70 00:00      
   just a question            01/01/70 00:00      
      Re "funny pin levels"            01/01/70 00:00      
         the "funny pin levels" is the only time            01/01/70 00:00      
            NoTouch can not help            01/01/70 00:00      
               I mentioned NoTouch to show that there i            01/01/70 00:00      
   P89C51RD2            01/01/70 00:00      
      Boot Vector            01/01/70 00:00      
   Re: P89C668 emergency exit            01/01/70 00:00      
   it works not yet !!!            01/01/70 00:00      
      try it manually            01/01/70 00:00      
   Now it works !            01/01/70 00:00      
   my first P89C668 is dead            01/01/70 00:00      
      P89C668 EOL            01/01/70 00:00      
         P89C66x to P89V66x migration            01/01/70 00:00      
            Iasked a contact I have at Philips and he had no a            01/01/70 00:00      
               V668            01/01/70 00:00      
                  668/669 EOL            01/01/70 00:00      
                     there are others            01/01/70 00:00      
      BV            01/01/70 00:00      

Back to Subject List