461
Bootstrap Program
This is a bootstrap program for TMS370. This program is resident in master. It is transmitted to slave mode
in RAM memory. After transmission, the control is passed on to the beginning of this program in slave
mode at 20h. This programs data EEPROM. It checks the first word for the EEPROM command and the
number of bytes to be programmed. The second and third bytes indicate the destination address. If the first
byte in the command word (the first word) is zero, it indicates the end of EEPROM programming.
Routine
;
;Define the registers
;
SPICCR
.EQU
P030
;SPI communications control register
SPICTL
.EQU
P031
;SPI control register
SPIBUF
.EQU
P037
;SPI receive data buffer register
SPIDAT
.EQU
P039
;SPI serial data register
SPIPC1
.EQU
P03D
;SPI port control register 1
SPIPC2
.EQU
P03E
;SPI port control register 2
SPIPRI
.EQU
P03F
;SPI priority
DEECTL
.EQU
P01A
;EEPROM control register
BEGIN
.EQU
20H
;RAM program starting address
DATAL
.EQU
R04
;Data length
TEMP
.EQU
R07
;Temporary register
TEMP1
.EQU
R14
;Temporary register 1
TEMP2
.EQU
R12
;Temporary register 2
;
;program
;
.TEXT
7300H
MOV
#0A0H,B
;Initialize stack
LDSP
LAST
MOV
#0FFH,SPICCR
;Initialize SPI.
MOV
#047H,SPICCR
;Program SPI for 8 bit data.
MOV
#03,SPICTL
;Program SPI for slave and enable inter.
MOV
#02,SPIPC1
;Enable SPICLk pin.
MOV
#020H,SPIPC2
;Enable SPISIMO and SPISOMI pin.
START1X
CLR
B
;Reset the index
LOOPX
BTJZ
#40H,SPICTL,LOOPX
;Check if character received.
MOV
SPIBUF,A
;Read command word.
AGAIN
MOV
A,*DATAL(B)
;Save in register for further processing
INC
B
;Increment till two byte address is read
CMP
#3,B
;Check if three bytes are read.
JNE
LOOPX
;If not, read again.
;
MOV
DATAL,TEMP
;Copy command value in temporary reg.
AND
#3FH,TEMP
;Obtain No. of bytes of data/prog.
CLR
B
;Set offset for data EEPROM
BTJO
#40H,DATAL+1,LOOP1X ;Check addr. whether data or prog. EEPRO
MOV
#2,B
;Offset for data EEPROM.
;
LOOP1X
BTJZ
#40H,SPICTL,LOOP1X
;Check if character received.
MOV
SPIBUF,A
;Read received character.
DINT
MOV
A,TEMP2
;Save it in to TEMP2.
MOV
A,*DATAL+2
;Move data to the array location.
MOV
#1,A
;Program DEECTL=1 (program 0s).
CALLR
PROG
;Do the write operation.
*
Summary of Contents for TMS370 Series
Page 1: ...TMS370 Microcontroller Family Application Book 1996 8 Bit Microcontroller Family ...
Page 2: ...Printed in U S A February 1996 SPNA017 ...
Page 3: ...1996 Application TMS370 Microcontroller Family Book ...
Page 20: ...1 Part I Introduction ...
Page 21: ...2 ...
Page 22: ...3 Introduction Microcontroller Products Semiconductor Group Texas Instruments ...
Page 23: ...4 ...
Page 25: ...6 ...
Page 27: ...8 ...
Page 29: ...10 ...
Page 31: ...12 ...
Page 33: ...14 ...
Page 37: ...18 ...
Page 39: ...20 ...
Page 41: ...22 ...
Page 43: ...24 ...
Page 45: ...26 ...
Page 47: ...28 ...
Page 49: ...30 ...
Page 81: ...62 ...
Page 82: ...63 Clear RAM Microcontroller Products Semiconductor Group Texas Instruments ...
Page 83: ...64 ...
Page 85: ...66 ...
Page 86: ...67 RAM Self Test on the TMS370 Microcontroller Products Semiconductor Group Texas Instruments ...
Page 87: ...68 ...
Page 89: ...70 ...
Page 90: ...71 ROM Checksum on the TMS370 Microcontroller Products Semiconductor Group Texas Instruments ...
Page 91: ...72 ...
Page 95: ...76 ...
Page 97: ...78 ...
Page 98: ...79 Bubble Sort With the TMS370 Microcontroller Products Semiconductor Group Texas Instruments ...
Page 99: ...80 ...
Page 101: ...82 ...
Page 103: ...84 ...
Page 105: ...86 ...
Page 109: ...90 ...
Page 115: ...96 ...
Page 117: ...98 ...
Page 119: ...100 ...
Page 121: ...102 ...
Page 125: ...106 ...
Page 127: ...108 ...
Page 207: ...188 ...
Page 209: ...190 ...
Page 211: ...192 ...
Page 213: ...194 ...
Page 219: ...200 ...
Page 221: ...202 ...
Page 313: ...294 ...
Page 315: ...296 ...
Page 319: ...300 ...
Page 323: ...304 ...
Page 324: ...305 T1PWM Set Up Routines Microcontroller Products Semiconductor Group Texas Instruments ...
Page 325: ...306 ...
Page 327: ...308 ...
Page 329: ...310 ...
Page 331: ...312 ...
Page 387: ...368 ...
Page 389: ...370 ...
Page 393: ...374 ...
Page 395: ...376 ...
Page 396: ...377 PACT Command Macros Microcontroller Products Semiconductor Group Texas Instruments ...
Page 397: ...378 ...
Page 403: ...384 ...
Page 405: ...386 ...
Page 459: ...440 ...
Page 461: ...442 ...
Page 467: ...448 ...
Page 469: ...450 ...
Page 471: ...452 ...
Page 475: ...456 ...
Page 477: ...458 ...
Page 479: ...460 ...
Page 483: ...464 ...
Page 485: ...466 ...
Page 487: ...468 ...
Page 491: ...472 ...
Page 492: ...473 Part V External Memory Expansion Examples ...
Page 493: ...474 ...
Page 495: ...476 ...
Page 497: ...478 ...
Page 499: ...480 ...
Page 513: ...494 ...
Page 515: ...496 ...
Page 521: ...502 ...
Page 523: ...504 ...
Page 525: ...506 ...
Page 545: ...526 ...
Page 547: ...528 ...