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 coursed by the use of it.
PREFACE Preface This is a technical manual for designers and programmers who develop a product using the S1C17M01. This document describes the functions of the IC, embedded peripheral circuit operations, and their control methods. For the CPU functions and instructions, refer to the “S1C17 Family S1C17 Core Manual.” For the functions and operations of the debugging tools, refer to the respective tool manuals.
Page 12
B.1 Operating Status Configuration Examples for Power Saving ........AP-B-1 B.2 Other Power Saving Methods ..................AP-B-2 Appendix C Mounting Precautions ................AP-C-1 Appendix D Measures Against Noise ................ AP-D-1 Appendix E Initialization Routine ................AP-E-1 Revision History Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
1 OVERVIEW 1 Overview The S1C17M01 is an ultra low-power MCU equipped with an MR (magnetoresistive) sensor controller that al- lows an MR sensor array optimized for flow measurement (recommended sensor: KG1205-61 manufactured by KOHDEN Co., Ltd.) to be connected directly. This IC includes an LCD driver to display the flow count and the...
Page 14
IOSC = ON, OSC1 = 32 kHz, RTC = ON, CPU = IOSC, LCD = OFF (no panel load) Shipping form QFP13-64PIN (P-LQFP064-1010-0.50, 10 × 10 mm, t = 1.7 mm, 0.5 mm pitch) Die form (Pad pitch: 100 µm) *1 Shown in parentheses is a JEITA package name. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 20
OSC1 OSC1 – – OSC1 oscillator circuit input OSC2 OSC2 – – OSC1 oscillator circuit output Note: In the peripheral circuit descriptions, the assigned signal name is used as the pin name. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
SLEEP mode (when all oscillators are stopped, or OSC1 only is active) When a clock source except for OSC1 is active HALT mode (when OSC1 only is active) RUN mode (when OSC1 only is active) Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
#RESET pin, so the pin can be left open. For the #RESET pin characteris- tics, refer to “#RESET pin characteristics” in the “Electrical Characteristics” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
• IOSCCLK output from the IOSC oscillator circuit is used as the boot clock for fast booting. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
2.3.3 Clock Sources IOSC oscillator circuit The IOSC oscillator circuit features a fast startup and no external parts are required for oscillating. Figure 2.3.3.1 shows the configuration of the IOSC oscillator circuit. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 25
EXOSC clock input EXOSC is an external clock input circuit that supports square wave and sine wave clocks. Figure 2.3.3.3 shows the configuration of the EXOSC clock input circuit. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Furthermore, the oscillation start time being actually reduced depends on the characteristics of the resonator used. Figure 2.3.4.2 shows an operation example when the oscillation start- up control circuit is used. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 27
0x0096 to the MSCPROT.PROT[15:0] bits before the register setting can be altered. For the transition between the operating modes including the system clock switching, refer to “Operating Mode.” Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 28
CLGSCLK.CLKSRC[1:0] = 0x1 (OSC1) CLGSCLK.CLKSRC[1:0] = 0x0 (IOSC) CLGSCLK.WUPSRC[1:0] = 0x0 (IOSC) CLGSCLK.WUPSRC[1:0] = 0x0 (IOSC) ∗ Switching to IOSC that features fast initiation allows high-speed processing. Figure 2.3.4.4 Clock Control Example at SLEEP Cancelation Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 29
7. The OSC1 oscillation stops if the CLGINTF.OSC1STPIF bit = 1 after an interrupt occurs. If the CLGOSC1.OSDRB bit = 1, the hardware restarts the OSC1 oscillator circuit. Note: Enabling the oscillation stop detection function increase the oscillation stop detector current OSD1 Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
When a debug interrupt occurs, the CPU enters DEBUG mode. DEBUG mode is canceled when the retd in- struction is executed. For more information on DEBUG mode, refer to “Debugger” in the “CPU and Debugger” chapter. Seiko Epson Corporation 2-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
For more information on interrupt control, refer to the “Interrupt Controller” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 2-11 (Rev. 1.2)
CLKSRC[1:0] bits and the CLGSCLK.CLKDIV[1:0] bits, respectively. If the same clock source and division ratio as those that are configured before placing the IC into SLEEP mode are used at wake-up, set the CLKSCLK.WUPMD bit to 0. Bit 14 Reserved Seiko Epson Corporation 2-12 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
• The auto-trimming function does not work if the OSC1 oscillator circuit is stopped. Make sure the CLGINTF.OSC1STAIF bit is set to 1 before starting the trimming operation. Bits 3–0 Reserved Seiko Epson Corporation 2-14 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
For more information, refer to “OSC1 oscillator circuit characteristics, Internal gate capacitance C ” in the “Electrical Characteristics” chapter. Bits 7–6 INV1B[1:0] These bits set the oscillation inverter gain that will be applied at boost startup of the OSC1 oscillator circuit. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 2-15 (Rev. 1.2)
CLGINTE.IOSCSTAIE bit: IOSC oscillator circuit CLG FOUT Control Register Register name Bit name Initial Reset Remarks CLGFOUT 15–8 – 0x00 – – – – 6–4 FOUTDIV[2:0] 3–2 FOUTSRC[1:0] – – FOUTEN Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 2-17 (Rev. 1.2)
Page 38
0 (R/W): Disable external output Note: Since the FOUT signal generated is out of sync with writings to the CLGFOUT.FOUTEN bit, a glitch may occur when the FOUT output is enabled or disabled. Seiko Epson Corporation 2-18 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
3 CPU AND DEBUGGER 3 CPU and Debugger 3.1 Overview This IC incorporates the Seiko Epson original 16-bit CPU core (S1C17) with a debugger. The main features of the CPU core are listed below. • Seiko Epson original 16-bit RISC processor...
DBRUN bit, refer to “Clock Supply in DEBUG Mode” in each peripheral circuit chapter. DE- BUG mode continues until a cancel command is sent from the personal computer or the CPU executes the retd in- struction. Neither hardware interrupts nor NMI are accepted during DEBUG mode. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
For the recommended pull-up resistor value, refer to “Recommended Operating Conditions, DSIO pull-up resis- tor R ” in the “Electrical Characteristics” chapter. R is not required when using the DSIO pin as a general- purpose I/O port pin. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
– 23–0 DBRAM[23:0] *1 Debugging work area start address Bits 31–24 Reserved Bits 23–0 DBRAM[23:0] The start address of the debugging work area (64 bytes) can be read out with these bits. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Access size designated by the CPU instructions (e.g., ld %rd, [%rb] → 16-bit data transfer) Table 4.2.1 lists numbers of bus access cycles by different device size and access size. The peripheral circuits can be accessed with an 8-bit, 16-bit, or 32-bit instruction. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The number of bus access cycles for reading can be configured using the FLASHCWAIT.RDWAIT[1:0] bits. Select a setting for higher frequency than the system clock. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Note: The 64 bytes at the end of the RAM is reserved as the debug RAM area. When using the debug functions under application development, do not access this area from the application program. This area can be used for applications of mass-produced devices that do not need debugging. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
FLASHCWAIT.RDWAIT[1:0] bits Number of bus Access cycles System clock frequency 16.3 MHz (max.) 16.3 MHz (max.) 16.3 MHz (max.) 8.2 MHz (max.) Note: Be sure to set the FLASHCWAIT.RDWAIT[1:0] bits before the system clock is configured. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Bits 7 to 0 in the MSCTTBRL register are fixed at 0, so the vector table always begins from a 256-byte boundary address. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The previously occurring interrupt is held. The held interrupt is canceled and no interrupt is generated if the interrupt flag in the peripheral circuit is cleared via software. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Note: When HALT or SLEEP mode is canceled, the CPU jumps to the interrupt handler routine after executing one instruction. To execute the interrupt handler routine immediately after wake-up, place the nop instruction at just behind the halt/slp instruction. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
• Port pins: High impedance state • Port function: Configured to GPIO This status continues until the ports are configured via software. The debugging function ports are configured for debug signal input/output. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 60
* Steps 1 and 5 are required for the ports with an interrupt function. Step 2 is required for the ports with a chat- tering filter function. Table 6.4.1.1 lists the port status according to the combination of data input/output control and pull-up/down control. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
SLEEP mode. If CLK_PPORT is configured to stop in SLEEP mode, PPORT inactivates the chattering filter during SLEEP mode to input pin status transitions directly to itself. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
These bits do not affect the outputs when the port is used as a peripheral I/O function. Bits 7–0 PxIN[7:0] The GPIO port pin status can be read out from these bits. 1 (R): Port pin = High level 0 (R): Port pin = Low level Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
– 7–0 PxIF[7:0] 0x00 Cleared by writing 1. *1: This register is effective when the GPIO function is selected. *2: The bit configuration differs depending on the port group. Bits 15–8 Reserved Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Bits 15–8 Reserved Bits 7–0 PxSEL[7:0] These bits select whether each port is used for the GPIO function or a peripheral I/O function. 1 (R/W): Use peripheral I/O function 0 (R/W): Use GPIO function Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The PPORT operating clock should be configured by selecting the clock source using the PCLK. CLKSRC[1:0] bits and the clock division ratio using the PCLK.CLKDIV[3:0] bits as shown in Table 6.6.2. These settings determine the input sampling time of the chattering filter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
A port generated an interrupt 0 (R): No port generated an interrupt The PINTFGRP.PxINT bit is cleared when the interrupt flag for the port that has generated an interrupt is cleared. Seiko Epson Corporation 6-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Table 6.7.3.1 Control Registers for P2 Port Group Register name Bit name Initial Reset Remarks P2DAT 15–10 – 0x00 – – (P2 Port Data 9–8 P2OUT[1:0] Register) 7–2 – 0x00 – 1–0 P2IN[1:0] Seiko Epson Corporation 6-12 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
If the clock source stops in SLEEP mode, WDT stops. To prevent generation of an unnecessary reset after clearing SLEEP mode, reset WDT before executing the slp instruction. WDT should also be stopped as required using the WDTCTL.WDTRUN[3:0] bits. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
WDTCNTRST Always read as 0. 3–0 WDTRUN[3:0] R/WP – Bits 15–5 Reserved Bit 4 WDTCNTRST This bit resets WDT. 1 (WP): Reset 0 (WP): Ignored 0 (R): Always 0 when being read Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 76
Always 0x0 is read if a value other than 0xa is written. Since a reset may be generated immediately after running depending on the counter value, WDT should also be reset concurrently when running WDT. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
* Indicates the status when the pin is configured for RTCA. If the port is shared with the RTCA output function and other functions, the RTCA function must be assigned to the port. For more information, refer to the “I/O Ports” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
3. Write 1 to the RTCINTF.ALARMIF bit to clear the alarm interrupt flag. 4. Write 1 to the RTCINTE.ALARMIE bit to enable alarm interrupts. When the real-time clock counter reaches the alarm time set in Step 2, an alarm interrupt occurs. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
8.4.4 Stopwatch Count-up Pattern The stopwatch consists of 1/100-second and 1/10-second counters and these counters perform counting up in incre- ments of approximate 1/100 and 1/10 seconds with the count-up patterns shown in Figure 8.4.4.1. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
1 Hz counter value. • An alarm interrupt occurs after a lapse of 1/256 second from matching between the AM/PM (in 12H mode), hour, minute, and second counter value and the alarm setting value. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Depending on these operation timings, the +1 second correction may be executed after the count-up operation resumes. For more information on the +1 second correction, refer to “Real-Time Clock Counter Operations.” Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The RTCALM1.RTCSHA[2:0] bits and the RTCALM1.RTCSLA[3:0] bits set the 10-second digit and 1-second digit of the alarm time, respectively. A value within 0 to 59 seconds can be set in BCD code as shown in Table 8.6.1. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
SWRUN Bits 15–12 BCD10[3:0] Bits 11–8 BCD100[3:0] The 1/10-second and 1/100-second digits of the stopwatch counter can be read as a BCD code from the RTCSWCTL.BCD10[3:0] bits and the RTCSWCTL.BCD100[3:0] bits, respectively. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
1-second digit of the second counter, respectively. The setting/read values are a BCD code within the range from 0 to 59. Note: Be sure to avoid writing to the RTCSEC.RTCSH[2:0]/RTCSL[3:0] bits while the RTCCTL. RTCBSY bit = 1. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
1 to 12 in 12H mode or 0 to 23 in 24H mode. Note: Be sure to avoid writing to the RTCHUR.RTCHH[1:0]/RTCHL[3:0] bits while the RTCCTL. RTCBSY bit = 1. Bit 7 Reserved Seiko Epson Corporation 8-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The day of the week counter is a base-7 counter and the setting/read values are 0x0 to 0x6. Table 8.6.2 lists the correspondence between the count value and day of the week. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 8-11 (Rev. 1.2)
SLEEP mode and SVD stops with the register settings maintained at those before entering SLEEP mode. After the CPU returns to normal mode, CLK_SVD is supplied and the SVD operation resumes. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
SVDCTL.MODEN bit = 1, wait for at least SVD circuit response time before reading the SVDINTF.SVDDT bit (refer to “Supply Voltage Detector Characteristics, SVD circuit response time t ” in the “Electrical Char- acteristics” chapter). Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
SVDIF bit). An interrupt request is sent to the interrupt controller only when the SVDINTF.SVDIF bit is set while the interrupt is enabled by the SVDINTE.SVDIE bit. For more information on interrupt control, refer to the “Interrupt Controller” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
0 (R/WP): No clock supplied in DEBUG mode Bit 7 Reserved Bits 6–4 CLKDIV[2:0] These bits select the division ratio of the SVD operating clock. Bits 3–2 Reserved Bits 1–0 CLKSRC[1:0] These bits select the clock source of SVD. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
SVD detection voltage V 0x1f High 0x1e ↑ 0x0d ↓ 0x0c 0x0b–0x00 Use prohibited For more information, refer to “Supply Voltage Detector Characteristics, SVD detection voltage ” in the “Electrical Characteristics” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
This bit indicates the low power supply voltage detection interrupt cause occurrence status. 1 (R): Cause of interrupt occurred 0 (R): No cause of interrupt occurred 1 (W): Clear flag 0 (W): Ineffective Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Notes: • If the SVDCTL.SVDRE[3:0] bits are set to 0xa, no low power supply voltage detection in- terrupt will occur, as a reset is issued at the same timing as an interrupt. • To prevent generating unnecessary interrupts, the corresponding interrupt flag should be cleared before enabling interrupts. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
If the port is shared with the EXCLm pin and other functions, the EXCLm input function must be assigned to the port before using the event counter function. For more information, refer to the “I/O Ports” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 10-1 (Rev. 1.2)
(Set reload data (counter preset data)) 5. Set the following bits when using the interrupt: - Write 1 to the T16_nINTF.UFIF bit. (Clear interrupt flag) - Set the T16_nINTE.UFIE bit to 1. (Enable underflow interrupt) Seiko Epson Corporation 10-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
At the same time the counter stops, the T16_ nCTL.PRUN bit is cleared automatically. Select this mode to stop the counter after an interrupt has occurred once, such as for checking a specific lapse of time. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 10-3 (Rev. 1.2)
The current counter value can be read out from these bits. T16 Ch.n Interrupt Flag Register Register name Bit name Initial Reset Remarks T16_nINTF 15–8 – 0x00 – – 7–1 – 0x00 – UFIF Cleared by writing 1. Bits 15–1 Reserved Seiko Epson Corporation 10-6 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
This bit enables T16 Ch.n underflow interrupts. 1 (R/W): Enable interrupts 0 (R/W): Disable interrupts Note: To prevent generating unnecessary interrupts, the corresponding interrupt flag should be cleared before enabling interrupts. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 10-7 (Rev. 1.2)
When using the UART during SLEEP mode, the UART operating clock CLK_UARTn must be configured so that it will keep supplying by writing 0 to the CLGOSC.xxxxSLPC bit for the CLK_UARTn clock source. Seiko Epson Corporation 11-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
(UAnMOD.STPB bit = 1). Parity function The parity function is configured using the UAnMOD.PREN and UAnMOD.PRMD bits. Table 11.4.1 Parity Function Setting UAnMOD.PREN bit UAnMOD.PRMD bit Parity function Odd parity Even parity Non parity Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 11-3 (Rev. 1.2)
2. Write transmit data to the UAnTXD register. 3. Wait for a UART interrupt when using the interrupt. 4. Repeat Steps 1 to 3 (or 1 and 2) until the end of transmit data. Seiko Epson Corporation 11-4 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
2. Check to see if the UAnINTF.RB1FIF bit is set to 1 (receive buffer one byte full). 3. Read the received data from the UAnRXD register. 4. Repeat Steps 1 to 3 (or 2 and 3) until the end of data reception. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 11-5 (Rev. 1.2)
Set the UAnMOD.IRMD bit to 1 to use the IrDA interface. Data transfer control is identical to that for normal interface even if the IrDA interface function is enabled. Seiko Epson Corporation 11-6 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Note, however, that the set timing depends on the buffer status at that point. • When the receive data buffer is empty The interrupt flag will be set when the data that encountered an error is transferred to the re- ceive data buffer. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 11-7 (Rev. 1.2)
1 (R/W): Enable output inverting function 0 (R/W): Disable output inverting function Bit 7 Reserved Bit 6 PUEN This bit enables pull-up of the USINn pin. 1 (R/W): Enable pull-up 0 (R/W): Disable pull-up Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 11-9 (Rev. 1.2)
Note: The UAnBR register settings can be altered only when the UAnCTL.MODEN bit = 0. UART Ch.n Control Register Register name Bit name Initial Reset Remarks UAnCTL 15–8 – 0x00 – – 7–2 – 0x00 – SFTRST MODEN Bits 15–2 Reserved Seiko Epson Corporation 11-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
16-bit timer channel and converts it to the SPICLKn. The 16-bit timer must be run with an appro- priate reload data set. The SPICLKn frequency (baud rate) and the 16-bit timer reload data are calculated by the equations shown below. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 12-3 (Rev. 1.2)
1. Assert the slave select signal by controlling the general-purpose output port (if necessary). 2. Check to see if the SPInINTF.TBEIF bit is set to 1 (transmit buffer empty). 3. Write transmit data to the SPInTXD register. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 12-5 (Rev. 1.2)
Page 124
SPInTXD register Transmit data remained? Wait for an interrupt request (SPInINTF.TBEIF = 1) Negate the slave select signal output from a general-purpose port Figure 12.5.2.2 Data Transmission Flowchart in Master Mode Seiko Epson Corporation 12-6 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
SPInTXD register data written is completed. If no transmit data is written during this period, the data bits input from the SDIn pin are shifted and output from the SDOn pin without being modified. Seiko Epson Corporation 12-8 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 127
Data (W) → SPInTXD Data (W) → SPInTXD Software operations SPInRXD → Data (R) SPInRXD → Data (R) Figure 12.5.5.1 Example of Data Transfer Operations in Slave Mode (SPInMOD.CHLN[3:0] bits = 0x7) Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 12-9 (Rev. 1.2)
“Interrupt Controller” chapter. The SPInINTF register also contains the BSY bit that indicates the SPIA operating status. Figure 12.6.1 shows the SPInINTF.BSY and SPInINTF.TENDIF bit set timings. Seiko Epson Corporation 12-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Note: The SPInMOD register settings can be altered only when the SPInCTL.MODEN bit = 0. SPIA Ch.n Control Register Register name Bit name Initial Reset Remarks SPInCTL 15–8 – 0x00 – – 7–2 – 0x00 – SFTRST MODEN Bits 15–2 Reserved Seiko Epson Corporation 12-12 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The following shows the correspondence between the bit and interrupt: SPInINTE.OEIE bit: Overrun error interrupt SPInINTE.TENDIE bit: End-of-transmission interrupt SPInINTE.RBFIE bit: Receive buffer full interrupt SPInINTE.TBEIE bit: Transmit buffer empty interrupt Seiko Epson Corporation 12-14 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
• The internal pull-up resistors for the I/O ports cannot be used for pulling up SDA and SCL. • When the I2C is set into master mode, no other master device can be connected to the I bus. Seiko Epson Corporation 13-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
13.3.3.1). Note: The I C bus transfer rate is limited to 100 kbit/s in standard mode or 400 kbit/s in fast mode. Do not set a transfer rate exceeding the limit. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-3 (Rev. 1.2)
- Set the I2CnCTL.MST bit to 0. (Set slave mode) - Set the I2CnCTL.SFTRST bit to 1. (Execute software reset) - Set the I2CnCTL.MODEN bit to 1. (Enable I2C Ch.n operations) Seiko Epson Corporation 13-4 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
I2CnINTF.NACKIF bit = 1 (NACK received), the I2C Ch.n generates a repeated START condition. When the repeated START condition has been generated, the I2CnINTF.STARTIF and I2CnINTF.TBEIF bits are both set to 1 same as when a START condition has been generated. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-5 (Rev. 1.2)
Page 138
Last data sent? Retry? Write 1 to the I2CnCTL.TXSTOP bit Write data to the I2CnTXD register Wait for an interrupt request (I2CnINTF.STOPIF = 1) Figure 13.4.2.2 Master Mode Data Transmission Flowchart Seiko Epson Corporation 13-6 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
This reading triggers the I2C Ch.n to start subsequent data reception. Generating a STOP or repeated START condition It is the same as the data transmission in master mode. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-7 (Rev. 1.2)
Page 140
Read receive data from the I2CnRXD register Write 1 to the I2CnCTL.TXSTOP bit Write 1 to the I2CnCTL.TXSTOP bit Wait for an interrupt request (I2CnINTF.STOPIF = 1) Figure 13.4.3.2 Master Mode Data Reception Flowchart Seiko Epson Corporation 13-8 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Clear the I2CnINTF.STARTIF bit by writing 1 after the interrupt has occurred. 9. Write the first address to the I2CnTXD.TXD[7:1] bits and 1 that represents READ as the data transfer direc- tion to the I2CnTXD.TXD0 bit. 10. Perform data reception. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-9 (Rev. 1.2)
Go to Step 6 when a STOP condition interrupt has occurred. ii. Go to Step 2 when a START condition interrupt has occurred. 6. Clear the I2CnINTF.STOPIF bit and then terminate data sending operations. Seiko Epson Corporation 13-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 143
A: ACK, A: NACK, Saddr/R: Slave address + R(1), Saddr/W: Slave address + W(0), STARTIF = 1 Data n: 8-bit data Figure 13.4.5.1 Example of Data Sending Operations in Slave Mode Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-11 (Rev. 1.2)
I2C Ch.n sends an ACK and pulls down SCL to low. The received data in the shift register is transferred to the receive data buffer and the I2CnINTF.RBFIF and I2CnINTF.BYTEENDIF bits are both set to 1. Af- ter that, the received data can be read out from the I2CnRXD register. Seiko Epson Corporation 13-12 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 145
Wait for an interrupt request (I2CnINTF.RBFIF = 1) Last data received next? Write 1 to the I2CnCTL.TXNACK bit Read receive data from the I2CnRXD register Last data received? Figure 13.4.6.2 Slave Mode Data Reception Flowchart Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-13 (Rev. 1.2)
If SDA does not change from low when the I2C Ch.n outputs the ninth clock, it is regarded as an automatic bus clearing failure. In this case, the I2C Ch.n clears the I2CnCTL.TXSTART bit to 0 and sets both the I2CnINTF.ERRIF and I2CnINTF.STARTIF bits to 1. Seiko Epson Corporation 13-14 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
4 <Master mode only> When 1 is written to the I2CnCTL.TX- I2CnINTF.ERRIF = 1 START bit while the I2CnINTF.BSY bit = 0 (Refer to “Automatic Automatic bus clearing I2CnCTL.TXSTART = 0 Bus Clearing Operation.”) failure I2CnINTF.STARTIF = 1 Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-15 (Rev. 1.2)
(Note) The oscillation circuits/external input that are not supported in this IC cannot be selected as the clock source. Note: The I2CnCLK register settings can be altered only when the I2CnCTL.MODEN bit = 0. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-17 (Rev. 1.2)
The I2CnOADR.OADR[9:0] bits are effective in 10-bit address mode (I2CnMOD.OADR10 bit = 1), or the I2CnOADR.OADR[6:0] bits are effective in 7-bit address mode (I2CnMOD.OADR10 bit = 0). Note: The I2CnOADR register settings can be altered only when the I2CnCTL.MODEN bit = 0. Seiko Epson Corporation 13-18 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Bit 0 MODEN This bit enables the I2C operations. 1 (R/W): Enable I2C operations (The operating clock is supplied.) 0 (R/W): Disable I2C operations (The operating clock is stopped.) Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 13-19 (Rev. 1.2)
0 (R): SDA = High level Bit 11 SCLLOW This bit indicates that SCL is set to low level. 1 (R): SCL = Low level 0 (R): SCL = High level Seiko Epson Corporation 13-20 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
2. Set the following LCD8CLK register bits: - LCD8CLK.CLKSRC[1:0] bits (Clock source selection) - LCD8CLK.CLKDIV[2:0] bits (Clock division ratio selection = Clock frequency setting) The CLK_LCD8A frequency should be set to around 32 kHz. Seiko Epson Corporation 14-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
V can be generated by the internal LCD power supply circuit (LCD voltage regu- lator and LCD voltage booster). One or all voltages can also be applied from outside the IC. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 14-3 (Rev. 1.2)
V . Set the LCD8PWR.VCSEL bit as shown in Table 14.4.4.1. Current consumption can be reduced by selecting reference voltage V as compared with reference voltage V Seiko Epson Corporation 14-4 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
7. Write display data to the display data RAM. 8. Set the following bits when using the interrupt: - Write 1 to the LCD8INTF.FRMIF bit. (Clear interrupt flag) - Set the LCD8INTE.FRMIE bit to 1. (Enable LCD8A interrupt) Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 14-5 (Rev. 1.2)
When 1/4 to 1/2 duty or static drive is selected, two screen areas can be allocated in the display data RAM, and the LCD8DSP.DSPAR bit can be used to switch between the screens. Setting the LCD8DSP.DSPAR bit to 0 selects display area 0; setting to 1 selects display area 1. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 14-9 (Rev. 1.2)
Note: If the LCD8CTL.MODEN bit is altered from 1 to 0 while the LCD panel is displaying, the LCD display is automatically turned off and the LCD8DSP.DSPC[1:0] bits are also set to 0x0. Seiko Epson Corporation 14-12 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Bit 11 COM3DEN Bit 10 COM2DEN Bit 9 COM1DEN Bit 8 COM0DEN These bits configure the partial drive of the common output pins. 1 (R/W): Normal output 0 (R/W): Off waveform output Seiko Epson Corporation 14-14 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Bit 0 FRMIF This bit indicates the frame interrupt cause occurrence status. 1 (R): Cause of interrupt occurred 0 (R): No cause of interrupt occurred 1 (W): Clear flag 0 (W): Ineffective Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 14-15 (Rev. 1.2)
(Clear interrupt flags) - Set the interrupt enable bits in the RFCnINTE register to 1. (Enable interrupts) 3. Assign the RFC input/output function to the ports. (Refer to the “I/O Ports” chapter.) Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 15-3 (Rev. 1.2)
To obtain the difference between the reference oscillation and sensor oscillation clock count values from the measurement counter simply, appropriate initial values must be set to the measurement counter before starting reference oscillation. Seiko Epson Corporation 15-4 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The measurement counter overflow sets the RFCnINTF.EREFIF bit to 1 indicating that the reference oscil- lation has been terminated normally. If the RFCnINTE.EREFIE bit = 1, a reference oscillation completion interrupt request occurs at this point. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 15-5 (Rev. 1.2)
Page 176
Performing reference oscillation and sensor oscillation with the same resistor and capacitor results n ≈ m. The difference between n and m is a conversion error. Table 15.4.4.1 lists the error factors. (n: measurement counter initial value, m: measurement counter value at the end of sensor oscillation) Seiko Epson Corporation 15-6 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
For more information on interrupt control, refer to the “Interrupt Controller” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 15-7 (Rev. 1.2)
This bit sets the RFCLKOn pin to output the divided-by-two oscillation clock. 1 (R/W): Divided-by-two clock output 0 (R/W): Oscillation clock output For more information, refer to “CR Oscillation Frequency Monitoring Function.” Seiko Epson Corporation 15-8 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
This bit controls CR oscillation for sensor A. This bit also indicates the CR oscillation status. 1 (W): Start oscillation 0 (W): Stop oscillation 1 (R): Being oscillated 0 (R): Stopped Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 15-9 (Rev. 1.2)
Note: The time base counter must be set from the low-order value (RFCnTCL.TC[15:0] bits) first when data is set using a 16-bit access instruction. The counter may not be set to the correct value if the high-order value (RFCnTCH.TC[23:16] bits) is written first. Seiko Epson Corporation 15-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
EXHYS0 CMPIN0P CMPIN0N EXHYS1 CMPIN1P CMPIN1N SENSEN S1C17 AMRC One of various kind of analog output MR sensors Figure 16.2.2.2 Connections with an MR Sensor when External Hysteresis Resistors are Used Seiko Epson Corporation 16-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
- Write 1 to the interrupt flags in the AMRCINTF register. (Clear interrupt flags) - Set the interrupt enable bits in the AMRCINTE register to 1. (Enable interrupts) 8. Write 1 to the AMRCCTL.MODEN bit. (Enable AMRC operation) Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 16-3 (Rev. 1.2)
The AMRC compares the sensor outputs between (+A) and (-A) and between (+B) and (-B) using the inter- nal comparators to detect a rotation angle in 45° units as shown in Table 16.4.2.1. Seiko Epson Corporation 16-4 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Page 186
When an underflow occurs in the counter, the AMRC presets the initial value to the counter again and sets the AMRCINTF.CNTxIF bit to 1. At the same time, an event counter Ch.x underflow interrupt request oc- curs if the AMRCINTE.CNTxIE bit = 1. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 16-5 (Rev. 1.2)
For example, when f = 32,768 Hz, the pulse width can be set within the range from 15.6 ms (AMRCEVPLS. OSC1 EVW[5:0] bits = 0) to 1,000 ms (AMRCEVPLS.EVW[5:0] bits = 63). Seiko Epson Corporation 16-6 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
For more information on interrupt control, refer to the “Interrupt Controller” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 16-7 (Rev. 1.2)
CTLST – – RSTUPCNT REVSTPTRG EPOUTTRG 3–0 TRGCYC[3:0] Bit 15 DIRSET This bit specifies the normal direction of rotation. 1 (R/W): Normal rotation = counterclockwise 0 (R/W): Normal rotation = clockwise Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 16-9 (Rev. 1.2)
Page 191
1 (R): Resetting 0 (R): Reset finished/in normal operations Bit 5 REVSTPTRG This bit selects the count source for the reverse/stop counter. 1 (R/W): Reverse rotation detected 0 (R/W): Stop detected Seiko Epson Corporation 16-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
The correct value may not be read during counting. The AMRCECNTx.ECNT[7:0] bits must be read twice and assume the counter value was read successfully if the two read results are the same. For more information on the event counter, refer to “Measurement Control and Operations.” Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 16-11 (Rev. 1.2)
1 (W): Clear flag 0 (W): Ineffective The following shows the correspondence between the bit and interrupt: AMRCINTF.UCNTIF bit: Unit counter compare match interrupt AMRCINTF.CNT2IF bit: Event counter Ch.2 underflow interrupt Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 16-13 (Rev. 1.2)
*3 The component values should be determined after performing matching evaluation of the resonator mounted on the printed cir- cuit board actually used. *4 C is not required when the power-on-reset function is not used. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 17-1 (Rev. 1.2)
µA RUN21 *1 OSC1 oscillator: CLGOSC1.INV1N[1:0] bits = 0x0, CLGOSC1.CGI1[2:0] bits = 0x0, CLGOSC1.OSDEN bit = 0, = 0 pF, Crystal resonator = C-002RX (manufactured by EPSON TOYOCOM Corporation, R = 50 kW (Max.), C = 7 pF) *2 The current consumption values were measured when a test program consisting of 60.5 % ALU instructions, 17 % branch instruc- tions, 12 % RAM read instructions, and 10.5 % RAM write instructions was executed continuously in the Flash memory.
= 0 V, Ta = -40 to 85 °C Item Symbol Condition Min. Typ. Max. Unit Oscillation start time – – µs Oscillation frequency 25 °C 7.23 7.37 7.52 IOSC -40 to 85 °C 7.00 7.37 7.74 Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 17-3 (Rev. 1.2)
Ta = 85 °C, Min. value –V = 5.5 V = 3.6 V = 1.8 V = 1.8 V = 5.5 V = 3.6 V 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 17-5 (Rev. 1.2)
*1 If CLK_SVD is configured in the neighborhood of 32 kHz, the SVDINTF.SVDDT bit is masked during the t period and it re- SVDEN tains the previous value. CLK_SVD SVDCTL.MODEN 0x1f 0x10 SVDCTL.SVDSC[1:0] SVDINTF.SVDDT Invalid Valid Invalid Valid SVDEN Seiko Epson Corporation 17-6 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
*1 Other LCD driver settings: LCD8PWR.LC[3:0] bits = 0xf, CLK_LCD8A = 32 kHz, LCD8TIM.FRMCNT[3:0] bits = 0x3 (frame fre- quency = 64 Hz) *2 The value is added to the current consumption in HALT/RUN mode. Current consumption increases according to the display contents and panel load. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL 17-9 (Rev. 1.2)
Page 205
LCD circuit current-load characteristic Ta = 25 °C, Typ. value, LCD8PWR.LC[3:0] bits = 0xf, when a load is connected to the V pin only LCD8PWR.VCSEL bit = 0 LCD8PWR.VCSEL bit = 1 [µA] Seiko Epson Corporation 17-10 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
0x000 Register) 0x5494 AMRCUCNT 15–12 – – – (AMRC Unit Counter 11–0 UCNT[11:0] 0x000 Cleared by writing 1 to the Register) AMRCCTL.RSTUPCNT bit or writing data to the AMR- CUCMP.UCMP[11:0] bits. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL AP-A-17 (Rev. 1.2)
• Using a crystal resonator with lower C value decreases current consumption. However, these configurations may reduce the oscillation margin and increase the frequency error, therefore, be sure to perform matching evaluation using the actual printed circuit board. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL AP-B-1 (Rev. 1.2)
• Setting the LCD voltage regulator into heavy load protection mode (LCD8PWR.HVLD bit = 1) increases current consumption. Heavy load protection mode should be set only when the display becomes unstable. Seiko Epson Corporation AP-B-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
Sudden power supply fluctuations due to noise will cause malfunctions. Consider the following issues. (1) Connections from the power supply to the V and V pins should be implemented via the shortest, thick- est patterns possible. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL AP-C-1 (Rev. 1.2)
Page 231
(2) Electromagnetically-induced noise from a solder iron when soldering In particular, during soldering, take care to ensure that the soldering iron GND (tip potential) has the same po- tential as the IC GND. Seiko Epson Corporation AP-C-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
• Execute the resending process via software after executing the receive error handler with a parity check. For details of the pin functions and the function switch control, see the “I/O Ports” chapter. For the UART con- trol and details of receive errors, see the “UART” chapter. Seiko Epson Corporation S1C17M01 TECHNICAL MANUAL AP-D-1 (Rev. 1.2)
Page 234
“intXX_handler” can be used for software interrupts. (3) The program code is written in the “.text” section. (4) Sets the stack pointer. (5) Sets the number of Flash memory read cycles. (See the “Memory and Bus” chapter.) Seiko Epson Corporation AP-E-2 S1C17M01 TECHNICAL MANUAL (Rev. 1.2)
REVISION HISTORY Revision History Code No. Page Contents 412361700 New establishment 412361700c 2-10 2.4.1 Initial Boot Sequence (Old) – (New) For the reset hold time t , refer to “Reset hold circuit characteristics” in the “Electrical Charac- RSTR teristics” chapter. 3.3.4 External Connection (Old) For the recommended pull-up resistor value, refer to “Recommended Operating Conditions, DSIO pull-up resistor R...
Page 236
REVISION HISTORY Code No. Page Contents 412361700c 13-12 13.4.6 Data Reception in Slave Mode (Old) Data receiving procedure 7. Repeat Steps 4 to 6 until the end of data reception. (New) Data receiving procedure 7. Repeat Steps 4 to 6 until the end of data reception. 8.
Page 237
REVISION HISTORY Code No. Page Contents 412361701 ITC: ITC Interrupt Request Processing (Old) Note: Wake-up operations (SLEEP/HALT cancellation) by an interrupt cannot be disabled even if the interrupt level is set to 0. (New) Deleted ITC: NMI (Old) The watchdog timer embedded in this IC can generate a non-maskable interrupt (NMI). This inter- rupt takes precedence over other interrupts and is unconditionally accepted by the CPU.
Page 238
REVISION HISTORY Code No. Page Contents 412361701 WDT: During SLEEP mode (Old) WDT operates in SLEEP mode if the selected clock source is running. In this case SLEEP mode is cleared by an NMI or reset if it continues for more than the NMI/reset generation cycle and the NMI or reset handler is executed.
Page 239
REVISION HISTORY Code No. Page Contents 412361701 10-1 T16: Figure 10.1.1 Configuration of a T16 Channel Modified the figure (The I/O port (chattering filter) was deleted.) T16: Input Pin (Old) If the port is shared with the EXCLm pin and other functions, the EXCLm input function must be assigned to the port before using the event counter function.
Page 240
REVISION HISTORY Code No. Page Contents 412361702 8.3.2 Theoretical Regulation Function Corrected Step 1. 1. Measure f and calculate the frequency tolerance correction value OSC1 “m [ppm] = -{(f - 32,768 [Hz]) / 32,768 [Hz]} × 10 .” OSC1 (Eq. 8.1) m: OSC1 frequency tolerance correction value [ppm] 8.4.2 Real-Time Clock Counter Operations Corrective operation when a value out of the effective range is set Added a note.
Page 241
REVISION HISTORY Code No. Page Contents 412361702 AP-A-9 Appendix A List of Peripheral Circuit Control Registers PDIOEN (Pd Port Enable Register) Modified the register table. PDOEN[1:0] → PDOEN[2:0]...