SONIX reserves the right to make change without further notice to any products herein to improve reliability, function or design. SONIX does not
assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent
rights nor the rights of others. SONIX products are not designed, intended, or authorized for us as components in systems intended, for surgical
implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the SONIX product
could create a situation where personal injury or death may occur. Should Buyer purchase or use SONIX products for any such unintended or
unauthorized application. Buyer shall indemnify and hold SONIX and its officers, employees, subsidiaries, affiliates and distributors harmless against
all claims, cost, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death
associated with such unintended or unauthorized use even if such claim alleges that SONIX was negligent regarding the design or manufacture of
the part.
SONiX TECHNOLOGY CO., LTD Page 1 Version 2.0
Page 2
SN32F760 Series
Version
Date
Description
1.0
2014/02/27
First version released.
1.1
2014/05/23
1. Fix typing errors.
2. Update 23.3 Marking Example section.
3. Update SN-LINK-V2 photos.
1.2
2015/03/06
1. Update GPIO & LCD driver characteristics in Chap 20 Electrical Characteristic.
2. Fix typing error in 16.8 LCD DISPLAY MEMORY MAP
3. Add notice for power input pads.
4. Fix typing errors.
1.3
2015/05/29
1. Update QFN46 package information.
2. Update UART baud rate sample.
1.4
2015/08/21
1. Add Note for P2.n GPIO setting if ADC function is used.
2. Update PLL recommend input/output frequency setting table.
1.5
2016/07/22
1. Fix typing errors.
2. Add Notice: HCLK MUST be equal or less than 24MHz during Flash program and
erase operations.
3. Update LQFP48 package information.
1.6
2016/12/02
1. Fix typing errors.
2. Remove SN32F74X & SN32F73X.
3. Remove SYSTICKPRE[1:0]
1.7
2017/06/05
1. Remove SYS0_ANTIEFT register.
2. Fix Deep Sleep mode wake up time.
3. Update SN-LINK-V3.0 information.
1.8
2017/07/14
1. Update WDTPRE[2:0] bits description in SYS1_APBCP1 register.
2. Update TO[15:0] bits description in I2Cn_TOCTRL register.
1.9
2017/12/21
1. Update LCD drive waveform.
2. Add Note for setting the pins which are not pin-out.
Note: The pins which are not pin-out shall be set correctly to decrease power consumption in low-
power modes. Strongly recommended to set these pins as input pull-up.
32-Bit Cortex-M0 Micro-Controller
SN32F768/758F (LQFP 64 pins)
SONiX TECHNOLOGY CO., LTD Page 19 Version 2.0
Page 20
SN32F760 Series
P3.15/LXTALOUT
P3.14/LXTALIN
P3.13/HXTALOUT
P3.12/HXTALIN
P3.11/CLKOUT
P3.10/RESET
P0.8/SWCLK
P0.9/SWDIO
VSS
VDD
P3.9/SEG11
P3.6/SEG8
48
47
46
45
44
43
42
41
40
39
38
37
AIN0/P2.0
1 ●
36
P3.5/SEG7
AIN1/P2.1
2
35
P3.3/SEG5
BOOT/AIN2/P2.2
3
34
P3.2/SEG4
AIN3/P2.3
4
33
P1.7/V2
AIN4/P2.4
5
SN32F767F
SN32F757F
32
P1.6/V3
P2.14
6
31
P3.1/SEG3
P2.15
7
30
P3.0/SEG2
AIN5/P2.5
8
29
P1.13/COM3
AIN6/P2.6
9
28
P1.12/COM2
AIN7/P2.7
10
27
P1.11/COM1
AVSS
11
26
P1.10/COM0
AVDD
12
25
VDD12/VLCD12
13
14
15
16
17
18
19
20
21
22
23
24
VDD3/VLCD3
SEG31/P0.0
SEG30/P0.1
SEG29/P0.2
SEG28/P0.3
SEG27/P0.4
SEG26/P0.5
SEG17/P1.0
SEG16/P1.1
SEG15/P1.2
SEG14/P1.3
SEG13/P1.4
Note: The pins which are not pin-out shall be set correctly to decrease power consumption in low-
power modes. Strongly recommended to set these pins as input pull-up.
32-Bit Cortex-M0 Micro-Controller
SN32F767/757 (LQFP 48 pins)
SONiX TECHNOLOGY CO., LTD Page 20 Version 2.0
Page 21
SN32F760 Series
P3.15/LXTALOUT
P3.14/LXTALIN
P3.13/HXTALOUT
P3.12/HXTALIN
P3.11/CLKOUT
P3.10/RESET
P0.8/SWCLK
P0.9/SWDIO
VSS
VDD
P3.9/SEG11
P3.5/SEG7
P3.4/SEG6
P3.3/SEG5
46
45
44
43
42
41
40
39
38
37
36
35
34
33
AIN0/P2.0
1 ●
32
P3.2/SEG4
AIN1/P2.1
2
31
P1.7/V2
BOOT/AIN2/P2.2
3
SN32F766J
SN32F756J
30
P1.6/V3
AIN3/P2.3
4
29
P3.1/SEG3
AIN4/P2.4
5
28
P3.0/SEG2
P2.14
6
27
P1.13/COM3
P2.15
7
26
P1.12/COM2
AIN5/P2.5
8
25
P1.11/COM1
AIN6/P2.6
9
24
P1.10/COM0
10
11
12
13
14
15
16
17
18
19
20
21
22
23
AVSS
AVDD
VDD3/VLCD3
SEG31/P0.0
SEG30/P0.1
SEG29/P0.2
SEG28/P0.3
SEG27/P0.4
SEG17/P1.0
SEG16/P1.1
SEG15/P1.2
SEG14/P1.3
SEG13/P1.4
VDD12/VLCD12
Note: The pins which are not pin-out shall be set correctly to decrease power consumption in low-
power modes. Strongly recommended to set these pins as input pull-up.
32-Bit Cortex-M0 Micro-Controller
SN32F766/756 (QFN 46 pins)
SONiX TECHNOLOGY CO., LTD Page 21 Version 2.0
Page 22
SN32F760 Series
P3.14/LXTALIN
P3.13/HXTALOUT
P3.12/HXTALIN
P3.11/CLKOUT
P3.10/RESET
P0.8/SWCLK
P0.9/SWDIO
VSS
32
31
30
29
28
27
26
25
LXTALOUT/P3.15
1 ●
24
VDD
AIN0/P2.0
2
23
P3.9
AIN1/P2.1
3
SN32F765J
SN32F755J
22
P3.6
BOOT/AIN2/P2.2
4
21
P3.3
P2.14
5
20
P3.2
P2.15
6
19
P1.11
AIN7/P2.7
7
18
P1.10
AVSS
8
33 VSS
17
VDD12
9 10
11
12
13
14
15
16
AVDD
VDD3
P0.0
P0.1
P0.2
P1.0
P1.1
P1.2
Note: The pins which are not pin-out shall be set correctly to decrease power consumption in low-
power modes. Strongly recommended to set these pins as input pull-up.
32-Bit Cortex-M0 Micro-Controller
SN32F765/755 (QFN 33 pins)
SONiX TECHNOLOGY CO., LTD Page 22 Version 2.0
Page 23
SN32F760 Series
PIN NAME
TYPE
DESCRIPTION
VDD, VSS
P
Power supply input pins for digital circuit.
AVDD, AVSS
P
Power supply input pins for analog circuit.
VDD1/VLCD1
P
I/O and LCD driver power input pins for P1.6~P1.15 and P3.0~P3.9.
This power input used for I/O power must be equal to VDD.
This power input shall not be floating.
VDD2/VLCD2
P
I/O and LCD driver power input pins for P0.10~P0.15 and P1.0~P1.5.
VDD2/VLCD2 is the I/O and LCD driver power input pin for P0.10~P0.15 and
P1.0~P1.5. If VDD2 voltage is lower than VDD, user should manually force to set
the I/O port P1.6 and P1.7 as input pull-down state in case of internal power
collision.
This power input shall not be floating.
VDD12/VLCD12
P
Double bonding pins with VDD1 and VDD2.
This power input used for I/O power must be equal to VDD.
This power input shall not be floating.
VDD3/VLCD3
P
I/O and LCD driver power input pins for P0.0~P0.7.
If VDD3 voltage is lower than VDD, user should manually force to set the I/O port
P1.6 and P1.7 as input pull-down state in case of internal power collision.
This power input shall not be floating.
CL+, CL-
P
C-Type LCD charge pump capacitor
V3
P
2/3 VLCD bias voltage
V2
P
1/3 VLCD bias voltage
P0.0~P0.7
I/O
P0.0~P0.7 — Port 0 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
P0.8/SWCLK
I/O
P0.8 — Port 0.8 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
Built-in wakeup function.
SWCLK — Serial Wire Clock pin.
P0.9/SWDIO
I/O
P0.9 — Port 0.9 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
Built-in wakeup function.
SWDIO — Serial Wire Data input/output pin.
P0.10~P0.15
I/O
P0.10~P0.15 — Port 0 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
P1.0~P1.15
I/O
P1.0~P1.15 — Port 1 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
P2.0~P2.1/AIN0~1
I/O
P2.0~P2.1 — Port 2 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
AIN0~AIN1 — ADC channel input 0~13 pins.
P2.2/AIN2/BOOT
I/O
P2.0~P2.1 — Port 2 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
AIN0~AIN1 — ADC channel input 0~13 pins.
I
BOOT — Internal pull-up in Boot loader, tie LOW to keep in Boot loader or left
HIGH to exit Boot loader and execute User program at boot time.
P2.3~P2.13/AIN3~13
I/O
P2.3~P2.13 — Port 2 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
AIN3~AIN13 — ADC channel input 0~13 pins.
P2.14
I/O
P2.14 — Port 2.14 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
32-Bit Cortex-M0 Micro-Controller
1.5 PIN DESCRIPTIONS
SONiX TECHNOLOGY CO., LTD Page 23 Version 2.0
Page 24
SN32F760 Series
P2.15
I/O
P2.15 — Port 2.15 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
P3.0~P3.9
I/O
P3.0~P3.9 — Port 3 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
P3.10/RESET
I/O
P3.10 — Port 3.10 bi-direction pin.
Schmitt trigger structure and built-in pull-up/pull-down resisters as input mode.
1. VDD1/VLCD1 is the I/O and LCD driver power input pin for P1.6~P1.15 and P3.0~P3.9. This
power input used for I/O power must be equal to VDD.
2. VDD12/VLCD12 is the double bonding pin with VDD1 and VDD2. This power input used for I/O
power must be equal to VDD.
3. VDD2/VLCD2 is the I/O and LCD driver power input pin for P0.10~P0.15 and P1.0~P1.5. If VDD2
voltage is lower than VDD, user should manually force to set the I/O port P1.6 and P1.7 as input
pull-down state in case of internal power collision.
4. VDD3/VLCD3 is the I/O and LCD driver power input pin for P0.0~P0.7. If VDD3 voltage is lower
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 26 Version 2.0
Page 27
SN32F760 Series
than VDD, user should manually force to set the I/O port P1.6 and P1.7 as input pull-down state
in case of internal power collision.
5. VDD1/VLCD1, VDD2/VLCD2, VDD3/VLCD3, and VDD12/VLCD12 power input shall not be floating.
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 27 Version 2.0
Page 28
SN32F760 Series
RPU
Output
Latch
Pin
GPIOn_CFG
I/O Input Bus
I/O Output Bus
GPIOPn_MODE
RPD
GPIOn_CFGGPIOPn_MODE
RPU
Output
Latch
Pin
GPIOn_CFG
I/O Input Bus
Output Bus
GPIOPn_MODE
RPD
GPIOn_CFG
GPIOPn_MODE
Specific Input Bus
Specific Input Function Control Bit
*. Specific Output
Function Control Bit
*. Some specific functions switch I/O direction directly, not through GPIOn_MODE register.
RPU
Output
Latch
Pin
GPIOn_CFG
I/O Input Bus
Output Bus
GPIOPn_MODE
RPD
GPIOn_CFG
GPIOPn_MODE
Specific Output Bus
Specific Input Function Control Bit
*. Specific Output
Function Control Bit
*. Some specific functions switch I/O direction directly, not through GPIOn_MODE register.
32-Bit Cortex-M0 Micro-Controller
1.6 PIN CIRCUIT DIAGRAMS
Normal Bi-direction I/O Pin.
Bi-direction I/O Pin Shared with Specific Digital Input Function, e.g. SPI, I2C…
Bi-direction I/O Pin Shared with Specific Digital Output Function, e.g. SPI, I2C…
SONiX TECHNOLOGY CO., LTD Page 28 Version 2.0
Page 29
SN32F760 Series
RPU
Output
Latch
Pin
GPIOn_CFG
I/O Input Bus
I/O Output Bus
GPIOPn_MODE
RPD
GPIOn_CFG
GPIOPn_MODE
*. Specific Output Function Control Bit
*. Some specific functions switch I/O direction directly, not through GPIOn_MODE register.
Analog IP Input Terminal
RPU
Output
Latch
Pin
GPIOn_CFG
I/O Input Bus
I/O Output Bus
GPIOPn_MODE
RPD
GPIOn_CFG
GPIOPn_MODE
*. Specific Output Function Control Bit
*. Some specific functions switch I/O direction directly, not through GPIOn_MODE register.
Analog IP Output Terminal
32-Bit Cortex-M0 Micro-Controller
Bi-direction I/O Pin Shared with Specific Analog Input Function, e.g. XIN, ADC…
Bi-direction I/O Pin Shared with Specific Analog Output Function, e.g. XOUT…
SONiX TECHNOLOGY CO., LTD Page 29 Version 2.0
Page 30
SN32F760 Series
2
2
2
0x0000 0000
64 KB on-chip FLASH
Reserved
8 KB SRAM
0x4000 0000
0x4008 0000
Peripheral
Reserved for Peripheral
0x6000 0000
Reserved for External
0xA000 0000
Reserved for External Device
0xE000 0000
Private Peripheral Bus
0xE010 0000
Reserved
0xFFFF FFFF
0x4000 0000
0x4000 2000
0x4000 4000
0x4000 6000
0x4000 8000
0x4001 0000
0x4001 2000
0x4001 4000
WDT
0x4001 6000
0x4001 8000
Reserved
0x4002 8000
0x4002 6000
Reserved
Reserved
I2C0
0x4004 4000
0x4004 6000
0x4004 8000
GPIO 2
GPIO 3
GPIO 0
GPIO 1
Reserved
0x4008 0000
0xE000 0000
0xE010 0000
0xE000 ED00
0xE000 F000
Reserved
NVIC
Debug Control
0xE000 E000
Reserved
SSP 0
USART0
SYS0
SSP 1
USART 1
0x4006 0000
FMC
Reserved
CT16B0
CT16B1
CT16B2
CT32B0
RTC
ADC
PMU
0x4006 4000
0x4006 2000
0x4005 6000
0x4004 C000
0x4004 A000
0x4003 2000
0x4001 E000
Reserved
Reserved
0x4001 A000
0x4003 4000
0x4005 8000
0x4005 A000
Reserved
0x1FFF 0000
0x2000 0000
0x2000 2000
SYS1
0x4005 E000
I2C 1
0x4005 C000
Reserved
PFPA
0x4004 2000
4 KB Boot ROM
0x1FFF 1000
Reserved
0x0001 0000
LCD
0x4003 6000
CT32B1
0x4000 A000
CT32B2
0x4000 C000
0x4001 C000
Reserved
32-Bit Cortex-M0 Micro-Controller
CENTRAL PROCESSOR UNIT (CPU)
2.1 MEMORY MAP
SONiX TECHNOLOGY CO., LTD Page 30 Version 2.0
Page 31
SN32F760 Series
SYSTICK_CALIB
SysTick interrupt
SYSTICK_LOAD
SYSTICK_VAL
24-bit down counter
CLKSOURCE
System Clock
Ref. clock
(Fix to 1)
1
0
SYSTICK_CTRL
clock
Load data
Private
Peripheral
Bus
ENABLE
COUNTFLAGTICKINT
Note: When the processor is halted for debugging the counter does not decrease.
32-Bit Cortex-M0 Micro-Controller
2.2 SYSTEM TICK TIMER
The SysTick timer is an integral part of the Cortex-M0. The SysTick timer is intended to generate a fixed 10-ms
interrupt for use by an operating system or other system management software.
Since the SysTick timer is a part of the Cortex-M0, it facilitates porting of software by providing a standard timer that is
available on Cortex-M0 based devices.
Refer to the Cortex-M0 User Guide for details.
2.2.1 OPERATION
The SysTick timer is a 24-bit timer that counts down to zero and generates an interrupt.
The intent is to provide a fixed 10-ms time interval between interrupts. The system tick timer is enabled through the
SysTick control register. The system tick timer clock is fixed to the frequency of the system clock.
The block diagram of the SysTick timer:
When SysTick timer is enabled, the timer counts down from the current value (SYSTICK_VAL) to zero, reloads to the
value in the SysTick Reload Value Register (SYSTICK_LOAD) on the next clock edge, then decrements on
subsequent clocks. When the counter transitions to zero, the COUNTFLAG status bit is set to 1. The COUNTFLAG bit
clears on reads.
SONiX TECHNOLOGY CO., LTD Page 31 Version 2.0
Page 32
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:17
Reserved
R
0
16
COUNTFLAG
This flag is set when the System Tick counter counts down to 0, and is
cleared by reading this register.
R/W
0
15:3
Reserved
R
0
2
CLKSOURCE
Selects the SysTick timer clock source.
0: reference clock.
1: system clock. (Fixed)
R
1
1
TICKINT
System Tick interrupt enable.
0: Disable the System Tick interrupt
1: Enable the System Tick interrupt, the interrupt is generated when the
System Tick counter counts down to 0.
R/W
0
0
ENABLE
System Tick counter enable.
0: Disable
1: Enable
R/W
0
Bit
Name
Description
Attribute
Reset
31:24
Reserved
R
0
23:0
RELOAD
Value to load into the SYSTICK_VAL when the counter is enabled and
when it reaches 0.
R/W
0x5F7F9B
32-Bit Cortex-M0 Micro-Controller
2.2.2 SYSTICK USAGE HINTS AND TIPS
The interrupt controller clock updates the SysTick counter. Some implementations stop this clock signal for low power
mode. If this happens, the SysTick counter stops.
Ensure SW uses word accesses to access the SysTick registers.
The SysTick counter reload and current value are not initialized by HW. This means the correct initialization sequence
for the SysTick counter is:
1. Program the reload value in SYSTICK_LOAD register.
2. Clear the current value by writing any value to SYSTICK_VAL register.
3. Program the Control and Status (SYSTICK_CTRL) register.
2.2.3 SYSTICK REGISTERS
2.2.3.1 System Tick Timer Control and Status register (SYSTICK_CTRL)
Address: 0xE000 E010 (Refer to Cortex-M0 Spec)
2.2.3.2 System Tick Timer Reload value register (SYSTICK_LOAD)
Address: 0xE000 E014 (Refer to Cortex-M0 Spec)
The RELOAD register is set to the value that will be loaded into the SysTick timer whenever it counts down to zero.
This register is set by software as part of timer initialization. The SYSTICK_CALIB register may be read and used as
the value for RELOAD if the CPU or external clock is running at the frequency intended for use with the
SYSTICK_CALIB value.
The following example illustrates selecting the SysTick timer reload value to obtain a 10 ms time interval with the
system clock set to 50 MHz.
The SysTick clock = system clock = 50 MHz
RELOAD = (system tick clock frequency × 10 ms) −1 = (50 MHz × 10 ms) −1
= 0x0007A11F.
SONiX TECHNOLOGY CO., LTD Page 32 Version 2.0
Page 33
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:24
Reserved
R
0
23:0
CURRENT
Reading this register returns the current value of the System Tick counter.
Writing any value clears the System Tick counter and the COUNTFLAG
bit in SYSTICK_CTRL.
R/W
0x7E7F35
Bit
Name
Description
Attribute
Reset
31
NOREF
Indicates the reference clock to M0 is provided or not.
1: No reference clock provided.
R
1
30
SKEW
Indicates whether the TENMS value is exact, an inexact TENMS value
can affect the suitability of SysTick as a software real time clock.
0: TENMS value is exact
1: TENMS value is inexact, or not given.
R
0
29:24
Reserved
R
0
23:0
TENMS
Reload value for 10ms timing, subject to system clock skew errors. If the
value reads as zero, the calibration value is not known.
R/W
0xA71FF
32-Bit Cortex-M0 Micro-Controller
2.2.3.3 System Tick Timer Current Value register (SYSTICK_VAL)
Address: 0xE000 E018 (Refer to Cortex-M0 Spec)
2.2.3.4 System Tick Timer Calibration Value register (SYSTICK_CALIB)
Address: 0xE000 E01C (Refer to Cortex-M0 Spec)
SONiX TECHNOLOGY CO., LTD Page 33 Version 2.0
Page 34
SN32F760 Series
Execution
No.
Priority
Function
Description
Address Offset
0
-
-
Reserved
0x0000 0000
1
-3
Reset
Reset
0x0000 0004
2
-2
NMI_Handler
Non maskable interrupt.
0x0000 0008
3
-1
HardFault_Handler
All class of fault
0x0000 000C
4~10
Reserved
Reserved
Reserved
-
11
Settable
SVCCalll
0x0000 002C
12~13
Reserved
Reserved
Reserved
-
14
Settable
PendSV
0x0000 0038
15
Settable
SysTick
0x0000 003C
16
Settable
IRQ0/ 0x0000 0040
17
Settable
IRQ1/ 0x0000 0044
18
Settable
IRQ2/LCDIRQ
LCD
0x0000 0048
19
Settable
IRQ3/I2SIRQ
I2S
0x0000 004C
20
Settable
IRQ4/ 0x0000 0050
21
Settable
IRQ5/ 0x0000 0054
22
Settable
IRQ6/SSP0IRQ
SSP0
0x0000 0058
23
Settable
IRQ7/SSP1IRQ
SSP1
0x0000 005C
24
Settable
IRQ8/ 0x0000 0060
25
Settable
IRQ9/ 0x0000 0064
26
Settable
IRQ10/I2C0IRQ
I2C0
0x0000 0068
27
Settable
IRQ11/I2C1IRQ
I2C1
0x0000 006C
28
Settable
IRQ12/
0x0000 0070
29
Settable
IRQ13/USART0IRQ
USART0
0x0000 0074
30
Settable
IRQ14/USART1IRQ
USART1
0x0000 0078
32-Bit Cortex-M0 Micro-Controller
2.3 NESTED VECTORED INTERRUPT CONTROLLER (NVIC)
All interrupts including the core exceptions are managed by the NVIC. NVIC has the following Features:
The NVIC supports 32 vectored interrupts.
4 programmable interrupt priority levels with hardware priority level masking.
Low-latency exception and interrupt handling.
Efficient processing of late arriving interrupts.
Implementation of System Control Registers
Software interrupt generation.
Address: 0xE000 E180 (Refer to Cortex-M0 Spec.)
The ICER disables interrupts, and shows the interrupts that are enabled.
SONiX TECHNOLOGY CO., LTD Page 35 Version 2.0
Page 36
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:0
CLRENA[31:0]
Interrupt clear-enable bits.
Write 0: No effect
1: Disable interrupt.
Read 0: Interrupt disabled
1: Interrupt enabled.
R/W
0
Note: Writing 1 to the ISPR bit corresponding to
1. an interrupt that is pending has no effect
2. a disabled interrupt sets the state of that interrupt to pending.
Bit
Name
Description
Attribute
Reset
31:0
SETPEND[31:0]
Interrupt set-pending bits.
Write 0: No effect
1: Change interrupt state to pending
Read 0: Interrupt is not pending
1: Interrupt is pending
R/W
0
Note: Writing 1 to an ICPR bit does not affect the active state of the corresponding interrupt.
Bit
Name
Description
Attribute
Reset
31:0
CLRPEND[31:0]
Interrupt clear-pending bits.
Write 0: No effect
1: Removes pending state of an interrupt
Read 0: Interrupt is not pending
1: Interrupt is pending
R/W
0
Bit
Name
Description
Attribute
Reset
31:24
PRI_(4*n+3)
Each priority field holds a priority value, 0-192. The lower the value, the
greater the priority of the corresponding interrupt. The processor implements
only bits[31:30] of each field, bits [29:24] read as zero and ignore writes. This
means writing 255 to a priority register saves value 192 to the register.
R/W
0
23:16
PRI_(4*n+2)
Each priority field holds a priority value, 0-192. The lower the value, the
greater the priority of the corresponding interrupt. The processor implements
only bits[23:22] of each field, bits [21:16] read as zero and ignore writes. This
Address: 0xE000 E400 + 0x4 * n (Refer to Cortex-M0 Spec.)
The interrupt priority registers provide an 8-bit priority field for each interrupt, and each register holds four priority fields.
This means the number of registers is implementation-defined, and corresponds to the number of implemented
interrupts.
SONiX TECHNOLOGY CO., LTD Page 36 Version 2.0
Page 37
SN32F760 Series
means writing 255 to a priority register saves value 192 to the register.
15:8
PRI_(4*n+1)
Each priority field holds a priority value, 0-192. The lower the value, the
greater the priority of the corresponding interrupt. The processor implements
only bits[15:14] of each field, bits [13:8] read as zero and ignore writes. This
means writing 255 to a priority register saves value 192 to the register.
R/W
0
7:0
PRI_4*n
Each priority field holds a priority value, 0-192. The lower the value, the
greater the priority of the corresponding interrupt. The processor implements
only bits[7:6] of each field, bits [5:0] read as zero and ignore writes. This
means writing 255 to a priority register saves value 192 to the register.
R/W
0
Note: To write to this register, user must write 0x05FA to the VECTKEY field at the same time, otherwise
the processor ignores the write.
Bit
Name
Description
Attribute
Reset
31:16
VECTKEY
Register key.
Read as unknown. Write 0x05FA to VECTKEY, otherwise the write is
ignored.
R/W
0
15
ENDIANESS
Data endianness implemented
0: Little-endian
1: Big-endian
R
0
14:3
Reserved
R
0
2
SYSRESETREQ
System reset request. This bit read as 0.
0: No effect
1: Requests a system level reset.
W
0
1
VECTCLRACTIVE
Reserved for debug use. This bit read as 0. When writing to the register
you must write 0 to this bit, otherwise behavior is Unpredictable.
W
0
0
Reserved
R
0
32-Bit Cortex-M0 Micro-Controller
2.4 APPLICATION INTERRUPT AND RESET CONTROL (AIRC)
Address: 0xE000 ED0C (Refer to Cortex-M0 Spec)
The entire MCU, including the core, can be reset by SW by setting the SYSRESREQ bit in the AIRC register in
The Stack Pointer (SP). In Thread mode, the CONTROL register indicates the stack pointer to use,
Main Stack Pointer (MSP) or Process Stack Pointer (PSP)
On reset, the processor loads the MSP with the value from address 0x00000000.
LR (R14)
The Link Register (LR). It stores the return information for subroutines, function calls, and exceptions.
PC (R15)
The Program Counter (PC). It contains the current program address.
On reset, the processor loads the PC with the value of the reset vector, at address 0x00000004.
PSR
The Program Status Register (PSR) combines:
• Application Program Status Register (APSR)
• Interrupt Program Status Register (IPSR)
• Execution Program Status Register (EPSR).
These registers are mutually exclusive bit fields in the 32-bit PSR.
PRIMASK
The PRIMASK register prevents activation of all exceptions with configurable priority.
CONTROL
The CONTROL register controls the stack used when the processor is in Thread mode.
32-Bit Cortex-M0 Micro-Controller
2.6 CORE REGISTER OVERVIEW
SONiX TECHNOLOGY CO., LTD Page 39 Version 2.0
Page 40
SN32F760 Series
3
3
3
VDD
VSS
VDD
VSS
Watchdog Normal Run
Watchdog Stop
System Normal Run
System Stop
LVD Detect Level
External Reset
Low Detect
External Reset
High Detect
Watchdog
Overflow
Watchdog
Reset Delay
Time
External
Reset Delay
Time
Power On
Delay Time
Power
External Reset
Watchdog Reset
System Status
32-Bit Cortex-M0 Micro-Controller
SYSTEM CONTROL
3.1 RESET
A system reset is generated when one of the following events occurs:
1. A low level on the RST pin (external reset).
2. Power-on reset (POR reset)
3. LVD reset
4. Watchdog Timer reset (WDT reset)
5. Software reset (SW reset)
6. DPDWAKEUP reset when exiting Deep power-down mode by DPDWAKEUP pin
The reset source can be identified by checking the reset flags in System Reset Status register (SYS0_RSTST).
These sources act on the RST pin and it is always kept low during the delay phase. The RESET service routine vector
is fixed at address 0x00000004 in the memory map. For more details, refer to Interrupt and Exception Vectors.
Finishing any reset sequence needs some time. The system provides complete procedures to make the power on reset
successful. For different oscillator types, the reset time is different. That causes the VDD rise rate and start-up time of
different oscillator is not fixed. RC type oscillator’s start-up time is very short, but the crystal type is longer. Under client
terminal application, users have to take care of the power on reset time for the master terminal requirement. The reset
timing diagram is as following.
3.1.1 POWER-ON RESET (POR)
The power on reset depends on LVD operation for most power-up situations. The power supplying to system is a rising
curve and needs some time to achieve the normal voltage. Power on reset sequence is as following:
Power-up: System detects the power voltage up and waits for power stable.
External reset (only external reset pin enable): System checks external reset pin status. If external reset pin is
not high level, the system keeps reset status and waits external reset pin released.
System initialization: All system registers is set as initial conditions and system is ready.
Oscillator warm up: Oscillator operation is successfully and supply to system clock.
Program executing: Power on sequence is finished and program executes from Boot loader.
SONiX TECHNOLOGY CO., LTD Page 40 Version 2.0
Page 41
SN32F760 Series
Note: Please refer to the “WATCHDOG TIMER” about watchdog timer detail information.
VDD
VSS
V1
V2
V3
System Work
Well Area
System Work
Error Area
32-Bit Cortex-M0 Micro-Controller
3.1.2 WATCHDOG RESET (WDT RESET)
Watchdog reset is a system protection. In normal condition, system works well and clears watchdog timer by program.
Under error condition, system is in unknown situation and watchdog can’t be clear by program before watchdog timer
overflow. Watchdog timer overflow occurs and the system is reset. After watchdog reset, the system restarts and
returns normal mode. Watchdog reset sequence is as following.
Watchdog timer status: System checks watchdog timer overflow status. If watchdog timer overflow occurs, the
system is reset.
System initialization: All system registers is set as initial conditions and system is ready.
Oscillator warm up: Oscillator operation is successfully and supply to system clock.
Program executing: Power on sequence is finished and program executes from 0x0.
Watchdog timer application note is as following.
Before clearing watchdog timer, check I/O status and check RAM contents can improve system error.
Don’t clear watchdog timer in interrupt vector and interrupt service routine. That can improve main routine fail.
Clearing watchdog timer program is only at one part of the program. This way is the best structure to enhance the
watchdog timer function.
3.1.3 BROWN-OUT RESET
3.1.3.1 BROWN OUT DESCRIPTION
The brown-out reset is a power dropping condition. The power drops from normal voltage to low voltage by external
factors (e.g. EFT interference or external loading changed). The brown out reset would make the system not work well
or executing program error.
Brown-Out Reset Diagram
The power dropping might through the voltage range that’s the system dead-band. The dead-band means the power
range can’t offer the system minimum operation power requirement. The above diagram is a typical brown out reset
diagram. There is a serious noise under the VDD, and VDD voltage drops very deep. There is a dotted line to separate
the system working area. The above area is the system work well area. The below area is the system work error area
called dead-band. V1 doesn’t touch the below area and not affect the system operation. But the V2 and V3 is under the
below area and may induce the system error occurrence. Let system under dead-band includes some conditions.
DC application:
The power source of DC application is usually using battery. When low battery condition and MCU drive any loading,
SONiX TECHNOLOGY CO., LTD Page 41 Version 2.0
Page 42
SN32F760 Series
Vdd (V)
System Rate (Fcpu)
System Mini.
Operating Voltage.
System Reset
Voltage.
Dead-Band Area
Normal Operating
Area
Reset Area
Note: The “Zener diode reset circuit”, “Voltage bias reset circuit” and “External reset IC” can completely
improve the brown out reset, DC low battery and AC slow power down conditions.
32-Bit Cortex-M0 Micro-Controller
the power drops and keeps in dead-band. Under the situation, the power won’t drop deeper and not touch the system
reset voltage. That makes the system under dead-band.
AC application:
In AC power application, the DC power is regulated from AC power source. This kind of power usually couples with AC
noise that makes the DC power dirty. Or the external loading is very heavy, e.g. driving motor. The loading operating
induces noise and overlaps with the DC power. VDD drops by the noise, and the system works under unstable power
situation.
The power on duration and power down duration are longer in AC application. The system power on sequence protects
the power on successful, but the power down situation is like DC low battery condition. When turn off the AC power, the
VDD drops slowly and through the dead-band for a while.
3.1.3.2 THE SYSTEM OPERATING VOLTAGE DECSRIPTION
To improve the brown out reset needs to know the system minimum operating voltage which is depend on the system
executing rate and power level. Different system executing rates have different system minimum operating voltage. The
electrical characteristic section shows the system voltage to executing rate relationship.
Normally the system operation voltage area is higher than the system reset voltage to VDD, and the reset voltage is
decided by LVD detect level. The system minimum operating voltage rises when the system executing rate upper even
higher than system reset voltage. The dead-band definition is the system minimum operating voltage above the system
reset voltage.
3.1.3.3 BROWN-OUT RESET IMPROVEMENT
How to improve the brown reset condition? There are some methods to improve brown out reset as following.
LVD reset
Watchdog reset
Reduce the system executing rate
External reset circuit. (Zener diode reset circuit, Voltage bias reset circuit, External reset IC)
SONiX TECHNOLOGY CO., LTD Page 42 Version 2.0
Page 43
SN32F760 Series
VDD
VSS
System Normal Run
System Stop
LVD Detect Voltage
Power On
Delay Time
Power
System Status
Power is below LVD Detect
Voltage and System Reset.
32-Bit Cortex-M0 Micro-Controller
LVD reset:
The LVD (low voltage detector) is built-in SONiX 32-bit MCU to be brown out reset protection. When the VDD drops
and is below LVD detect voltage, the LVD asserts an interrupt signal to the NVIC. This signal can be enabled for
interrupt in the Interrupt Enable Register in the NVIC in order to cause a CPU interrupt; if not, SW can monitor the
signal by reading a dedicated status register. An additional threshold level can be selected to cause a forced reset of
the chip. The LVD detect level is different by each MCU. The LVD voltage level is a point of voltage and not easy to
cover all dead-band range. Using LVD to improve brown out reset is dependent on application requirement and
environment. If the power variation is very deep, violent and trigger the LVD, the LVD can be the protection. If the
power variation can touch the LVD detect level and make system work error, the LVD can’t be the protection and need
to other reset methods. More detail LVD information is in the electrical characteristic section.
Watchdog reset:
The watchdog timer is a protection to make sure the system executes well. Normally the watchdog timer would be clear
at one point of program. Don’t clear the watchdog timer in several addresses. The system executes normally and the
watchdog won’t reset system. When the system is under dead-band and the execution error, the watchdog timer can’t
be clear by program. The watchdog is continuously counting until overflow occurrence. The overflow signal of
watchdog timer triggers the system to reset and return to normal mode after reset sequence. This method also can
improve brown out reset condition and make sure the system to return normal mode.
If the system reset by watchdog and the power is still in dead-band, the system reset sequence won’t be successful
and the system stays in reset status until the power return to normal range.
Reduce the system executing rate:
If the system rate is fast and the dead-band exists, to reduce the system executing rate can improve the dead-band.
The lower system rate is with lower minimum operating voltage. Select the power voltage that’s no dead-band issue
and find out the mapping system rate. Adjust the system rate to the value and the system exits the dead-band issue.
This way needs to modify whole program timing to fit the application requirement.
External reset circuit:
The external reset methods also can improve brown out reset and is the complete solution. There are three external
reset circuits to improve brown out reset including “Zener diode reset circuit”, “Voltage bias reset circuit” and “External
reset IC”. These three reset structures use external reset signal and control to make sure the MCU be reset under
power dropping and under dead-band. The external reset information is described in the next section.
3.1.4 EXTERNAL RESET
External reset function is controlled by External RESET pin control (SYS0_EXRSTCTRL) register. Default value is 1,
which means external reset function is enabled. External reset pin is Schmitt Trigger structure and low level active. The
system is running when reset pin is high level voltage input. The reset pin receives the low voltage and the system is
reset. The external reset operation actives in power on and normal running mode. During system power-up, the
external reset pin must be high level input, or the system keeps in reset status. External reset sequence is as following.
External reset (only external reset pin enable): System checks external reset pin status. If external reset pin is
System initialization: All system registers is set as initial conditions and system is ready.
SONiX TECHNOLOGY CO., LTD Page 43 Version 2.0
not high level, the system keeps reset status and waits external reset pin released.
Page 44
SN32F760 Series
MCU
VDD
VSS
VCC
GND
R
S
T
R1
47K ohm
C1
0.1uF
R2
100 ohm
Note: The reset circuit is no any protection against unusual power or brown out reset.
MCU
VDD
VSS
VCC
GND
R
S
T
R1
47K ohm
C1
0.1uF
DIODE
R2
100 ohm
32-Bit Cortex-M0 Micro-Controller
Oscillator warm up: Oscillator operation is successfully and supply to system clock.
Program executing: Power on sequence is finished and program executes fromBoot loader.
The external reset can reset the system during power on duration, and good external reset circuit can protect the
system to avoid working at unusual power condition, e.g. brown out reset in AC power application.
3.1.4.1 SIMPLY RC RESET CIRCUIT
This is the basic reset circuit, and only includes R1 and C1. The RC circuit operation makes a slow rising signal into
reset pin as power up. The reset signal is slower than VDD power up timing, and system occurs a power on signal from
the timing difference.
3.1.4.2 DIODE & RC RESET CIRCUIT
This is the better reset circuit. The R1 and C1 circuit operation is like the simply reset circuit to make a power on signal.
The reset circuit has a simply protection against unusual power. The diode offers a power positive path to conduct
higher power to VDD. It is can make reset pin voltage level to synchronize with VDD voltage. The structure can
SONiX TECHNOLOGY CO., LTD Page 44 Version 2.0
Page 45
SN32F760 Series
Note: The R2 100 ohm resistor of “Simply reset circuit” and “Diode & RC reset circuit” is necessary to
limit any current flowing into reset pin from external capacitor C in the event of reset pin
breakdown due to Electrostatic Discharge (ESD) or Electrical Over-stress (EOS).
MCU
VDD
VSS
VCC
GND
R
S
T
R1
33K ohm
R3
40K ohm
R2
10K ohm
Vz
Q1
E
C
B
MCU
VDD
VSS
VCC
GND
R
S
T
R1
47K ohm
R3
2K ohm
R2
10K ohm
Q1
E
C
B
32-Bit Cortex-M0 Micro-Controller
improve slight brown out reset condition.
3.1.4.3 ZENER DIODE RESET CIRCUIT
The Zener diode reset circuit is a simple low voltage detector and can improve brown out reset condition
completely. Use Zener voltage to be the active level. When VDD voltage level is above “Vz + 0.7V”, the C terminal of
the PNP transistor outputs high voltage and MCU operates normally. When VDD is below “Vz + 0.7V”, the C terminal of
the PNP transistor outputs low voltage and MCU is in reset mode. Decide the reset detect voltage by Zener
specification. Select the right Zener voltage to conform the application.
3.1.4.4 VOLTAGE BIAS RESET CIRCUIT
The voltage bias reset circuit is a low cost voltage detector and can improve brown out reset condition completely.
The operating voltage is not accurate as Zener diode reset circuit. Use R1, R2 bias voltage to be the active level. When
VDD voltage level is above or equal to “0.7V x (R1 + R2) / R1”, the C terminal of the PNP transistor outputs high
SONiX TECHNOLOGY CO., LTD Page 45 Version 2.0
Page 46
SN32F760 Series
Note: Under unstable power condition as brown out reset, “Zener diode reset circuit” and “Voltage bias
reset circuit” can protects system no any error occurrence as power dropping. When power drops
below the reset detect voltage, the system reset would be triggered, and then system executes
reset sequence. That makes sure the system work well under unstable power situation.
MCU
VDD
VSS
VCC
GND
R
S
T
Reset
IC
VDD
VSS
RST
Bypass
Capacitor
0.1uF
32-Bit Cortex-M0 Micro-Controller
voltage and MCU operates normally. When VDD is below “0.7V x (R1 + R2) / R1”, the C terminal of the PNP transistor
outputs low voltage and MCU is in reset mode.
Decide the reset detect voltage by R1, R2 resistances. Select the right R1, R2 value to conform the application. In the
circuit diagram condition, the MCU’s reset pin level varies with VDD voltage variation, and the differential voltage is
0.7V. If the VDD drops and the voltage lower than reset pin detect level, the system would be reset. If want to make the
reset active earlier, set the R2 > R1 and the cap between VDD and C terminal voltage is larger than 0.7V. The external
reset circuit is with a stable current through R1 and R2. For power consumption issue application, e.g. DC power
system, the current must be considered to whole system power consumption.
3.1.4.5 EXTERNAL RESET IC
The external reset circuit also uses external reset IC to enhance MCU reset performance. This is a high cost and good
effect solution. By different application and system requirement to select suitable reset IC. The reset circuit can improve
all power variation.
3.1.5 SOFTWARE RESET
The entire MCU, including the core, can be reset by software by setting the SYSRESREQ bit in the AIRC (Application
Interrupt and Reset Control) register in Cortex-M0 spec.
The software-initiated system reset sequence is as follows:
1. A software reset is initiated by setting the SYSRESREQ bit.
2. An internal reset is asserted.
3. The internal reset is deasserted and the MCU loads from memory the initial stack pointer, the initial program
counter, and the first instruction designated by the program counter, and then begins execution.
SONiX TECHNOLOGY CO., LTD Page 46 Version 2.0
Page 47
SN32F760 Series
Note: The ILRC can ONLY be switched on and off by HW.
32-Bit Cortex-M0 Micro-Controller
3.2 SYSTEM CLOCK
Different clock sources can be used to drive the system clock (SYSCLK):
Each clock source can be switched on or off independently when it is not used, to optimize power consumption.
The micro-controller is a dual clock system. There are high-speed clock and low-speed clock. The high-speed clock is
generated from the external oscillator & on-chip PLL circuit. The low-speed clock is generated from on-chip low-speed
RC oscillator circuit (ILRC 16 KHz).
3.2.1 INTERNAL RC CLOCK SOURCE
3.2.1.1 Internal High-speed RC Oscillator (IHRC)
The internal high-speed oscillator is 12MHz RC type. The accuracy is ±2% under commercial condition.
The IHRC can be switched on and off using the IHRCEN bit in Analog Block Control register (SYS0_ANBCTRL).
3.2.1.2 Internal Low-speed RC Oscillator (ILRC)
The system low clock source is the internal low-speed oscillator built in the micro-controller. The low-speed oscillator
uses RC type oscillator circuit. The frequency is affected by the voltage and temperature of the system. In common
condition, the frequency of the RC oscillator is about 32 KHz.
SONiX TECHNOLOGY CO., LTD Page 47 Version 2.0
Page 48
SN32F760 Series
PFDLPFVCO
DIV
M
DIV
P
Fclkout
FvcoFclkin
DIV
F
32-Bit Cortex-M0 Micro-Controller
3.2.2 PLL
SONiX 32-bit MCU uses the PLL to create the clocks for the core and peripherals. The input frequency range is 10MHz
to 25MHz. The input clock is divided down and fed to the Phase-Frequency Detector (PFD). This block compares the
phase and frequency of its inputs, and generates a control signal when phase and/ or frequency do not match. The
loop filter filters these control signals and drives the voltage controlled oscillator (VCO), which generates the main clock
and optionally two additional phases. The VCO frequency range is 156MHz to 320MHz. These clocks are divided by P
by the programmable post divider to create the output clock(s). The VCO output clock is then divided by M by the
programmable feedback divider to generate the feedback clock. The output signal of the phase-frequency detector is
also monitored by the lock detector, to signal when the PLL has locked on to the input clock.
The PLL settling time is 100 μs.
3.2.2.1 PLL Frequency selection
The PLL frequency equations:
F
VCO
F
CLKOUT
= F
CLKIN
= F
/ F * M
/ P
VCO
The PLL frequency is determined by the following parameters:
F
F
F
: Frequency from the PLLCLKSEL multiplexer.
CLKIN
: Frequency of the Voltage Controlled Oscillator (VCO); 156 to 320 MHz.
VCO
: Frequency of PLL output.
CLKOUT
P: System PLL post divider ratio, controlled by PSEL bits in PLL control register (SYS0_PLLCTRL).
F: System PLL front divider ratio, controlled by FSEL bits in PLL control register (SYS0_PLLCTRL).
M: System PLL feedback divider ratio, controlled by MSEL bits in PLL control register (SYS0_PLLCTRL).
To select the appropriate values for M, P, and F, it is recommended to follow these constraints:
Note: Connect the Crystal/Ceramic and C as near as possible to the XIN/XOUT/VSS pins of MCU.
Oscillator Mode
XTALIN pin
XTALOUT pin
IHRC
GPIO
GPIO
EHS X’TAL
Crystal/Ceramic
Crystal/Ceramic
4MHz Ceramic
4MHz Crystal
32-Bit Cortex-M0 Micro-Controller
3.2.3 EXTERNAL CLOCK SOURCE
3.2.3.1 External High-speed (EHS) Clock
External high clock includes Crystal/Ceramic modules. The startup time of Crystal is longer. The oscillator start-up time
decides reset time length.
3.2.3.2 CRYSTAL/CERAMIC
Crystal/Ceramic devices are driven by XIN, XOUT pins. For high/normal/low frequency, the driving currents are
different.
Structure: 1MHz~25MHz EHS external crystal/ceramic resonator
Main Purpose: System high clock source, RTC clock source, and PLL clock source.
Warm-up Time: 2048*F
XIN/XOUT Shared Pin Selection:
SONiX TECHNOLOGY CO., LTD Page 49 Version 2.0
EHS
Page 50
SN32F760 Series
Note: Connect the Crystal/Ceramic and C as near as possible to the LXIN/LXOUT/VSS pins of MCU. The
capacitor between LXIN/LXOUT and VSS must be 10pF.
Clock Source
H/W Configuration
Description
External clock source
(Bypass)
In Bypass mode, the external clock signal
(square, sinus or triangle) with ~50% duty
cycle must be provided to drive the XTALIN/
LXTALIN pin while the XTALOUT/
LXTALOUT pin should be the inverse of
theinput clock signal.
EHS X’tal can have a frequency of up to 25
MHz. Select this mode by setting EHSEN bit
in Analog Block Control register
(SYS0_ANBCTRL).
MCU
VCC
GND
C
10pF
LXIN
L
XOU
T
VDD
VSS
C
10pF
32768Hz
32-Bit Cortex-M0 Micro-Controller
The resonator and the load capacitors have to be placed as close as possible to the oscillator pins in order to minimize
output distortion and startup stabilization time. The loading capacitance values must be adjusted according to the
selected oscillator.
The EHS crystal is switched on and off using the EHSEN bit in Analog Block Control register (SYS0_ANBCTRL).
3.2.3.3 External Low-speed (ELS) Clock
The low-speed oscillator can use 32768 crystal oscillator circuit.
3.2.3.4 CRYSTAL
Crystal devices are driven by LXIN, LXOUT pins. The 32768 crystal and 10pF capacitor must be as near as possible to
MCU. The ELS crystal is switched on and off using the ELSEN bit in Analog Block Control register (SYS0_ANBCTRL).
3.2.3.5 Bypass Mode
SONiX TECHNOLOGY CO., LTD Page 50 Version 2.0
Page 51
SN32F760 Series
ELS X’TAL must have a frequency of 32.768
KHz. You select this mode by setting
ELSEN bit in Analog Block Control register
(SYS0_ANBCTRL).
External X’TAL
(EHS/ELS X’TAL)
The 10 to 25 MHz EHS X’TAL has the
advantage of producing a very accurate rate
on the main clock
ELS X’TAL must have a frequency of 32.768
KHz.
32-Bit Cortex-M0 Micro-Controller
3.2.4 SYSTEM CLOCK (SYSCLK) SELECTION
After a system reset, the IHRC is selected as system clock. When a clock source is used directly or through the PLL as
system clock, it is not possible to stop it.
A switch from one clock source to another occurs only if the target clock source is ready (clock stable after startup
delay or PLL locked). If a clock source which is not yet ready is selected, the switch will occur when the clock source is
ready.
Ready bits in SYS0_CSST register indicate which clock(s) is (are) ready and SYSCLKST bits in SYS0_CLKCFG
register indicate which clock is currently used as system clock.
3.2.5 CLOCK-OUT CAPABITITY
The MCU clock output (CLKOUT) capability allows the clock to be output onto the external CLKOUT pin. The
configuration registers of the corresponding GPIO port must be programmed in alternate function mode.
One of 6 clock signals can be selected as clock output:
1. HCLK
2. IHRC
3. ILRC
4. PLL clock output
5. ELS X’TAL
6. EHS X’TAL
The selection is controlled by the CLKOUTSEL bits in SYS1_AHBCLKEN register.
SONiX TECHNOLOGY CO., LTD Page 51 Version 2.0
Page 52
SN32F760 Series
Note: EHSEN / ELSEN / IHRCEN bit can NOT be cleared if the EHS X’tal / ELS X’tal / IHRC is selected as
system clock or is selected to become the system clock.
Bit
Name
Description
Attribute
Reset
31:6
Reserved
R
0
5
EHSFREQ
Frequency range (driving ability) of EHS X’TAL
0: <=12MHz
1: >12MHz
PLL clock ready flag
0: PLL unlocked
1: PLL locked
R
0
5
Reserved
R
0
4
EHSRDY
External high-speed clock ready flag
0: EHS oscillator not ready
1: EHS oscillator ready
R
0
3
Reserved
R
0
2
ELSRDY
External low-speed clock ready flag
0: ELS oscillator not ready
1: ELS oscillator ready
R
0
1
Reserved
R
0
0
IHRCRDY
IHRC ready flag
0: IHRC not ready
1: IHRC ready
R
1
Bit
Name
Description
Attribute
Reset
31:7
Reserved
R
0
6:4
SYSCLKST[2:0]
System clock switch status
Set and cleared by HW to indicate which clock source is used as system
clock.
000: IHRC is used as system clock
001: ILRC is used as system clock
010: EHS X’TAL is used as system clock
011: ELS X’TAL is used as system clock
100: PLL is used as system clock
Other: Reserved
R
0
3
Reserved
R
0
2:0
SYSCLKSEL[2:0]
System clock switch
Set and cleared by SW.
000: IHRC
001: ILRC
3.3.4 System Clock Configuration register (SYS0_CLKCFG)
Address Offset: 0x0C
3.3.5 AHB Clock Prescale register (SYS0_AHBCP)
Address Offset: 0x10
SONiX TECHNOLOGY CO., LTD Page 54 Version 2.0
Page 55
SN32F760 Series
1001: SYSCLK / 512
Other: Reserved
Bit
Name
Description
Attribute
Reset
31:5
Reserved
R
0
4
PORRSTF
POR reset flag
Set by HW when a POR reset occurs.
0: ReadNo POR reset occurred
WriteClear this bit
1: POR reset occurred.
R/W
1
3
EXTRSTF
External reset flag
Set by HW when a reset from the RESET pin occurs.
0: ReadNo reset from RESET pin occurred
WriteClear this bit
1: Reset from RESET pin occurred.
R/W
0 2 LVDRSTF
LVD reset flag
Set by HW when a LVD reset occurs.
0: ReadNo LVD reset occurred
WriteClear this bit
1: LVD reset occurred.
R/W
0 1 WDTRSTF
WDT reset flag
Set by HW when a WDT reset occurs.
0: ReadNo watchdog reset occurred
WriteClear this bit
1: Watchdog reset occurred.
R/W
0 0 SWRSTF
Software reset flag
Set by HW when a software reset occurs.
0: ReadNo software reset occurred
WriteClear this bit
1: Software reset occurred.
R/W
1
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15
LVDEN
LVD enable
0: Disable
1: Enable
R/W
0
14
LVDRSTEN
LVD Reset enable
0: Disable
1: Enable
R/W
0
13:7
Reserved
R
0
6:4
LVDINTLVL[2:0]
LVD interrupt level
000: 1.80V
001: 2.00V
R/W
0
32-Bit Cortex-M0 Micro-Controller
3.3.6 System Reset Status register (SYS0_RSTST)
Address Offset: 0x14
This register contains the reset source except DPDWAKEUP reset, since the MODE bits in PMU_CTRL register had
presented this case.
3.3.7 LVD Control register (SYS0_LVDCTRL)
Address Offset: 0x18
The LVD control register selects four separate threshold values for generating a LVD interrupt to the NVIC or LVD
Address Offset: 0x10
All bits are cleared by HW automatically after setting as “1”.
SONiX TECHNOLOGY CO., LTD Page 61 Version 2.0
Page 62
SN32F760 Series
12
SSP0RST
SSP0 reset
0: No effect
1: Reset SSP0
R/W
0
11
ADCRST
ADC reset
0: No effect
1: Reset ADC
R/W
0
10
CT32B2RST
CT32B2 reset
0: No effect
1: Reset CT32B2
R/W
0 9 CT32B1RST
CT32B1 reset
0: No effect
1: Reset CT32B1
R/W
0 8 CT32B0RST
CT32B0 reset
0: No effect
1: Reset CT32B0
R/W
0
7
CT16B2RST
CT16B2 reset
0: No effect
1: Reset CT16B2
R/W
0
6
CT16B1RST
CT16B1 reset
0: No effect
1: Reset CT16B1
R/W
0
5
CT16B0RST
CT16B0 reset
0: No effect
1: Reset CT16B0
R/W
0
4
Reserved
R 0
3
GPIOP3RST
GPIO port 3 reset
0: No effect
1: Reset GPIO port 3
R/W
0 2 GPIOP2RST
GPIO port 2 reset
0: No effect
1: Reset GPIO port 2
R/W
0 1 GPIOP1RST
GPIO port 1 reset
0: No effect
1: Reset GPIO port 1
R/W
0
0
GPIOP0RST
GPIO port 0 reset
0: No effect
1: Reset GPIO port 0
R/W
0
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 62 Version 2.0
Page 63
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:0
Dividend[31:0]
Unsigned integer Dividend
R/W
0
Note: Quotient is 0xFFFFFFFF when Divisor is 0x0, instead of occurring Hard Fault, since FW shall be
able to handle this case.
Bit
Name
Description
Attribute
Reset
31:0
Divisor[31:0]
Unsigned integer Divisor
R/W
0
Note: Quotient is 0xFFFFFFFF when Divisor is 0x0, instead of occurring Hard Fault, since FW shall be
able to handle this case.
Bit
Name
Description
Attribute
Reset
31:0
Quotient[31:0]
Unsigned integer Quotient
R/W
0
Bit
Name
Description
Attribute
Reset
31:0
Remainder[31:0]
Unsigned integer Remainder
R/W
0
32-Bit Cortex-M0 Micro-Controller
3.4.6 Divider Dividend register (SYS1_DIVIDEND)
Address Offset: 0x20
3.4.7 Divider Divisor register (SYS1_DIVISOR)
Address Offset: 0x24
3.4.8 Divider Quotient register (SYS1_QUOTIENT)
Address Offset: 0x28
3.4.9 Divider Remainder register (SYS1_REMAINDER)
Address Offset: 0x2C
SONiX TECHNOLOGY CO., LTD Page 63 Version 2.0
Page 64
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:1
Reserved
R
0
0
DIVS
Divider start control bit.
0: Divider stops/finishes operation.
1: Start to execute Dividing. DIVS is cleared by HW automatically when
the operation of dividing finishes.
R/W
0
32-Bit Cortex-M0 Micro-Controller
3.4.10 Divider Control register (SYS1_DIVCTRL)
Address Offset: 0x30
SONiX TECHNOLOGY CO., LTD Page 64 Version 2.0
Page 65
SN32F760 Series
4
4
4
Note:
1. The debug mode is not supported in Deep-sleep and Deep Power-down mode.
2. The pins which are not pin-out shall be set correctly to decrease power consumption in
low-power modes. Strongly recommended to set these pins as input pull-up.
32-Bit Cortex-M0 Micro-Controller
SYSTEM OPERATION MODE
4.1 OVERVIEW
The chip builds in four operating mode for difference clock rate and power saving reason. These modes control
oscillators, op-code operation and analog peripheral devices’ operation.
Normal mode
Sleep mode
Deep sleep mode
Deep Power-down mode
4.2 NORMAL MODE
In Normal mode, the ARM Cortex-M0 core, memories, and peripherals are clocked by the system clock. The
SYS1_AHBCLKEN register controls which peripherals are running.
Selected peripherals have individual peripheral clocks with their own clock dividers in addition to the system clock. The
peripheral clocks can be disabled respectively.
The power to various analog blocks (IHRC, EHS X’TAL, ELS X’TAL, PLL, Flash, LVD, ADC) can be controlled at any
time individually through the enable bit of all blocks.
4.3 LOW-POWER MODES
There are three special modes of processor power reduction: Sleep mode, Deep-sleep mode, and Deep power-down
mode. The PMU_CTRL register controls which mode is desired.
The CPU clock rate may also be controlled as needed by changing clock sources, re-configuring PLL values, and/or
altering the system clock divider value. This allows a trade-off of power versus processing speed based on application
requirements.
Run-time power control allows disable the clocks to individual on-chip peripherals, allowing fine tuning of power
consumption by eliminating all dynamic power use in any peripherals that are not required for the application. Selected
peripherals have their own clock divider for power control.
4.3.1 SLEEP MODE
In Sleep mode, the system clock to the ARM Cortex-M0 core is stopped and execution of instructions is suspended.
Peripheral functions, if selected to be clocked in SYS1_AHBCLKEN register, continue operation during Sleep mode
and may generate interrupts to cause the processor to resume execution. Sleep mode eliminates dynamic power used
SONiX TECHNOLOGY CO., LTD Page 65 Version 2.0
Page 66
SN32F760 Series
Note: User SHALL decide to power down low speed clock source (ELS X’TAL, ILRC oscillator) or not
if RTC or LCD is enabled.
32-Bit Cortex-M0 Micro-Controller
by the processor itself, memory systems and related controllers, and internal buses.
The power state of the analog blocks (IHRC, EHS X’TAL, ELS X’TAL, PLL, Flash, LVD, ADC) is determined by the
enable bit of all blocks.
The processor state and registers, peripheral registers, and internal SRAM values are maintained and the logic levels
of the pins remain static.
Wake up the chip from Sleep mode by an interrupt occurs.
The RESET pin has keep functionality in Sleep mode.
The Sleep mode is entered by using the following steps:
1. Write 4 to PMU_CTRL register.
2. Execute ARM Cortex-M0 WFI instruction.
4.3.2 DEEP-SLEEP MODE
In Deep-sleep mode, the system clock to the ARM Cortex-M0 core is stopped, and execution of instructions is
suspended.
The clock to the peripheral functions are stopped because the power state of oscillators are powered down, the clock
source are stopped, except RTC or LCD low speed clock source (ELS X’TAL, ILRC) if used.
The processor state and registers, peripheral registers, and internal SRAM values are maintained and the logic levels
of the pins remain static.
All GPIO pins are served as wakeup pins. The user must program the GPIO registers for each pin to set the
appropriate edge polarity for the corresponding wakeup event, only edge sensitive is supported to wakeup MCU. The
system will exit Deep-sleep mode when GPIO indicates a GPIO interrupt to the ARM core. Furthermore, the interrupts
corresponding to each input must be enabled in the NVIC.
The RESET pin has keep functionality in Deep-sleep mode.
The Deep-sleep mode is entered by using the following steps:
1. Write 2 to PMU_CTRL register.
2. Execute ARM WFI instruction.
The advantage of the Deep-sleep mode is that can power down clock generating blocks such as oscillators and PLL,
thereby gaining far greater dynamic power savings over Sleep mode. In addition, the Flash can be powered down in
Deep-sleep mode resulting in savings in static leakage power, however at the expense of longer wake-up times for the
Flash memory.
4.3.3 DEEP POWER-DOWN (DPD) MODE
In Deep power-down mode, power (Turn off the on-chip voltage regulator) and clocks are shut off to the entire chip with
the exception of the GPIO pins.
The processor state and registers, peripheral registers, and internal SRAM values are not retained. However, the chip
can retain data in four BACKUP registers, and the status of all GPIO pins can also be latched.
SONiX TECHNOLOGY CO., LTD Page 66 Version 2.0
Page 67
SN32F760 Series
32-Bit Cortex-M0 Micro-Controller
All GPIO pins can be served as DPDWAKEUP pins. However, the DPDWAKEUP pins which are used to wake up MCU
shall be set as input pull-up and keep in HIGH level before entering Deep power-down mode. The user must program
the GPIO registers for each pin to set the appropriate GPIO status (input pull-up, input pull-down, input floating, output
high, and output low, open-drain) and then program PMU_LATCHCTRL1 register to latch the status of all GPIO pins.
When any of the DPDWAKEUP pins is pulled LOW, MCU wakes up from Deep power-down mode. The on-chip voltage
regulator will be turned on, and when the core voltage reaches the power-on-reset (POR) trip point, a system reset will
be triggered and the chip re-boots.
Once the chip has rebooted, the user can read PMU_CTRL register to verify that the reset was caused by a wake-up
event from Deep power-down and was not a cold reset. If MCU wakes up from Deep power-down mode, the user must
program GPIO registers with the same settings (input pull-up, input pull-down, input floating, output high, and output
low) and then program PMU_LATCHCTRL2 register to release the status of all GPIO pins.
The RESET pin has no functionality in Deep power-down mode.
4.3.3.1 Entering Deep power-down mode
Follow these steps to enter Deep power-down mode from Normal mode:
1. Disable analog IP (ADC, LCD, HXTAL, LXTAL), External reset, SWD.
2. Setup the desired GPIO status of all GPIO pins. The DPDWAKEUP pins which are used to wake up MCU shall
be set as input-pull up and keep in HIGH level. (Strongly recommended to set output high first, and then set as
input pull-up to reduce pull-up time)
3. (Optional) Save data to be retained during Deep power-down to the DATA bits in Backup registers.
4. Write 0x5A5A0001 to PMU_LATCHCTRL1 register to latch the status of all GPIO pins.
5. Write 1 to PMU_CTRL register.
6. Time spent between step 1 and step 5 shall longer than 20 us.
7. Execute ARM Cortex-M0 WFI/WFE instruction.
After step 7, the PMU turns off the on-chip voltage regulator and waits for a wake-up signal from the DPDWAKEUP
pins.
4.3.3.2 Exiting Deep power-down mode
Follow these steps to wake up the chip from Deep power-down mode:
1. Any of the DPDWAKEUP pins level is from HIGH to LOW.
– The PMU will turn on the on-chip voltage regulator. When the core voltage reaches the power-on-reset (POR)
Trigger point, a system reset will be triggered and the chip reboots.
– All registers will be reset, except the Backup registers and PMU_CTRL register.
2. Read the PMU_CTRL register to verify that the reset was caused by a wake-up event from Deep power-down and
was not a cold reset.
3. Clear PMU_CTRL register.
4. (Optional) Read the stored data in the backup registers.
5. Setup the same GPIO status of all GPIO pins as step 2 of 4.3.3.1.
6. Write 0x5A5A0001 to PMU_LATCHCTRL2 register to release the status of all GPIO pins.
7. Setup the PMU for the next Deep power-down cycle.
SONiX TECHNOLOGY CO., LTD Page 67 Version 2.0
Page 68
SN32F760 Series
Note: Wakeup from Sleep mode spends NO wakeup time if the clock doesn’t stop.
32-Bit Cortex-M0 Micro-Controller
4.4 WAKEUP
4.4.1 OVERVIEW
Under low power mode, program doesn’t execute. The wakeup trigger can wake the system up to normal mode. The
wakeup function builds in interrupt operation and trigger system executing interrupt service routine as system wakeup
occurrence.
The wakeup trigger sources of the Sleep mode are all interrupts and the RESET pin.
The wakeup trigger sources of the Deep-sleep mode are the GPIO interrupt, RTC interrupt, LCD interrupt, and the
RESET pin.
The wakeup trigger sources of the Deep Power-down mode are DPDWAKEUP pins which are input pull-up and
latched before entering DPD mode.
4.4.2 WAKEUP TIME
When the system is in Sleep mode, the high clock is enabled or disabled by F/W. If the high clock stops and MCU is
waken up from Sleep mode, MCU waits for 2048 external high-speed oscillator clocks and 32 internal high-speed
oscillator clocks as the wakeup time to stable the oscillator circuit. After the wakeup time, the system goes into the
normal mode.
When the system is in Deep-sleep mode, the high clock will stop. When MCU is waken up from Deep-sleep mode,
MCU waits for 2T*ILRC and IHRC/EHS warm up time(32T*IHRC/2048T*EHS). After the wakeup time, the system goes
into the normal mode.
The value of the external high clock oscillator wakeup time from Deep sleep mode is as the following.
The total Wakeup time of EHS X’tal = 2T*ILRC + 1/F
* 2048 (sec) + high clock start-up time
EHS
Example: F
= 62.5us + 112.4 us + oscillator start-up time (F
The value of the IHRC wakeup time is as the following.
=20MHz, the wakeup time from Deep sleep mode is as the following.
EHS
The total Wakeup time = 2T*ILRC + 1/F
* 2048 + oscillator start-up time
EHS
The total Wakeup time of IHRC = 2T*ILRC + 1/F
* 32 (sec)
IHRC
Example: F
The total Wakeup time = 2T*ILRC + 1/F
SONiX TECHNOLOGY CO., LTD Page 68 Version 2.0
=12MHz, the wakeup time is as the following.
IHRC
* 32 = 62.5us + 2.67 us (F
IHRC
= 12MHz)
IHRC
= 20MHz)
EHS
Page 69
SN32F760 Series
Note: The high clock start-up time is depended on the VDD and oscillator type of high clock.
Deep power-down
mode
Reset
Run
mode
Deep-sleep
mode
Sleep
mode
Wake-up condition
Interrupt
Wake-up condition
GPIO Wakeup
RTC interrupt
LCD interrupt
Wake-up condition
Pulling any of the
DPDWAKEUP pins LOW
Reset condition
One of reset trigger sources
actives
Reset condition
One of reset trigger sources
actives
Enter mode condition
1. PMU_CTRL = 4
2. WFI instruction
Enter mode condition
1. Pull High DPDWAKEUP
pins
2. DPDEN = 1
3. WFI instruction
Enter mode condition
1. PMU_CTRL = 2
2. WFI instruction
32-Bit Cortex-M0 Micro-Controller
4.5 STATE MACHINE OF PMU
SONiX TECHNOLOGY CO., LTD Page 69 Version 2.0
Page 70
SN32F760 Series
Operation
Mode
Normal Mode
Low-Power Mode
Sleep Mode
Deep-Sleep Mode
Deep Power-down Mode
IHRC
By IHRCEN
Disable
OFF
ILRC
ON
***
OFF
EHS X’TAL
By EHSEN
Disable
OFF
ELS X’TAL
By ELSEN
***
OFF
PLL
By PLLEN
Disable
OFF
Cortex-M0
Running
Stop
Stop
Stop
Flash ROM
Enable
Disable
Disable
OFF
RAM
Enable
Maintain
Maintain
OFF
ADC
By ADENB
Disable
Disable
LVD
By LVDEN
Disable
OFF
LCD
By LCDENB
***
OFF
RTC
By RTCEN
By RTCEN
OFF
Peripherals
By Enable bit of each peripherals
Disable HCLK
OFF
IO status
-
Maintained
Maintained
Latched
Wakeup
Source
N/A
All interrupts,
RESET pin
GPIO interrupt,
RTC interrupt,
LCD interrupt,
RESET pin
DPDWAKEUP pins
(which are input pull-up)
LCDENB
LCDCLK
RTCENB
RTC_CLKS
ILRC*
ELS*
0
--0
--- X X 1 0 (ILRC)
O X 1 (ELS)
X
O
1
0 (ILRC)
0
---
O
X
1 (ELS)
X
O
1
0 (ILRC)
1
0 (ILRC)
O
X
1 (ELS)
1 (ELS)
X
O
1
0 (ILRC)
1
1 (ELS)
O
O
1 (ELS)
0 (ILRC)
O
O
32-Bit Cortex-M0 Micro-Controller
4.6 OPERATION MODE COMPARSION TABLE
***
SONiX TECHNOLOGY CO., LTD Page 70 Version 2.0
Page 71
SN32F760 Series
Note: Backup registers will be reset only when all power has been completely removed from the chip.
Bit
Name
Description
Attribute
Reset
31:8
Reserved
R
0
7:0
BACKUPDATA[7:0]
BACKUPDATA Data retained during Deep power-down mode.
R/W
0
Note: 1. The PMU_CTRL register retains data through the Deep power-down mode when power is still
applied to the VDD pin, and will be reset only when all power has been completely removed from
the chip.
2. The pins which are not pin-out shall be set correctly to decrease power consumption in low-
power modes. Strongly recommended to set these pins as input pull-up.
Bit
Name
Description
Attribute
Reset
31:3
Reserved
R
0
2:0
MODE[2:0]
Low power mode selection
000: Disable.
001: WFI instruction will make MCU enter Deep-power down mode.
010: WFI instruction will make MCU enter Deep-sleep mode.
100: WFI instruction will make MCU enter Sleep mode.
Other: Disable
The backup registers retain data through the Deep power-down mode when power is still applied to the VDD pin but
the chip has entered Deep power-down mode.
4.7.2 Power Control register (PMU_CTRL)
Address Offset:0x40
The power control register selects whether one of the ARM Cortex-M0 controlled power-down modes (Sleep mode or
Deep-sleep mode) or the Deep power-down mode is entered and provides the flags for Sleep or Deep-sleep modes
and Deep power-down modes respectively.
4.7.3 I/O Latch Control register 1 (PMU_LATCHCTRL1)
Address Offset:0x44
SONiX TECHNOLOGY CO., LTD Page 71 Version 2.0
Page 72
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:16
LATCHKEY
Latch register key.
Read as 0. When writing to the register you must write 0x5A5A to
LATCHKEY, otherwise behaviour of writing to the register is ignored.
W
0
15:1
Reserved
R
0
0
LATCHEN
Latch enable bit
0: No effect
1: Enable GPIO latch function
R/W
0
Bit
Name
Description
Attribute
Reset
31:16
LATCHKEY
Latch register key.
Read as 0. When writing to the register you must write 0x5A5A to
LATCHKEY, otherwise behaviour of writing to the register is ignored.
W
0
15:1
Reserved
R
0
0
LATCHDIS
Latch disable bit
0: No effect
1: Disable GPIO latch function
R/W
0
Bit
Name
Description
Attribute
Reset
31:1
Reserved
R
0
0
LATCH
Latch status bit
0: Not Latch yet
1: GPIO status is Latched.
R
0
32-Bit Cortex-M0 Micro-Controller
4.7.4 I/O Latch Control register 2 (PMU_LATCHCTRL2)
Address Offset:0x48
4.7.5 I/O Latch Status register (PMU_LATCHST)
Address Offset:0x4C
SONiX TECHNOLOGY CO., LTD Page 72 Version 2.0
Page 73
SN32F760 Series
5
5
5
32-Bit Cortex-M0 Micro-Controller
GENERAL PURPOSE I/O PORT (GPIO)
5.1 OVERVIEW
Digital ports can be configured input/output by SW
Each individual port pin can serve as external interrupt input pin.
Interrupts can be configured on single falling or rising edges and on both edges.
The I/O configuration registers control the electrical characteristics of the pads.
Internal pull-up/pull-down resistor.
Most of the I/O pins are mixed with analog pins and special function pins.
5.2 GPIO MODE
All GPIO pins are inputs and floating by default. The MODE bits in the GPIOn_CFG (n=0,1,2,3) register allow the
selection of on-chip pull-up or pull-down resistors for each pin or select the repeater mode.
The repeater mode enables the pull-up resistor if the pin is logic HIGH and enables the pull-down resistor if the pin is
logic LOW. This causes the pin to retain its last known state if it is configured as an input and is not driven externally.
The state retention is not applicable to the Deep power-down mode.
SONiX TECHNOLOGY CO., LTD Page 73 Version 2.0
Page 74
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
DATA[15:0]
Input data (read) or output data (write) for Pn.0 to Pn.15
R/W
0
Note: HW will switch I/O Mode directly when Specific function (Peripheral, ADC) is enabled, not through
GPIOn_MODE register.
Bit
Name
Description
Attribute
Reset
31:16
CURRENT[15:0]
Driving/Sinking current selection (x = 0 to 15)
0: Typical 10mA
1: Typical 20mA
R/W
0
15:0
MODE[15:0]
Selects pin x as input or output (x = 0 to 15)
0: Pn.x is configured as input
1: Pn.x is configured as output.
R/W
0
Note: HW will switch I/O Mode directly when Specific function (Peripheral, ADC) is enabled, not through
GPIOn_MODE register.
Bit
Name
Description
Attribute
Reset
31:30
CFG15[1:0]
Configuration of Pn.15
00: Pull-up resistor enabled.
01: Pull-down resistor enabled.
10: Inactive (no pull-down/pull-up resistor enabled).
11: Repeater mode.
R/W
10b
29:28
CFG14[1:0]
Configuration of Pn.14
00: Pull-up resistor enabled.
01: Pull-down resistor enabled.
10: Inactive (no pull-down/pull-up resistor enabled).
Selects interrupt on pin x as level or edge sensitive (x = 0 to 15).
0: Interrupt on Pn.x is configured as edge sensitive.
1: Interrupt on Pn.x is configured as event sensitive.
R/W
0
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
IBS[15:0]
Selects interrupt on Pn.x to be triggered on both edges (x = 0 to 15).
0: Interrupt on Pn.x is controlled through register GPIOn_IEV.
1: Both edges on Pn.x trigger an interrupt.
R/W
0
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
IEV[15:0]
Selects interrupt on pin x to be triggered rising or falling edges (x = 0 to 15).
0: Depending on setting in register GPIOn_IS, Rising edges or HIGH level
on Pn.x trigger an interrupt.
1: Depending on setting in register GPIOn_IS, Falling edges or LOW level
on Pn.x trigger an interrupt.
R/W
0
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
IE[15:0]
Selects interrupt on pin x to be enabled (x = 0 to 15).
0: Disable Interrupt on Pn.x
1: Enable Interrupt on Pn.x
R/W
0
32-Bit Cortex-M0 Micro-Controller
5.3.4 GPIO Port n Interrupt Sense register (GPIOn_IS) (n=0,1,2,3)
Address offset: 0x0C
5.3.5 GPIO Port n Interrupt Both-edge Sense register (GPIOn_IBS) (n=0,1,2,3)
Address offset: 0x10
5.3.6 GPIO Port n Interrupt Event register (GPIOn_IEV) (n=0,1,2,3)
Address offset: 0x14
5.3.7 GPIO Port n Interrupt Enable register (GPIOn_IE) (n=0,1,2,3)
Address offset: 0x18
Bits set to HIGH in the GPIOn_IE register allow the corresponding pins to trigger their individual interrupts. Clearing a
bit disables interrupt triggering on that pin.
SONiX TECHNOLOGY CO., LTD Page 76 Version 2.0
Page 77
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
IF[15:0]
GPIO raw interrupt flag (x = 0 to 15).
0: No interrupt on Pn.x
1: Interrupt requirements met on Pn.x.
R
0
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
IC[15:0]
Selects interrupt flag on pin x to be cleared (x = 0 to 15).
0: No effect
1: Clear interrupt flag on Pn.x
W
0
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
BSET[15:0]
Bit Set enable (x = 0 to 15)
0: No effect on Pn.x
1: Set Pn.x to “1”
W
0
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
BCLR[15:0]
Bit clear enable (x = 0 to 15)
0: No effect on Pn.x
1: Clear Pn.x.
W
0
32-Bit Cortex-M0 Micro-Controller
5.3.8 GPIO Port n Raw Interrupt Status register (GPIOn_RIS) (n=0,1,2,3)
Address offset: 0x1C
This register indicates the status for GPIO control raw interrupts. A GPIO interrupt is sent to the interrupt controller if
the corresponding bit in GPIOn_IE register is set.
5.3.9 GPIO Port n Interrupt Clear register (GPIOn_IC) (n=0,1,2,3)
Address offset: 0x20
5.3.10 GPIO Port n Bits Set Operation register (GPIOn_BSET) (n=0,1,2,3)
Address offset: 0x24
In order for SW to set GPIO bits without affecting any other pins in a single write operation, the GPIO bit is set if the
corresponding bit in the GPIOn_BSET register is set.
5.3.11 GPIO Port n Bits Clear Operation register (GPIOn_BCLR) (n=0,1,2,3)
Address offset:0x28
In order for SW to clear GPIO bits without affecting any other pins in a single write operation, the GPIO bit is cleared if
the corresponding bit in this register is set.
SONiX TECHNOLOGY CO., LTD Page 77 Version 2.0
Page 78
SN32F760 Series
U
MCU2
U
VCC
Open-drain pinOpen-drain pin
MCU1
Pull-up Resistor
Note:
1. VCC shall be less than or equal to VDD of MCU1 and MCU2.
2. Only P0, P1, and P3 support Open-drain.
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R 0
15:0
OC[15:0]
Open-drain control bit (x = 0 to 15)
0: Disable.
1: Enable open-drain function of Pn.x. HW also set Pn.x as output mode
automatically.
W/R
0
32-Bit Cortex-M0 Micro-Controller
5.3.12 GPIO Port n Open-Drain Control register (GPIOn_ODCTRL) (n=0,1,2,3)
Address offset: 0x2C
Several I/Os have built-in open-drain function and must be set as output mode when enable open-drain function.
Open-drain external circuit is as following.
The external pull-up resistor is necessary. The digital output function of I/O only supports sink current capability, so the
open-drain output high is driven by pull-up resistor, and output low is sunken by MCU’s pin.
SONiX TECHNOLOGY CO., LTD Page 78 Version 2.0
Page 79
SN32F760 Series
6
6
6
Peripheral
Pin Name
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
PA8
PA9
UART0
URXD0
P0.0
P0.4
P1.3
P3.0
P3.3
P3.5
P3.11
P3.14
UTXD0
P0.1
P0.5
P1.2
P3.1
P3.2
P3.4
P3.10
P3.15
UART1
URXD1
P1.0
P0.7
P0.12
P1.5
P1.13
P1.15
P3.6
P3.12
UTXD1
P1.1
P0.6
P0.13
P1.4
P1.14
P3.8
P3.10
P3.13
SSP0
SCK0
P0.4
P0.11
P0.13
P1.4
P1.12
P3.2
P3.6
P3.11
P2.3
P2.14
SEL0
P0.5
P0.10
P0.12
P1.5
P1.11
P3.1
P3.5
P3.10
P2.0
P2.15
MISO0
P0.2
P0.0
P0.6
P0.15
P1.0
P1.14
P3.3
P3.15
P2.1
P2.12
MOSI0
P0.3
P0.1
P0.7
P0.14
P1.1
P1.15
P3.4
P3.14
P2.2
P2.13
SSP1
SCK1
P3.7
P0.7
P0.14
P1.1
P1.11
P1.15
P3.3
P3.14
P2.2
P2.13
SEL1
P3.6
P0.2
P0.13
P1.0
P1.4
P1.7
P1.14
P3.11
P2.1
P2.14
MISO1
P3.9
P0.4
P0.10
P1.3
P1.10
P3.0
P3.4
P3.12
P2.1
P2.12
MOSI1
P3.8
P0.5
P0.12
P1.2
P1.6
P1.13
P3.2
P3.13
P2.0
P2.15
I2C0
SCL0
P1.5
P0.2
P0.15
P1.3
P1.14
P3.9
P3.11
P3.14
SDA0
P1.4
P0.3
P0.10
P1.2
P1.13
P3.7
P3.13
P3.15
I2C1
SCL1
P0.6
P0.0
P1.1
P1.9
P3.0
P3.3
P3.6
P3.13
SDA1
P0.7
P0.1
P1.0
P1.8
P3.2
P3.4
P3.5
P3.12
I2S
MCLK
P3.2
P0.12
P1.8
P3.7
P2.2
P2.6
BCLK
P3.3
P0.13
P1.9
P3.6
P2.10
P2.11
WS
P3.4
P0.14
P1.10
P2.1
P2.7
P2.9
DOUT
P3.1
P0.11
P1.7
P3.8
P2.8
P2.12
DIN
P3.0
P0.10
P1.6
P3.9
P2.0
P2.5
CT16B0
CAP0
P0.2
P0.8
P1.0
P3.0
P3.2
P3.10
P2.0
P2.13
32-Bit Cortex-M0 Micro-Controller
PERIPHERAL FUNCTION PIN
ASSIGNMENT (PFPA)
6.1 OVERVIEW
PFPA registers are used to provide flexible assignment of digital peripheral functions to desired external pins of
different packages.
6.2 FEATURES
Flexible assignment of digital peripheral functions to desired pins.
Supported functions are USART, I2C, SSP, I2S, Capture, and PWM.
6.3 PIN ASSIGNMENT LIST
SONiX TECHNOLOGY CO., LTD Page 79 Version 2.0
Page 80
SN32F760 Series
PWM0
P0.0
P1.1
P1.8
P1.12
P3.3
P3.11
P2.3
P2.15
PWM1
P0.1
P0.4
P0.10
P1.13
P3.4
P3.12
P2.2
P2.11
PWM2
P1.12
P0.9
P0.11
P1.6
P3.6
P3.15
P2.4
P2.10
CT16B1
CAP0
P0.12
P0.7
P1.7
P1.11
P3.5
P3.13
P2.1
P2.9
PWM0
P0.10
P0.5
P1.9
P1.15
P3.7
P3.14
P2.0
P2.12
PWM1
P0.11
P0.8
P0.12
P1.3
P1.10
P3.9
P2.4
P2.8
PWM2
P1.9
P0.6
P0.15
P1.2
P1.14
P3.8
P2.3
P2.7
CT16B2
CAP0
P1.8
P0.3
P0.13
P1.5
P3.6
P3.12
P2.2
P2.14
PWM0
P3.5
P0.2
P0.14
P1.4
P3.1
P3.10
P2.5
P2.9
PWM1
P1.4
P0.0
P0.9
P1.11
P3.5
P3.15
P2.1
P2.6
PWM2
P3.1
P0.1
P1.0
P1.12
P3.0
P3.11
P2.4
P2.10
CT32B0
CAP0
P3.9
P0.0
P0.9
P1.1
P3.1
P3.3
P2.3
P2.15
PWM0
P1.15
P0.4
P0.11
P1.8
P1.14
P3.9
P2.3
P2.14
PWM1
P3.8
P0.8
P0.14
P1.5
P1.11
P3.14
P2.4
P2.13
PWM2
P1.14
P0.5
P0.9
P1.9
P3.7
P3.13
P2.0
P2.11
PWM3
P1.2
P0.3
P0.7
P0.15
P1.12
P3.4
P2.2
P2.12
CT32B1
CAP0
P1.3
P0.2
P0.8
P0.15
P1.6
P3.8
P2.4
P2.10
PWM0
P1.13
P0.1
P0.9
P1.3
P3.2
P3.15
P2.6
P2.15
PWM1
P0.15
P0.4
P1.2
P1.10
P3.5
P3.10
P2.1
P2.8
PWM2
P1.6
P0.5
P0.8
P0.11
P3.12
P2.5
P2.12
P2.14
PWM3
P1.7
P0.6
P0.7
P1.2
P3.9
P3.11
P2.4
P2.13
CT32B2
CAP0
P3.7
P0.9
P0.10
P1.4
P1.13
P3.14
P2.5
P2.12
PWM0
P0.13
P0.3
P0.8
P1.1
P1.7
P1.15
P2.11
P2.15
PWM1
P0.14
P0.2
P0.15
P1.5
P3.0
P3.7
P2.7
P2.13
PWM2
P0.3
P0.0
P0.9
P1.6
P3.1
P3.13
P3.15
P2.14
PWM3
P0.6
P1.0
P1.7
P3.10
P2.3
P2.8
P2.9
P2.15
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R 0
15:12
URXD1[3:0]
Pin to be assigned as URXD1.
0000: P1.0
0001: P0.7
0010: P0.12
0011: P1.5
0100: P1.13
0101: P1.15
0110: P3.6
R/W
0000b
32-Bit Cortex-M0 Micro-Controller
6.4 PFPA REGISTERS
Base Address: 0x4004 2000
6.4.1 PFPA for UART register (PFPA_UART)
Address offset: 0x00
SONiX TECHNOLOGY CO., LTD Page 80 Version 2.0
Page 81
SN32F760 Series
0111: P3.12
Other: Reserved
11:8
UTXD1[3:0]
Pin to be assigned as UTXD1.
0000: P1.1
0001: P0.6
0010: P0.13
0011: P1.4
0100: P1.14
0101: P3.8
0110: P3.10
0111: P3.13
Other: Reserved
R/W
0000b
7:4
URXD0[3:0]
Pin to be assigned as URXD0.
0000: P0.0
0001: P0.4
0010: P1.3
0011: P3.0
0100: P3.3
0101: P3.5
0110: P3.11
0111: P3.14
Other: Reserved
R/W
0000b
3:0
UTXD0[3:0]
Pin to be assigned as UTXD0.
0000: P0.1
0001: P0.5
0010: P1.2
0011: P3.1
0100: P3.2
0101: P3.4
0110: P3.10
0111: P3.15
Other: Reserved
R/W
0000b
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R 0
15:12
SCL1[3:0]
Pin to be assigned as SCL1.
0000: P0.6
0001: P0.0
0010: P1.1
0011: P1.9
0100: P3.0
0101: P3.3
0110: P3.6
0111: P3.13
Other: Reserved
R/W
0000b
11:8
SDA1[3:0]
Pin to be assigned as SDA1.
0000: P0.7
0001: P0.1
0010: P1.0
0011: P1.8
0100: P3.2
0101: P3.4
0110: P3.5
0111: P3.12
Other: Reserved
R/W
0000b
7:4
SCL0[3:0]
Pin to be assigned as SCL0.
0000: P1.5
0001: P0.2
0010: P0.15
0011: P1.3
0100: P1.14
Pin to be assigned as CT16B0_CAP0.
0000: P0.2
0001: P0.8
0010: P1.0
0011: P3.0
0100: P3.2
0101: P3.10
0110: P2.0
0111: P2.13
Other: Reserved
R/W
0000b
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R 0
15:12
PWM2[3:0]
Pin to be assigned as CT16B1_PWM2.
0000: P1.9
0001: P0.6
0010: P0.15
0011: P1.2
0100: P1.14
0101: P3.8
0110: P2.3
0111: P2.7
Other: Reserved
R/W
0000b
11:8
PWM1[3:0]
Pin to be assigned as CT16B1_PWM1.
0000: P0.11
0001: P0.8
0010: P0.12
0011: P1.3
0100: P1.10
0101: P3.9
0110: P2.4
0111: P2.8
Other: Reserved
R/W
0000b
7:4
PWM0[3:0]
Pin to be assigned as CT16B1_PWM0.
0000: P0.10
0001: P0.5
0010: P1.9
0011: P1.15
0100: P3.7
0101: P3.14
0110: P2.0
0111: P2.12
Other: Reserved
R/W
0000b
3:0
CAP0[3:0]
Pin to be assigned as CT16B1_CAP0.
0000: P0.12
0001: P0.7
0010: P1.7
0011: P1.11
0100: P3.5
0101: P3.13
0110: P2.1
0111: P2.9
Other: Reserved
R/W
0000b
32-Bit Cortex-M0 Micro-Controller
6.4.6 PFPA for CT16B1 register (PFPA_CT16B1)
Address offset: 0x14
SONiX TECHNOLOGY CO., LTD Page 85 Version 2.0
Page 86
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R 0
15:12
PWM2[3:0]
Pin to be assigned as CT16B2_PWM2.
0000: P3.1
0001: P0.1
0010: P1.0
0011: P1.12
0100: P3.0
0101: P3.11
0110: P2.4
0111: P2.10
Other: Reserved
R/W
0000b
11:8
PWM1[3:0]
Pin to be assigned as CT16B2_PWM1.
0000: P1.4
0001: P0.0
0010: P0.9
0011: P1.11
0100: P3.5
0101: P3.15
0110: P2.1
0111: P2.6
Other: Reserved
R/W
0000b
7:4
PWM0[3:0]
Pin to be assigned as CT16B2_PWM0.
0000: P3.5
0001: P0.2
0010: P0.14
0011: P1.4
0100: P3.1
0101: P3.10
0110: P2.5
0111: P2.9
Other: Reserved
R/W
0000b
3:0
CAP0[3:0]
Pin to be assigned as CT16B2_CAP0.
0000: P1.8
0001: P0.3
0010: P0.13
0011: P1.5
0100: P3.6
0101: P3.12
0110: P2.2
0111: P2.14
Other: Reserved
R/W
0000b
Bit
Name
Description
Attribute
Reset
31:20
Reserved
R 0
19:16
PWM3[3:0]
Pin to be assigned as CT32B0_PWM3.
0000: P1.2
0001: P0.3
0010: P0.7
0011: P0.15
0100: P1.12
0101: P3.4
0110: P2.2
0111: P2.12
Other: Reserved
R/W
0000b
32-Bit Cortex-M0 Micro-Controller
6.4.7 PFPA for CT16B2 register (PFPA_CT16B2)
Address offset: 0x18
6.4.8 PFPA for CT32B0 register (PFPA_CT32B0)
Address offset: 0x20
SONiX TECHNOLOGY CO., LTD Page 86 Version 2.0
Page 87
SN32F760 Series
15:12
PWM2[3:0]
Pin to be assigned as CT32B0_PWM2.
0000: P1.14
0001: P0.5
0010: P0.9
0011: P1.9
0100: P3.7
0101: P3.13
0110: P2.0
0111: P2.11
Other: Reserved
R/W
0000b
11:8
PWM1[3:0]
Pin to be assigned as CT32B0_PWM1.
0000: P3.8
0001: P0.8
0010: P0.14
0011: P1.5
0100: P1.11
0101: P3.14
0110: P2.4
0111: P2.13
Other: Reserved
R/W
0000b
7:4
PWM0[3:0]
Pin to be assigned as CT32B0_PWM0.
0000: P1.15
0001: P0.4
0010: P0.11
0011: P1.8
0100: P1.14
0101: P3.9
0110: P2.3
0111: P2.14
Other: Reserved
R/W
0000b
3:0
CAP0[3:0]
Pin to be assigned as CT32B0_CAP0.
0000: P3.9
0001: P0.0
0010: P0.9
0011: P1.1
0100: P3.1
0101: P3.3
0110: P2.3
0111: P2.15
Other: Reserved
R/W
0000b
Bit
Name
Description
Attribute
Reset
31:20
Reserved
R 0
19:16
PWM3[3:0]
Pin to be assigned as CT32B1_PWM3.
0000: P1.7
0001: P0.6
0010: P0.7
0011: P1.2
0100: P3.9
0101: P3.11
0110: P2.4
0111: P2.13
Other: Reserved
R/W
0000b
15:12
PWM2[3:0]
Pin to be assigned as CT32B1_PWM2.
0000: P1.6
0001: P0.5
0010: P0.8
0011: P0.11
0100: P3.12
0101: P2.5
0110: P2.12
0111: P2.14
R/W
0000b
32-Bit Cortex-M0 Micro-Controller
6.4.9 PFPA for CT32B1 register (PFPA_CT32B1)
Address offset: 0x24
SONiX TECHNOLOGY CO., LTD Page 87 Version 2.0
Page 88
SN32F760 Series
Other: Reserved
11:8
PWM1[3:0]
Pin to be assigned as CT32B1_PWM1.
0000: P0.15
0001: P0.4
0010: P1.2
0011: P1.10
0100: P3.5
0101: P3.10
0110: P2.1
0111: P2.8
Other: Reserved
R/W
0000b
7:4
PWM0[3:0]
Pin to be assigned as CT32B1_PWM0.
0000: P1.13
0001: P0.1
0010: P0.9
0011: P1.3
0100: P3.2
0101: P3.15
0110: P2.6
0111: P2.15
Other: Reserved
R/W
0000b
3:0
CAP0[3:0]
Pin to be assigned as CT32B1_CAP0.
0000: P1.3
0001: P0.2
0010: P0.8
0011: P0.15
0100: P1.6
0101: P3.8
0110: P2.4
0111: P2.10
Other: Reserved
R/W
0000b
Bit
Name
Description
Attribute
Reset
31:20
Reserved
R 0
19:16
PWM3[3:0]
Pin to be assigned as CT32B2_PWM3.
0000: P0.6
0001: P1.0
0010: P1.7
0011: P3.10
0100: P2.3
0101: P2.8
0110: P2.9
0111: P2.15
Other: Reserved
R/W
0000b
15:12
PWM2[3:0]
Pin to be assigned as CT32B2_PWM2.
0000: P0.3
0001: P0.0
0010: P0.9
0011: P1.6
0100: P3.1
0101: P3.13
0110: P3.15
0111: P2.14
Other: Reserved
R/W
0000b
11:8
PWM1[3:0]
Pin to be assigned as CT32B2_PWM1.
0000: P0.14
0001: P0.2
0010: P0.15
0011: P1.5
0100: P3.0
0101: P3.7
R/W
0000b
32-Bit Cortex-M0 Micro-Controller
6.4.10 PFPA for CT32B2 register (PFPA_CT32B2)
Address offset: 0x28
SONiX TECHNOLOGY CO., LTD Page 88 Version 2.0
Page 89
SN32F760 Series
0110: P2.7
0111: P2.13
Other: Reserved
7:4
PWM0[3:0]
Pin to be assigned as CT32B2_PWM0.
0000: P0.13
0001: P0.3
0010: P0.8
0011: P1.1
0100: P1.7
0101: P1.15
0110: P2.11
0111: P2.15
Other: Reserved
R/W
0000b
3:0
CAP0[3:0]
Pin to be assigned as CT32B2_CAP0.
0000: P3.7
0001: P0.9
0010: P0.10
0011: P1.4
0100: P1.13
0101: P3.14
0110: P2.5
0111: P2.12
Other: Reserved
R/W
0000b
32-Bit Cortex-M0 Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 89 Version 2.0
Page 90
SN32F760 Series
7
7
7
SAR ADC
ENGINE
CHS[3:0]
GCHS
ADC High
Reference Voltage
Analog
Input
ADENBADS
ADC Clock
Counter
ADCKS[1:0]
ADLEN
ADB[11:0]
EOC
ADCIRQ
8/12
ADTS[1:0]
Vss
Vdd
ADT[4:0]
ADC Offset
Calibration
P2CON
AIN2
AIN3
AIN4
AIN5
AIN6
AIN7
AIN8
AIN9
AIN10
AIN11
AIN12
AIN13
AIN0/AVREFH
AIN1
Internal Vdd
AVREFHSEL
AIN14 (Internal to TS)
Note:
1. For 8-bit resolution the conversion time is 12 steps. For 12-bit resolution the conversion time is 16
steps
32-Bit Cortex-M0 Micro-Controller
14+1 CHANNEL ANALOG TO DIGITAL
CONVERTOR (ADC)
7.1 OVERVIEW
This analog to digital converter has 14 external channels and 1 internal channel to Temperature sensor, with up to
4096-step resolution to transfer analog signal into 12-bits digital data. The sequence of ADC operation is to select input
source (AIN0 ~ AIN13) at first, then set GCHS and ADS bit to “1” to start conversion. When the conversion is complete,
the ADC circuit will set EOC bit to “1” and final value output in ADB register.
Use CHS[3:0] to select AIN pin and GCHS enables global ADC channel, the analog signal inputs to ADC engine.
The ADC reference high voltage includes two source, one is internal Vdd (AVREFHSEL=0), and the other one is
external reference voltage input pin from P2.0 pin (AVREFHSEL=1).
The ADC resolution can be selected 8-bit or 12-bit through ADLEN bit in ADR register. The ADC converting rate can be
selected by ADCKS[1:0] bits. The two parameters decide ADC converting time.
SONiX TECHNOLOGY CO., LTD Page 90 Version 2.0
Page 91
SN32F760 Series
2. ADC_PCLK shall be less than 16MHz.
3. The analog input level must be between the AVREFH and AVREFL.
4. The AVREFH level must be between the AVDD and AVREFL + 2.0V.
5. ADC programming notice
Disable ADC (set ADENB = “0”) before enter low-power (Sleep/Deep-sleep/Deep power-
power-down) mode to save power consumption.
Delay 100us after enable ADC (set ADENB = “1”) to wait ADC circuit ready for conversion.
ADLEN
ADCKS
[2:0]
ADC Clock
ADC_PCLK = 4 MHz
ADC_PCLK = 16 MHz
ADC
Conversion
Time (us)
ADC
Conversion
Rate (KHz)
ADC
Conversion
Time (us)
ADC
Conversion
Rate (KHz)
1
000
ADC_PCLK
16
62.5
4
250
001
ADC_PCLK/2
32
31.25
8
125
010
ADC_PCLK/4
64
15.625
16
62.5
011
ADC_PCLK/8
128
7.813
32
31.25
100
ADC_PCLK/16
256
3.906
64
15.625
101
ADC_PCLK/32
512
1.953
128
7.813
ADLEN
ADCKS
[2:0]
ADC Clock
ADC_PCLK = 4 MHz
ADC_PCLK = 16 MHz
ADC
Conversion
Time (us)
ADC
Conversion
Rate (KHz)
ADC
Conversion
Time (us)
ADC
Conversion
Rate (KHz)
0
000
ADC_PCLK
12
83.333
3
333.333
001
ADC_PCLK/2
24
41.667
6
166.667
010
ADC_PCLK/4
48
20.83
12
83.333
011
ADC_PCLK/8
96
10.416
24
41.667
100
ADC_PCLK/16
192
5.208
48
20.83
101
ADC_PCLK/32
384
2.604
96
10.416
32-Bit Cortex-M0 Micro-Controller
7.2 ADC CONVERTING TIME
The ADC converting time is from ADS=1 (Start to ADC convert) to EOC=1 (End of ADC convert). The converting time
duration is depend on ADC resolution and ADC clock rate.
ADC clock source is controlled by ADCKS[2:0] bits. The ADC converting time affects ADC performance. If input high
rate analog signal, it is necessary to select a high ADC converting rate. If the ADC converting time is slower than
analog signal variation rate, the ADC result would be error. So to select a correct ADC clock rate and ADC resolution to
decide a right ADC converting rate is very important.
12-bit ADC conversion time = 1/(ADC clock /4)*16 sec
8-bit ADC conversion time = 1/(ADC clock /4)*12 sec
SONiX TECHNOLOGY CO., LTD Page 91 Version 2.0
Page 92
SN32F760 Series
VCC
GND
0.1uF
Analog Signal Input
47uF
0.1uF
External High
Reference Voltage
Main Power Trunk
AINn/P2.n
VSS
AVREFH
MCU
A
BC
32-Bit Cortex-M0 Micro-Controller
7.3 ADC CONTROL NOTICE
7.3.1 ADC SIGNAL
The ADC high reference voltage is internal Vdd or external voltage source. The ADC low reference voltage is ground.
The ADC input signal voltage range must be from high reference voltage to low reference voltage.
The external high reference voltage from P2.0 must be higher than “Low reference voltage + 2V”. The low
reference voltage is ground. So the external reference voltage range must be under 2V~Vdd.
7.3.2 ADC PROGRAM
The first step of ADC execution is to setup ADC configuration. The ADC program setup sequence and notices are as
following.
Step 1: Enable ADC. ADENB is ADC control bit to control. ADENB = 1 is to enable ADC. ADENB = 0 is to disable
ADC. When ADENB is enabled, the system must be delay 100us to be the ADC warm-up time by program,
and then set ADS to do ADC converting. The 100us delay time is necessary after ADENB setting (not ADS
setting), or the ADC converting result would be error. Normally, the ADENB is set one time when the system
under normal run condition, and do the delay time only one time.
Step 2: If the ADC high reference voltage is from external voltage source, set the AVREFHSEL = 1. The ADC
external high reference voltage inputs from P2.0 pin. It is necessary to set P2.0 as input mode without pull-up
resistor.
Step 3: Select the ADC input pin by CHS[3:0], and enable ADC global input. When one AIN pin is selected to
be analog signal input pin, it is necessary to setup the pin as input mode and disable the pull-up resistor
by program. Step 4: Start to execute ADC conversion by setting ADS = 1.
Step 5: Wait the end of ADC converting through checking EOC = 1 or ADCIF = 1. If ADC interrupt function is
enabled, the program executes ADC interrupt service when ADC interrupt occurrence. ADS is cleared when the
end of ADC converting automatically. EOC bit indicates ADC processing status immediately and is
cleared when ADS = 1. Users needn’t to clear it by program.
7.4 ADC CIRCUIT
The analog signal is inputted to ADC input pin “AINn/P2.n”. The ADC input signal must be through a 0.1uF capacitor
“A”. The 0.1uF capacitor is set between ADC input pin and VSS pin, and must be on the side of the ADC input pin as
possible. Don’t connect the capacitor’s ground pin to ground plain directly, and must be through VSS pin. The capacitor
can reduce the power noise effective coupled with the analog signal.
If the ADC high reference voltage is from external voltage source, the external high reference is connected to AVREFH
pin (P2.0). The external high reference source must be through a 47uF ”C” capacitor first, and then 0.1uF capacitor “B”.
SONiX TECHNOLOGY CO., LTD Page 92 Version 2.0
Page 93
SN32F760 Series
Note: The Temperature Sensor was just a reference data not real air temperature. For precision
application, please use external thermistor sensor.
Temperature
V(TS)
AVrefH
ADC output (12-Bit)
15℃
0.965
3.0V
1250
25℃
1.000V
3.0V
1306
35℃
1.035V
3.0V
1352
Note:
1. The V(TS) voltage and temperature curve of each chip might different. Calibration in room
temperature is necessary when temperature sensor is used.
2. 3.53mV/℃ is only the typical temperature parameter, every single chip is different to each other.
32-Bit Cortex-M0 Micro-Controller
These capacitors are set between AVREFH pin and VSS pin, and must be on the side of the AVREFH pin as possible.
Don’t connect the capacitor’s ground pin to ground plain directly, and must be through VSS pin.
7.5 TEMPERATURE SENSOR (TS)
In applications, sensor characteristic might change in different temperature also. To get the temperature information, a
temperature senor (TS) is built-in for temperature measurement, and is internally connected to the AIN14 input channel
which is used to convert the sensor output voltage into a digital value.
If TSENB = 1, the temperature sensor is enabled. When not in use, this sensor can be put in power down mode if
TSENB = 0.
In 25C, V(TS) will be about 1V typically, and if the temperature rises 10℃, V(TS) will increase about 35mV (VTS
=1.035V); if the temperature drops 10℃ , V(TS) will decrease about 35mV (VTS =0.965V).
Example:
By ADC output of V(TS), can get temperature information and compensation the system.
SONiX TECHNOLOGY CO., LTD Page 93 Version 2.0
Page 94
SN32F760 Series
Note:
1. When ADC is enabled (ADENB=1) and global channel is enabled (GCHS=1), the ADC shared pins
transfers to ADC purpose and disable GPIO function and disable pull-up/pull-down resistor by HW
automatically, the P2.n/AINn’s digital I/O function including pull-up is isolated.
2. When ADC is disabled (ADENB=0) or global channel is disabled (GCHS=0) , the ADC pins returns to
last GPIO status.
3. If P2.0 is used as external reference voltage input pin, users should set P2.0 as input mode without
pull-up.
Bit
Name
Description
Attribute
Reset
31:18
Reserved
R
0
17
TSENB
Temperature sensor enable bit
0: Disable
1: Enable
R/W
0
16:13
Reserved
R
0
12
AVREFHSEL
ADC high reference voltage source select bit
0: Internal VDD. (P2.0 is GPIO or AIN0 pin)
1: Enable external reference voltage from P2.0
Note: The initial value of ADC buffer (ADB) after reset is unknown.
Bit
Name
Description
Attribute
Reset
31:12
Reserved
R
0
11:0
ADB[11:0]
ADB11~ADB4 bits for 8-bit ADC
ADB11~ADB0 bits for 12-bit ADC
R
0
AIN n
ADB11
ADB10
ADB9
ADB8
ADB7
ADB6
ADB5
ADB4
ADB3
ADB2
ADB1
ADB0
0/4096*VREFH
0 0 0 0 0 0 0 0 0 0 0 0 1/4096*VREFH
0 0 0 0 0 0 0 0 0 0 0 1 .
. . . . . . . . . . .
. . . . . . . . . . . . .
.
.
. . . . . . . . . . .
.
4094/4096*VREFH
1 1 1 1 1 1 1 1 1 1 1 0 4095/4096*VREFH
1 1 1 1 1 1 1 1 1 1 1
1
ADB11
ADB10
ADB9
ADB8
ADB7
ADB6
ADB5
ADB4
ADB3
ADB2
ADB1
ADB0
8-bit
O O O O O O O O X X X X 9-bit
O O O O O O O O O X X X 10-bit
O O O O O O O O O O X X 11-bit
O O O O O O O O O O O
X
12-bit.
O O O O O O O O O O O
O
O = Selected, X = Delete
Bit
Name
Description
Attribute
Reset
31:16
Reserved
R
0
15:0
P2CON[15:0]
P2.x configuration control bits. (x=0 to 15)
0: P2.x can be an analog input (ADC input) or digital I/O pins.
1: P2.x is pure analog input, can’t be a digital I/O pin.
R
0
32-Bit Cortex-M0 Micro-Controller
7.6.2 ADC Data register (ADC_ADB)
Address Offset: 0x04
ADB is ADC data buffer to store AD converter result.
The AIN’s input voltage vs. ADB’s output data
For different applications, users maybe need more than 8-bit resolution but less than 12-bit ADC converter. First, the
AD resolution must be set 12-bit mode and then to execute ADC converter routine. Then delete the LSB of ADC data
and get the new resolution result. The table is as following.
7.6.3 Port 2 Control register (ADC_P2CON)
Address Offset: 0x08
The Port 2 is shared with ADC input function. Only one pin of port 2 can be configured as ADC input in the same time
by ADM register. The other pins of port 2 are digital I/O pins.
Connect an analog signal to COMS digital input pin, especially, the analog signal level is about 1/2 VDD will cause
extra current leakage. In the power down mode, the above leakage current will be a big problem. Unfortunately, if users
connect more than one analog input signal to port 2 will encounter above current leakage situation.
P2CON is Port2 Configuration status register. When ADC is enabled, HW will configure P2CON [15:0] to make related
port 2 pin as pure analog input pin to avoid current leakage.
SONiX TECHNOLOGY CO., LTD Page 95 Version 2.0
Page 96
SN32F760 Series
Bit
Name
Description
Attribute
Reset
31:15
Reserved
R
0
14:0
IE[14:0]
These bits allow control over which A/D channels generate interrupts for
conversion completion. When bit x is one, completion of a conversion on
AIN x will generate an interrupt.
R/W
0
Bit
Name
Description
Attribute
Reset
31:15
Reserved
R
0
14:0
IF[14:0]
ADC raw interrupt flag. (x = 0 to 14).
0: ReadNo interrupt on AINx
WriteWrite “0” to the corresponding bit will clear the bit and reset the
Interrupt if the corresponding IE bit is set.
1: Interrupt requirements met on AINx ADC conversion.
R/W
0
32-Bit Cortex-M0 Micro-Controller
7.6.4 ADC Interrupt Enable register (ADC_IE)
Address offset: 0x0C
This register allows control over which A/D channels generate an interrupt when a conversion is complete. For example,
it may be desirable to use some A/D channels to monitor sensors by continuously performing conversions on them.
The most recent results are read by the application program whenever they are needed. In this case, an interrupt is not
desirable at the end of each conversion for some A/D channels.
7.6.5 ADC Raw Interrupt Status register (ADC_RIS)
Address offset: 0x10
SONiX TECHNOLOGY CO., LTD Page 96 Version 2.0
Page 97
SN32F760 Series
8
8
8
Pin Name
Type
Description
GPIO Configuration
CT16Bn_CAP0
I
Capture channel input 0
Depends on GPIOn_CFG
CT16Bn_PWMx
O
Output channel x of Match/PWM output.
32-Bit Cortex-M0 Micro-Controller
16-BIT TIMER WITH CAPTURE
FUNCTION
8.1 OVERVIEW
Each Counter/timer is designed to count cycles of the peripheral clock (PCLK) or an externally supplied clock and can
optionally generate interrupts or perform other actions at specified timer values based on four match registers. Each
counter/timer also includes one capture input to trap the timer value when an input signal transitions, optionally
generating an interrupt.
In PWM mode, up to three match registers can be used to provide a single-edge controlled PWM output on the match
output pins.
8.2 FEATURES
Three 16-bit counter/timers with a programmable 16-bit prescaler.
Counter or timer operation
Three 16-bit capture channels that can take a snapshot of the timer value when an input signal transitions. A
capture event may also optionally generate an interrupt.
The timer and prescaler may be configured to be cleared on a designated capture event. This feature permits
easy pulse-width measurement by clearing the timer on the leading edge of an input pulse and capturing the
timer value on the trailing edge.
For each timer, four 16-bit match registers that allow:
– Continuous operation with optional interrupt generation on match.
– Stop timer on match with optional interrupt generation.
– Reset timer on match with optional interrupt generation.
– Configured as PWM allowing using up to three match outputs as single edge controlled PWM outputs.
For each timer, up to three PWM outputs corresponding to match registers with the following capabilities:
– Set LOW on match.
– Set HIGH on match.
– Toggle on match.
– Do nothing on match.
8.3 PIN DESCRIPTION
SONiX TECHNOLOGY CO., LTD Page 97 Version 2.0
Page 98
SN32F760 Series
CT16Bn_PWMx
STOP
MRx
MRxIF
MRxIE
PCLK
CEN
PC
PRE
TC
CEN
MRx Interrupt
MRxSTOP
STOP
CRSTCRST
RESETRESET
MRxRST
CAP0
CAP0EN
CAP0FE
CAP0RE
CAP0IE
CAP0 Interrupt
CT16Bn_CAP0
PWMxEN
PWMxIOEN
EMCx
32-Bit Cortex-M0 Micro-Controller
8.4 BLOCK DIAGRAM
SONiX TECHNOLOGY CO., LTD Page 98 Version 2.0
Page 99
SN32F760 Series
PCLK
CT16Bn_PC
CT16Bn_TC
TC Reset
Interrupt
2
01
2
012
0
4
5
60
PCLK
CT16Bn_PC
CT16Bn_TC
CEN bit
Interrupt
2
01
2
0
4
5
6
1
0
32-Bit Cortex-M0 Micro-Controller
8.5 TIMER OPERATION
8.5.1 Edge-aligned Up-counting Mode
The following figure shows a timer configured to reset the count (TC) and generate an interrupt on match in
Edge-aligned up-counting mode. The CT16Bn_PRE register is set to 2, and the CT16Bn_MRx register is set to 6. At
the end of the timer cycle where the match occurs, the timer count is reset. This gives a full length cycle to the match
value. The interrupt indicating that a match occurred is generated in the next clock after the timer reached the match
value.
The following figure shows a timer configured to stop and generate an interrupt on match in Edge-aligned up-counting
mode. The CT16Bn_PRE register is set to 2, and the CT16Bn_MRx register is set to 6. In the next clock after the timer
reaches the match value, the CEN bit in CT16Bn_TMRCTRL register is cleared, and the interrupt indicating that a
match occurred is generated.
SONiX TECHNOLOGY CO., LTD Page 99 Version 2.0
Page 100
SN32F760 Series
PCLK
CT16Bn_TC
4
32
1
05453
52
PCLK
CT16Bn_TC
1
23
4
543
2
0
32-Bit Cortex-M0 Micro-Controller
8.5.2 Edge-aligned Down-counting Mode
The timer count TC[15:0] will be reset to the value of CT16Bn_MR3 after resetting counter or TC reaches 0. Besides,
TC is blocked while the value of CT16Bn_MR3 is zero.
The following figure shows a timer configured to reset the count in Edge-aligned down-counting mode. The
CT16Bn_PRE register is set to 0, and the CT16Bn_MR3 register is set to 54. After TC reaches 0, the timer count is
reset and loaded from the value of CT16Bn_MR3.
8.5.3 Center-aligned Counting Mode
In Center-aligned counting mode, TC counts up from 0 to the value of CT16Bn_MR3, and then counts down to 0
alternatively. Besides, TC is blocked while the value of CT16Bn_MR3 is zero.
The following figure shows a timer in Center-aligned counting mode. The CT16Bn_PRE register is set to 0, and the
CT16Bn_MR3 register is set to 5.
SONiX TECHNOLOGY CO., LTD Page 100 Version 2.0
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.