Temporary call Atmel bootloader

From: Juergen Loh (nospam.arcor.04-11_at_jloh.de)
Date: 11/22/04


Date: Mon, 22 Nov 2004 13:41:31 +0100

Hi,

I'm using a AT89C51ED2. Sometimes the application needs to start the Atmel
ISP bootloader, e.g. to enable re-programming the flash. Normally this is
done by the following API procedure:

    void __api_start_bootloader (void)
    {
        __api_wr_BSB (0xFF);
        __api_wr_SBV (0xFC);
        // stop application peripherals
        T2CON=0x00;
        TL2=0x00;
        TH2=0x00;
        BDRCON=0x00;
        TCON=0x00;
        SCON = 0x00;
        TMOD = 0x00;
        PCON = 0x00;
        TCON = 0x00;
        EA = 0;
        MAP_BOOT;
        __API_JMP_BOOTLOADER();
    }

The problem ist the writing of 0xFF to BSB, because it inhibits the start of
my application on the next reboot. I'm looking for a way of starting the
bootloader without the need of modifying the BSB. Simply commenting out the
"__api_wr_BSB()" line is not possible, because then the bootloader
immediately returns to the application.

Any idea?

Jürgen