Motorola MPC823e Reference Manual page 907

Microprocessor for mobile computing
Table of Contents

Advertisement

16.12.4.4 SPI MASK REGISTER. The 8-bit read/write SPI mask (SPIM) register has the
same bit formats as the SPIE register. If a bit in the SPIM is 1, the corresponding interrupt
in the SPIE register is enabled. If the bit is zero, the corresponding interrupt in the SPIE
register is masked. This register is cleared by reset.
SPIM
BIT
0
1
FIELD
RESERVED
RESET
0
R/W
R/W
ADDR
16.12.5 SPI Master Programming Example
The following is an example initialization sequence using the serial peripheral interface in
master mode at high speed.
1. Configure the port B pins to enable the SPIMOSI, SPIMISO, and SPICLK pins. Write
PBPAR and PBDIR bits 30, 29, and 28 with ones and then PBODR bits 30, 29, and 28
with zeros.
Note: For multimaster operation, enable the SPISEL pin to internally connect to the
serial peripheral interface.
2. Configure a parallel I/O pin to operate as the serial peripheral interface select pin if
needed. If PB16 is chosen, write PBODR bit 16 with a zero, PBDIR bit 16 with a one,
and PBPAR bit 16 with a zero. Then write PBDAT bit 16 with a zero to constantly
assert the select pin.
3. Write RBASE and TBASE in the SPI parameter RAM to point to the RX buffer
descriptor and TX buffer descriptor in the dual-port RAM. Assuming one RX buffer
descriptor is at the beginning of the dual-port RAM and one TX buffer descriptor
follows that RX buffer descriptor, write RBASE with 0x2000 and TBASE with 0x2008.
4. Program the CPM command register (CPCR) to execute the INIT RX AND TX
PARAMS command. Write 0x0051 to the CPCR.
5. Write 0x0001 to the SDCR to initialize the SDMA configuration register.
6. Write 0x18 to RFCR and TFCR for normal operation.
7. Write MRBLR with the maximum number of bytes per receive buffer. In this case,
assume 16 bytes, so MRBLR = 0x0010.
8. Initialize the RX buffer descriptor and assume the RX data buffer is at 0x00001000 in
main memory. Write 0xB000 to RX_BD_Status, 0x0000 to RX_BD_Length (optional),
and 0x00001000 to RX_BD_Pointer.
MOTOROLA
2
3
4
MIME
TXE
RES
0
0
0
R/W
R/W
R/W
(IMMR & 0xFFFF0000) + 0xAAA
MPC823e REFERENCE MANUAL
Communication Processor Module
5
6
BSY
TXB
RXB
0
0
R/W
R/W
R/W
7
0
16-453

Advertisement

Table of Contents
loading

Table of Contents