09.01.2013 Views

Motorola Semiconductor Engineering Bulletin EB422 Enhanced

Motorola Semiconductor Engineering Bulletin EB422 Enhanced

Motorola Semiconductor Engineering Bulletin EB422 Enhanced

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Freescale <strong>Semiconductor</strong>, Inc...<br />

<strong>Engineering</strong> <strong>Bulletin</strong><br />

Freescale <strong>Semiconductor</strong>, Inc.<br />

Listing 7. MC68HC11ED0 Bootloader ROM Listing<br />

0001 *Bootloader Firmware for MC68HC11ED0<br />

0002<br />

0003 ********************************************************<br />

0004 * November 11 1991<br />

0005 ********************************************************<br />

0006<br />

0007 * Equates for use with index offset = 0<br />

0008<br />

0009 0008 PORTD EQU $08<br />

0010 0009 DDRD EQU $09<br />

0011 0028 SPCR EQU $28<br />

0012 002b BAUD EQU $2B<br />

0013 002c SCCR1 EQU $2C<br />

0014 002d SCCR2 EQU $2D<br />

0015 002e SCSR EQU $2E<br />

0016 002f SCDAT EQU $2F<br />

0017 003b PPROG EQU $3B<br />

0018 003f CONFIG EQU $3F<br />

0019<br />

0020 ********************************************************<br />

0021 * This bootstrap program allows the user to<br />

0022 * download a program of exactly 256 bytes.<br />

0023 * The program must start at $0100.<br />

0024 * Each byte of the program is received by the<br />

0025 * SCI, starting with the $0100 byte and working<br />

0026 * up to the $01FF.<br />

0027 *<br />

0028 * This bootloader is based on the bootloader for the<br />

0029 * MC68HC11A8. Modifications are to place the registers<br />

0030 * at $00XX and destination to $0100.<br />

0031 ********************************************************<br />

0032 bf80 ORG $BF80<br />

0033 bf80 BEGIN EQU *<br />

0034<br />

0035 * Init.stack<br />

0036 bf80 8e 00 ff LDS #$00FF<br />

0037 * Put PORTD in wired-or mode<br />

0038 bf83 14 28 20 BSET SPCR $20<br />

0039 * Init SCI, restart the divider chain, enable tx & rx<br />

0040 bf86 cc a2 0c LDD #$A20C<br />

0041 bf89 97 2d STAA BAUD<br />

0042 bf8b d7 2d STAB SCCR2<br />

0043 * Send break as soon as start bit is detected<br />

0044 bf8d 14 2d 01 BSET SCCR2 $01<br />

0045 * Clear break as soon as start bit is detected<br />

0046 bf90 12 08 01 fc BRSET PORTD $01 *<br />

0047 bf94 15 2d 01 BCLR SSCR2 $01 * Clear break<br />

0048 * Wait for first character (users send $ff)<br />

0049 bf97 13 2e 20 fc BRCLR SCSR $20 * Wait for RDRF<br />

0050 bf9b 96 2f LDAA SCDAT Read data<br />

0051 *** No jump to EEPROM or RAM here !!<br />

0052 * If data = $FF, then /16 is correct baud<br />

0053 bf9d 81 ff CMPA #$FF<br />

0054 bf9f 27 03 BEQ BAUDOK<br />

0055 * else change to /104 (/13 & /8) 1200 @ 2 MHz<br />

0056 bfa1 14 2b 33 BSET BAUD $33<br />

0057 * Then download 256 byte program<br />

0058 bfa4 BAUDOK EQU *<br />

0059 bfa4 ce 01 00 LDX #$100 Init pointer<br />

0060 * Read in program and put in RAM<br />

0061 bfa7 BK2 EQU *<br />

<strong>EB422</strong><br />

14 MOTOROLA<br />

For More Information On This Product,<br />

Go to: www.freescale.com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!