16. USART2
A96G150 User's manual
232
16.9
SPI mode
The USART2 can be set to operate in industrial standard SPI compliant mode. The SPI mode has the
following features.
Full duplex, three-wire synchronous data transfer
Master or Slave operation
Supports all four SPI modes of operation (mode0, 1, 2, and 3)
Selectable LSB first or MSB first data transfer
Double buffered transmit and receive
Programmable transmit bit rate
When SPI mode is enabled (UMSEL[1:0]=3), the Slave Select (SS2) pin becomes active low input in
slave mode operation, or can be output in master mode operation if SPISS bit is set.
Note that during SPI mode of operation, the pin RXD2 is renamed as MISO2, and TXD2 is renamed as
MOSI2 for compatibility to other SPI devices.
16.9.1
SPI clock formats and timing
To accommodate a wide variety of synchronous serial peripherals from different manufacturers, the
USART2 has a clock polarity bit (UCPOL) and a clock phase control bit (UCPHA) to select one of four
clock formats for data transfers. UCPOL selectively inserts an inverter in series with a clock. UCPHA
selects one of two different clock phase relationships between the clock and the data. Note that UCPHA
and UCPOL bits in UCTRL1 register have different meanings according to the UMSEL[1:0] bits which
decides the operating mode of USART2.
Table 35 shows four combinations of UCPOL and UCPHA for SPI mode 0, 1, 2, and 3.
Table 35. CPOL Functionality
SPI Mode
UCPOL
UCPHA
Leading Edge
Trailing Edge
0
0
0
Sample (Rising)
Setup (Falling)
1
0
1
Setup (Rising)
Sample (Falling)
2
1
0
Sample (Falling)
Setup (Rising)
3
1
1
Setup (Falling)
Sample (Rising)
Содержание A96G150
Страница 126: ...12 Timer 0 1 2 3 4 5 A96G150 User s manual 126 Figure 43 16 bit Timer Counter Mode Operation Example...
Страница 136: ...12 Timer 0 1 2 3 4 5 A96G150 User s manual 136 Figure 51 16 bit Timer Counter Mode Operation Example...
Страница 147: ...A96G150 User s manual 12 Timer 0 1 2 3 4 5 147 Figure 59 16 bit Timer Counter Mode Operation Example...
Страница 157: ...A96G150 User s manual 12 Timer 0 1 2 3 4 5 157 Figure 67 16 bit Timer Counter Mode Operation Example...
Страница 171: ...A96G150 User s manual 14 12 bit ADC 171 Figure 79 ADC Operation Flow Sequence...
Страница 333: ...A96G150 User s manual Revision history 333 Revision history Revision Date Notes 1 00 2022 06 22 First creation...