English
Language : 

MG74PG1B08 Datasheet, PDF (87/128 Pages) Megawin Technology Co., Ltd – Keypad Interrupt function on all GPIO
16.7. Serial Port 0 Mode 6 (SPI Slave)
The serial port 0 mode 6 in MG74PG1B08 supports SPI slave mode. The Mode 6 is selected by SM30, SM00 and
SM10. Table 16–10 shows the serial port 0 mode definition in MG74PG1B08.
Table 16–10. Serial Port 0 Mode Selection
SM30 SM00 SM10 Mode
0
0
0
0
0
0
1
1
0
1
0
2
0
1
1
3
1
0
0
4
1
0
1
5
1
1
0
6
1
1
1
7
Description
shift register
8-bit UART
9-bit UART
9-bit UART
SPI Master
Reserved
SPI Slave
Reserved
Baud Rate
SYSCLK/12 or SYSCLK/4
variable
SYSCLK/64, /32
variable
SYSCLK/12 or SYSCLK/4
Reserved
Up to SYSCLK/8
Reserved
The SPI slave in MG74PG1B08 uses the TXD0 as SPICLK, RXD0 as MOSI, and a dedicated MISO and nSS.
Figure 16–15 shows the SPI connection for multiple slave MCU communication.
The SPI slave engine of serial port 0 mode 6 serves the maximum SPI clock rate up to SYSCLK/8. If SYSCLK =
12MHz, MG74PG1B08 can receive the maximum frequency of SPICLK is 1.5MHz. This mode also supports the
CPHA and SSIG options and the control bits are located on SADEN.1 and SADEN.0. But, there is no CPOL option
in this chip. MG74PG1B08 builds an automatic detection scheme on SPICLK clock polarity in the SPI slave engine.
When CPHA is 0, SSIG must be 0 and nSS pin must be negated and reasserted between each successive serial
byte transfer. Note the S0BUF register cannot be written while nSS pin is active (low), and the operation is
undefined if CPHA is 0 and SSIG is 1.
When CPHA is 1, SSIG may be 0 or 1. If SSIG=0, the nSS pin may remain active low between successive transfers
(can be tied low at all times). This format is sometimes preferred for use in systems having a single fixed master and
a single slave configuration.
Figure 16–15. Serial Port 0 Mode 6, Single Master and Multiple Slaves configuration
SPICLK
MOSI
MISO
nSS0
MCU0 Serial Port
SPICLK (TXD0)
MOSI (RXD0)
MISO
nSS
Mode 6
(Slave)
SPI
Master
nSS1
MCU1 Serial Port
SPICLK (TXD0)
MOSI (RXD0)
MISO
nSS
Mode 6
(Slave)
MEGAWIN
MG74PG1B08 Data Sheet
87