Specifications
Protocol Definitions
C-13
TMS320F240x Boot ROM Loader: Protocols and Interfacing
LDP #0E0h
.endm
;*****************************************************************************
; M A I N C O D E – starts here
;*****************************************************************************
.text
START: LDP #WDCR>>7
SPLK #0060h,SCSR ;CLKOUT=CPUCLK
SELECT_LOADER:
LDP #PCDATDIR>>7
SPLK #0000H,PCDATDIR ;Config all as i/ps.
;We DEPEND on SPI Pins to be I/Os by
;default at reset(controlled by OCRB).
LACC PCDATDIR
AND #0004H ;Mask for check on IOPC2.
BCND SCI_LOADER,EQ ;if IOPC2 is low, branch to SCI load
;else SPI loader and set SPISTE high.
SETC XF ;Drive (!CS=XF) High.
;*****************************************************************************
; SPI Initialization
;*****************************************************************************
SPI_INIT: LACC OCRB ;Set up the SPI pins to primary
;functions.
OR #001CH
SACL OCRB
LDP #SPICCR>>7
SPLK #0007h, SPICCR ;8 char bits,
SPLK #000Eh, SPICTL ;Enable master mode and enable talk.
SPLK #007fh, SPIBRR ;SPI Speed =ASAP = as slow as possible
SPLK #0087h,SPICCR ;Relinquish SPI from Reset.
;*****************************************************************************
;Select the Serial EEPROM
;by driving the select line low.
;*****************************************************************************
CS_ACTIVE CLRC XF ;Drive (!CS=XF) Low.
;*****************************************************************************
;Next send the Serial EEPROM a ’Read Command’ – it is then
;read out in burst mode, two bytes at a time by using GET_WORD
; Note that CS stays low all the time.
;*****************************************************************************
LACC #READ_COMMAND ;Load Read Command for EEPROM
CALL XMIT_VALUE ;Transmit Read Command.
;*****************************************************************************
;Now send a word(16 bits) to the EEPROM as address.
;Hard coded zero bytes are sent by the GET_WORD, but this is fine
; since we define the EEPROM to contain boot code at origin.
;










