| ??? 06/16/06 14:55 Read: times |
#118419 - P89C668 emergency exit |
I'm now developing my own bootloader on the P89C668.
Unfortunately there is no way back after changing the bootvector. Only the Atmels allow reprograming the boootvector by forcing PSEN low. Thus I insert this code on my developing. Since my application use memory mapped IOs, /RD and /WR acting as outputs normally. So if something goes wrong during developing, I can /RD or /WR force low during reset to have a second chance to reprogram it by the Philips bootloader. There is also denoising done, to avoid false decision.
#define CALL(addr) (((void(*)(void))(char code *)addr)())
void emergency_exit(void)
{
unsigned char i;
for( i = 0x55; i; ){ // 8 consecutive zeros = run Philips bootloader
i <<= 1;
if( P3_7 && P3_6 ) // check /RD or /WR if pulled low
i++;
if( i == 0xFF ) // 8 consecutive ones = run user bootloader
return;
}
EA = 0;
AUXR1 |= 0x20; // enable boot
CALL( 0xFC00 ); // invoke Philips bootloader
}
Peter |
| Topic | Author | Date |
| 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 |



