Page 2
2. This evaluation board/kit or development tool is intended for use by an electronics engineer and is not a consumer product. The user should use it properly and in a safe manner. Seiko Epson dose not assume any responsibility or liability of any kind of damage and/or fire caused by the use of it. The user should cease to use it when any abnormal issue occurs even during proper and safe use.
1. Overview This manual describes how to use the example software provided for the S1C31D01 Microcontroller and shows the expected output when running the example software. The example software is included in the S1C31D01 Sample Software and Peripheral Drivers software package. It is intended to demonstrate how to use the various peripheral circuits in the S1C31D01 microcontroller.
(“xxx.c”) and an include file (“xxx.h”). The include file describes the constants, types, and functions for each library module. The S1C31D01 Sample Software is organized in the “Examples” folder. In most cases, the peripheral module is presented in one corresponding example project. For example, the CLG (Clock Generator) project focuses on the CLG peripheral module.
Page 7
The settings.h file is where the default boot-up behavior is changed by selecting the appropriate defines. The meaning of each setting is described in Table 2.1.1. Table 2.1.1 S1C31D01 Board Defines Configuration Feature Defined Un-defined UART_PRINTF The standard library printf function The semihosting library printf function outputs to the UART console.
Figure 2.2.2.1 USB Adapter for UART Connection Example to S5U1C31D01T1 Evaluation Board USB to PC J2-27 (P21) J2-25 (P22) J2-47 (GND) USB adapter for UART S5U1C31D01T1 Evaluation Board Figure 2.2.2.2 USB Adapter for UART Wiring to S5U1C31D01T1 Evaluation Board Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Page 9
Parity None For more information on S5U1C31D01T1 evaluation board, refer to the “S5U1C31D01T1 Manual”. Notes: USB adapter for UART used in Figure 2.2.2.1 is a commercial product, not provided by Seiko Epson. Please purchase as necessary. Seiko Epson Corporation S1C31D01 Peripheral Circuit...
Before executing the sample software using the IAR EWARM, you need to set up the sample software. To set up the sample software, follow the procedure below. (1) Download the sample software Download the S1C31D01 Peripheral Circuit Sample Software Package (.exe) from Seiko Epson microcontroller web site. (2) Install the Peripheral Circuit Sample Software Package Close all other programs during this installation.
[File] > [Open] > [Workspace] in the IAR EWARM menu, navigate to the project’s “board\S5U1C31D01T1\IAR” folder, and open the workspace file (.eww). Figure 2.3.2.1 Example of Multi-Project Workspace Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
The optimization level is set to “low”. • ReleaseFlash - Build configuration to execute code in internal flash memory The optimization level is set to “high”. Drop-Down List Right-click Menu Figure 2.3.3.1 Active Project Setting Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
(3) Select the [Setting] tab, and then select the debug probe in the [Driver] drop-down list as shown below (Figure 2.3.4.1). - When using the I-jet , select the “I-jet/JTAGjet”. - When using the J-Link, select the “J-Link/J-Trace”. Figure 2.3.4.1 Debug Probe Setting Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
When [Use flash loader(s)] is selected, select [Override default .board file] and select the .board file for the flash loader to be used by clicking the [...] button. Figure 2.3.5.1 Flash Loader Setting Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
When the active project is “DebugFlash” build or “ReleaseFlash” build, the program image is loaded in the internal flash memory and debugging is started. Figure 2.3.7.1 Download and Debug Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Before executing the sample software using the MDK-ARM (uVision), you need to set up the sample software. To set up the sample software, follow the procedure below. (1) Download the sample software Download the S1C31D01 Peripheral Circuit Sample Software Package (.exe) from Seiko Epson microcontroller web site. (2) Install the Peripheral Circuit Sample Software Package Close all other programs during this installation.
[Project] > [Open Project…] in uVision menu, navigate to the project’s “board\S5U1C31D01T1\ARM” folder, and open the workspace file (.uvmpw). Figure 2.4.2.1 Example of Multi-Project Workspace Figure 2.4.2.2 Example of Individual Project Workspace Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
(J - Link) setting is applied to all projects in the sample software. However, if the debug probe does not recognize normally, follow the above procedure to check the settings. Figure 2.4.4.1 Debug Probe Selecting Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
In the examples using “Debug” build, we use the “debug.ini” file to set those values correctly. In the example using “DebugFlash” build, the [Initialization File] field should be left blank. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Examples and by default constructs both the Debug and DebugFlash builds for each of the appropriate projects. The projects in the list are ordered such that the libraries are built first (Figure 2.4.6.2). Figure 2.4.6.1 Build Commands Figure 2.4.6.2 Batch Build Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
To debug the program image downloaded to the target board, select the [Debug] > [Start/Stop Debug Session] in uVision menu (Figure 2.4.7.2). Figure 2.4.7.1 Download Figure 2.4.7.2 Debug Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Destination height = Destination Center X = Compensated center coordinate of transformation for the destination image Destination Center Y = XLSCALE = XRSCALE = Compensated scaling values YTSCALE = YBSCALE = Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Page 28
If the utility will gives warning such as “Cannot get a good fit”, please try adjusting the input and output parameters. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
The C header output file (.h) can be used in C code to include the font set in ROM data. The binary format output file (.mdcfont) can be used by MDCSerFlashImg.exe tool for downloading to N25Q128 Serial NOR Flash memory chip on the S5U1C31D01T1 evaluation board. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
NOR Flash memory chip on the S5U1C31D01T1 evaluation board. The hex format output file (.hex) can be used by an external serial flash programming tool to preprogram the N25Q128 Serial NOR Flash memory chip. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
The tool will not accept files larger than 1 MBytes and total image size cannot be larger than 16 MBytes. Before downloading the binary image into the flash memory, connect the J-Link debugger to PC and the evaluation board. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
“FlashTools\S5U1C31D01T1\README.txt” file of the S1C31D01 Sample Software package to install the flash loader binaries for the S1C31D01 internal Flash and the N25Q128 Serial NOR Flash into the SEGGER installation folders and supported devices list. The “README.txt” file also provides instructions on using the J-Link Commander software to program binary files into the S1C31D01 internal Flash or N25Q128 Serial NOR Flash.
The DMAC interrupts in NVIC are not enabled. DMAC Channel transfer is enabled. DMAC Channel filtering is disabled for the selected DMAC Channel. Source address incrementing is enabled. Destination address incrementing is disabled. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Page 35
10. Once interrupt flag is generated it sets a software completion flag in the DMAC interrupt service routine. 11. The Transfer Complete Interrupt flag is then cleared. 12. Software detects both transfer completion. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Page 36
-CPU clock- seCLG_IOSC (20000000) DMA Initializing DMA Test: Memory DMA Test: SNDA DMA Test: UART Type 8 characters... 12345678 – 8 characters have been sent back to UART DMA Test: T16B Exit Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
- (wake up from sleep) - Erase the "second" hand. - Erase the "hour" hand. - Erase the "minute" hand. - Fill "weekday" area with white. - Erase digital time text Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
- (wake up from sleep) - Erase the "second" hand. - Erase the "hour" hand. - Erase the "minute" hand. - Fill "weekday" area with white. - Erase digital time text. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
- Erase digital time string. - Erase the "second" hand. - Erase the "hour" hand. - Erase the "minute" hand. - Fill "weekday" area with white.Start OSC1 and change IOSC frequency to 20MHz. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
3.7 I/O Ports (PPORT) The PPORT module controls the general-purpose input/output (GPIO) pins of the S1C31D01. This example configures pin P35 as an output connected to pin P36 configured as an input. It performs various tests to check the connectivity of P35 and P36.
Read flash in DUAL mode: OK Compare R/W data in DUAL mode: OK Set external flash in SINGLE mode: OK Set QSPI in SINGLE mode. Read external flash register in SINGLE mode: OK Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Page 44
Erase flash sector in SINGLE mode: OK Program flash in SINGLE mode: OK Read flash in SINGLE mode: OK Compare R/W data in SINGLE mode: OK Exit Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Set external flash in QUAD mode: OK QSPI Start: OK Read flash using DMA in Memory Mapped QUAD mode: OK Compare R/W data using DMA in Memory Mapped QUAD mode: OK Exit Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Uncomment out QSPI_MODE_SINGLE in settings.h for the single mode setup. SINGLE mode [master] [slave] TH39 QSDI0n0------------->>----------QSDIOn1 TH38 TH38 QSDI0n1------------><-----------QSDIOn0 TH39 TH40 QSPICLKn------------>>-----------QSPICLKn TH40 TH32 #QSPISSn------------>>-----------#QSPISSn TH32 J2.1 P36------------>>-----------P36 J2.1 J2.47 GND------------><-----------GND J2.47 Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Page 47
-CPU clock- seCLG_IOSC (20000000) Get bus speed 123456 Set bus speed 100000 Get bus speed 100000 Set QSPI_0 in SINGLE mode. - OK(1), NG(0) - OK(2), NG(0) - OK(3), NG(0) Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Please note that the connections are different for single mode. SINGLE mode [master] [slave] TH39 QSDI0n0------------->>----------QSDIOn1 TH38 TH38 QSDI0n1------------><-----------QSDIOn0 TH39 TH40 QSPICLKn------------>>-----------QSPICLKn TH40 TH32 #QSPISSn------------>>-----------#QSPISSn TH32 J2.1 P36------------>>-----------P36 J2.1 J2.47 GND------------><-----------GND J2.47 Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Page 50
2. Assign GPIO P36 as input and enable interrupt on rising edge to detect a start of communication 3. Receive the 'BUF_SIZE' bytes of random data from the master 4. Send the 'BUF_SIZE' bytes of data back to the master Example of Output Slave has no output. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
5. When a T16 Ch.0 interrupt occurred, check whether the same switch SW2 to SW3 was pushed. If the same switch was pushed, set the register values of REMC3 so that a repeat waveform is generated, initialize REMC3 before activation, and activate REMC3. Otherwise, stop the T16 Ch.0 operation. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
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.
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 a SPIA channel in the slave mode to transfer data buffer.
Example of Output - CPU clock- seCLG_IOSC (20000000) SVD is configured to detect the voltage drop. Please Disconnect USB cable. Power voltage drop detected Interrupt Low voltage occurred IRQ handler called Exit Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
5. Counts a number of interrupts happened during 5 second interval. Example of Output -CPU clock- seCLG_IOSC (20000000) CLG IOSC Auto-trimming ok IRQ interrupted: 1695 times during 5 sec Exit Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
- (wake up from sleep) - Fill temperature display area with white. - Erase the "second" hand. - Erase the "hour" hand. - Erase the "minute" hand. - Fill "weekday" area with white. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
4. When typing of the 8 characters completed the characters are sent back to the terminal program window. Example of Output -CPU clock- seCLG_IOSC (20000000) abcefghiabcefghi ... waiting for console input... 1234567812345678 Exit Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
The example application echoes back the character received from the COM PORT. Hardware Setup Jumper on J2 pins 35 and 36 must be installed. Connect evaluation board to PC by USB cable. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Operations 1. On the PC side, start the Tools\HidClient.exe utility. 2. In the utilities window select EPSON CMSIS-HID 3. Click on outputs to observe bits on the S5U1C31D01T1 evaluation board display. 4. Push SW2, SW3 buttons on the board to observe inputs in the HidClient.exe utility window.
1. Jumper on J2 pins 35 and 36 must be installed. 2. Connect the evaluation board to PC by USB cable. Example of Output -CPU clock- seCLG_IOSC (20000000) Reset Suspend Resume Reset Reset Configure Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
3.26 Flash Programming (Flash) This example erases and programs the internal flash memory in the S1C31D01 using the seFlashLibrary. The seFlashLibrary is implemented based on the specification of the CMSIS-Driver Flash Interface. Operations 1. Call the GetInfo() function to get the information on the internal flash memory.
3.27 EEPROM Emulation Library (EEPROM) This example writes data to the emulated EEPROM which uses the internal flash memory of the S1C31D01 using the seEepromLibrary, and then reads back and compares the data to expected values. Emulated EEPROM uses 256 bytes of internal Flash memory for each byte of EEPROM. The Flash area from 0x20000 to 0x3FFFF is used for EEPROM emulation and provides 512 bytes of EEPROM with 100,000 read/write cycles.
3.28 Boot Loader (BootLoader) This example loads a program transmitted from the outside by UART communication. For details of this example, refer to "S1C31D01 Boot Loader Manual" on the separate document. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Note: Depending on the version of the free trial version IDE, example projects may not be build. Also, the above table is not intended to guarantee the operation of example projects to be built using the free trial version IDE. Seiko Epson Corporation S1C31D01 Peripheral Circuit Sample Software Manual (Rev.3.00)
Need help?
Do you have a question about the S1C31D01 and is the answer not in the manual?
Questions and answers