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 />

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

0046 * BIT EQUATES FOR PPROG<br />

0047 0020 ELAT EQU $20<br />

0048 0001 EPGM EQU $01<br />

0049 *<br />

0050<br />

0051 * MEMORY CONFIGURATION EQUATES<br />

0052 *<br />

0053 b600 EEPMSTR EQU $B600 Start of EEPROM<br />

0054 b7ff EEPMEND EQU $B7FF End of EEPROM<br />

0055 *<br />

0056 d000 EPRMSTR EQU $D000 Start of EPROM<br />

0057 ffff EPRMEND EQU $FFFF End of EPROM<br />

0058 *<br />

0059 0000 RAMSTR EQU $0000<br />

0060 01ff RAMEND EQU $01FF<br />

0061<br />

0062 * DELAY CONSTANTS<br />

0063 *<br />

0064 0db0 DELAYS EQU 3504 Delay at slow baud<br />

0065 021b DELAYF EQU 539 Delay at fast baud<br />

0066 *<br />

0067 1068 PROGDEL EQU 4200 2 ms prog delay<br />

0068 * At 2.1 MHz<br />

0069<br />

0070 *******************************************<br />

0071 bf00 ORG$BF00<br />

0072 *******************************************<br />

0073<br />

0074 * Next two instructions provide a predictable place<br />

0075 * to call PROGRAM and UPLOAD even if the routines<br />

0076 * change size in future versions.<br />

0077 *<br />

0078 bf00 7e bf 13 PROGRAM JMP PRGROUT EPROM prog utility<br />

0079 bf03 UPLOAD EQU * Upload utility<br />

0080<br />

0081 *********************************************<br />

0082 * UPLOAD - Utility subroutine to send data from<br />

0083 * inside the MCU to the host via the SCI interface.<br />

0084 * Prior to calling UPLOAD set baud rate, turn on SCI<br />

0085 * and set Y=first address to upload.<br />

0086 * Bootloader leaves baud set, SCI enabled, and<br />

0087 * Y pointing at EPROM start ($D0000) so these default<br />

0088 * values do not have to be changed typically.<br />

0089 * Consecutive locations are sent via SCI in an<br />

0090 * infinite loop. Reset stops the upload process.<br />

0091 *********************************************<br />

0092 bf03 ce 10 00 LDX #$1000 Point to registers<br />

0093 bf06 18 a6 00 UPLOOP LDAA 0,Y Read byte<br />

0094 bf09 1f 2c 80 fc BRCLR SCSR1,X $80 * Wait for TDRE<br />

0095 bf0d a7 2f STAA SCDRL,X Send it<br />

0096 bf0f 18 08 INY<br />

0097 bf11 20 f3 BRA UPLOOP Next...<br />

0098<br />

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

16 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!