Synchronous Serial Interface Master (Spia_Master) - Epson S1C31D01 Software Manual

Cmos 32-bit single chip microcontroller peripheral circuit sample software manual
Table of Contents

Advertisement

3.15 Synchronous Serial Interface Master (SPIA_MASTER)

SPIA module is a synchronous serial interface supporting both master and slave modes. Only one SPIA channel
is available in S1C31D01 microcontroller.
This example provides a description of how to use an SPIA channel in the master mode to transfer data buffer.
Hardware Setup
1. Connect the evaluation boards where the SPIA master/slave sample programs are installed.
Connect each port as follows:
[master]
P32
SDIn------------<<-----------SDOn
P33
SDOn------------>>-----------SDIn
P34 SPICLKn------------>>-----------SPICLKn P34
P35
------------>>-----------#SPISSn P35
P36
------------>>-----------
J2.47
GND------------><-----------GND
2. Launch the slave example program first, then the master program
Operations
1. Initialize the SPIA module in master mode as below:
- Data length is 8bit
- Data format is MSB first
- Use 16-bit timer T16_1 for baud rate generator.
2. Set bus speed to 1000000.
3. Assign GPIO P36 as output to set Read/Write command to the slave.
4. Send the 'BUF_SIZE' bytes of random data to the slave.
5. Receive the 'BUF_SIZE' bytes of data from the slave.
6. Compare whether the received data is the same as the sent data and exit.
Example of Output
-CPU clock- seCLG_IOSC (20000000)
Set bus speed 1000000
Get bus speed 1000000
OK(1), NG(0)
OK(2), NG(0)
OK(3), NG(0)
OK(4), NG(0)
OK(5), NG(0)
OK(6), NG(0)
50
[slave]
P33
P32
P36
J2.47
Seiko Epson Corporation
S1C31D01 Peripheral Circuit Sample
Software Manual (Rev.3.00)

Advertisement

Table of Contents
loading

Table of Contents