Specifications
Protocol Definitions
C-15
TMS320F240x Boot ROM Loader: Protocols and Interfacing
;*****************************************************************************
;
;G E T _ W O R D
;
;This routine gets a word from the EEPROM and packs it.
;It’s returned in the accumulator
;
;
;
;Exit Conditions:
; 1. DP is set to B1 on Exit.
; 2. ACC,GPR0 are destroyed.
; 3. Result returned in ACC
; 4. Doesnt care about DP on enter.
;
;*****************************************************************************
GET_WORD: LACC #0000H ;Zero Character
CALL XMIT_VALUE ;Transmit char & get response
POINT_B1
AND #0FFH ;MSByte of start address is in the
;acc. Get rid of any higher bits
SACL GPR0 ;
LACC #0000H ;Zero Character
CALL XMIT_VALUE ;Transmit char & get response
POINT_B1
;LSByte of start address is in ACC
AND #00FFH ;Mask any upper byte
ADD GPR0,8 ;Bring in the MS Byte.
RET
;*****************************************************************************
; Transmit a char on the SPI Bus and return received data in accumulator
;
;
;Exit Conditions:
; 1. DP is set to B1 on Exit
; 2. ACC is destroyed.
; 3. Doesnt care about DP on enter
;
;*****************************************************************************
XMIT_VALUE: LDP #SPITXBUF>>7
SACL SPITXBUF ;Write xmit value to SPI TX Buffer.
XMIT_NCOMPL: BIT SPISTS,BIT6 ;Test SPI_INT bit
BCND XMIT_NCOMPL,NTC ;If (bit=TC=0) ,then wait for TX Compl
;i.e. wait for the completion of TX
LACC SPIRXBUF ;Read,also clears SPI_INT flag.
RET
;*****************************************************************************
; The rest of the implementation is the Asynchronous serial port loader.
;*****************************************************************************










