Public Version
McSPI Basic Programming Model
www.ti.com
5. Set the SPI1.
[6] EPOL bit to 1 for spi1_cs0 activated low during active state.
6. Set the SPI1.
[1] POL bit to 0 for spi1_clk held high during active state.
7. Set the SPI1.
[0] PHA bit to 0 for data latched on odd-numbered edges of the SPI
clock.
Clock Initialization and spi1_cs0 Enable
In master mode, the SPI must provide the clock and enable the channel:
8. Set the SPI1.
[2] MS bit to 0 to provide the clock.
9. Set the SPI1.
[0] EN bit to 1 (where x = 0) to enable channel 0.
20.6.2.6.2.1.2 Write Operation
1. Write 1 to the SPI1.
[0] TX0_EMPTY bit to reset the status.
2. Write the command/address or data value in the SPI1.MCSPI_TX0 register to transmit the value.
3. If the SPI1.
[0] TX0_EMPTY bit is set to 1, write 1 to it and return to Step 2
(polling method).
20.6.2.6.2.1.3 Read Operation
1. Read the SPI1.
[2] RX0_FULL bit and if it is set to 1, go to Step 2.
2. If the SPI1.
[2] RX0_FULL bit is set to 1, write 1 to it and return to Step 1 (polling
method).
NOTE:
Write and read operations can be performed simultaneously.
20.6.2.6.3 Programming in Interrupt Mode
This section follows the flow of
.
1. Initialize software variables: WRITE_COUNT = 0 and READ_COUNT = 0.
2. Initialize interrupts: Write 0x7 in the SPI1.
[3:0] field and set the
[3:0] field to 0x7.
3. Follow the steps described in
, Mode Selection.
4. If WRITE_COUNT = w and READ_COUNT = w, write SPI1.
[0] = 0x0 (x = 0) to stop
the channel.
This interrupt routine follows the flow of
and
.
1. Read the SPI1.
[3:0] field.
2. If the SPI1.
[0] TX0_EMPTY bit is set to 1:
(a) Write the command/address or data value in SPI1.
(where x = 0).
(b) WRITE = 1
(c) Write SPI1.
[0] = 0x1.
3. If the SPI1.
[2] RX0_FULL bit is set to 1:
(a) Read SPI1.
(where x = 0)
(b) READ= 1
(c) Write SPI1.
[2] = 0x1
20.6.2.6.4 Operations for the Second Slave (on Channel 1) in Polling Mode
20.6.2.6.4.1 Mode Selection
The SPI1.
register (with x = 1) allows configuration of the operating mode:
1. Set the SPI1.MCSPI_CH1CONF[18] IS bit to 0 for the spi1_somi pin in receive mode.
2. Set the SPI1.MCSPI_CH1CONF[17] DPE1 bit to 0 and the SPI1.MCSPI_CH1CONF[16] DPE0 bit to 1
for the spi1_somi pin in transmit mode.
3. Set the SPI1.MCSPI_CH1CONF[13:12] TRM field to 0x0 for transmit-and-receive mode.
3024
Multichannel SPI
SWPU177N – December 2009 – Revised November 2010
Copyright © 2009–2010, Texas Instruments Incorporated
Содержание OMAP36 Series
Страница 174: ...174 List of Tables SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 692: ...692 MPU Subsystem SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 1084: ...1084 IVA2 2 Subsystem SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 1990: ...1990 2D 3D Graphics Accelerator SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2334: ...2334 Memory Subsystem SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2700: ...2700 Memory Management Units SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2868: ...2868 HDQ 1 Wire SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 2974: ...2974 UART IrDA CIR SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3054: ...3054 Multichannel SPI SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3462: ...3462 MMC SD SDIO Card Interface SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3508: ...3508 General Purpose Interface SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3584: ...3584 Initialization SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...
Страница 3648: ...3648 Debug and Emulation SWPU177N December 2009 Revised November 2010 Copyright 2009 2010 Texas Instruments Incorporated ...