MSP430FR2XX Family User Guide PDF
MSP430FR2XX Family User Guide PDF
MSP430FR2XX Family User Guide PDF
User's Guide
Preface....................................................................................................................................... 26
1 System Resets, Interrupts, and Operating Modes, System Control Module (SYS)....................... 28
1.1 System Control Module (SYS) Introduction ............................................................................ 29
1.2 System Reset and Initialization ........................................................................................... 29
1.2.1 Device Initial Conditions After System Reset .................................................................. 31
1.3 Interrupts .................................................................................................................... 31
1.3.1 (Non)Maskable Interrupts (NMIs) ............................................................................... 32
1.3.2 SNMI Timing ....................................................................................................... 32
1.3.3 Maskable Interrupts ............................................................................................... 32
1.3.4 Interrupt Processing............................................................................................... 33
1.3.5 Interrupt Nesting ................................................................................................... 34
1.3.6 Interrupt Vectors ................................................................................................... 34
1.3.7 SYS Interrupt Vector Generators ................................................................................ 35
1.4 Operating Modes ........................................................................................................... 35
1.4.1 Low-Power Modes and Clock Requests ....................................................................... 38
1.4.2 Entering and Exiting Low-Power Modes LPM0 Through LPM4 ............................................. 39
1.4.3 Low-Power Modes LPM3.5 and LPM4.5 (LPMx.5) ........................................................... 39
1.4.4 Extended Time in Low-Power Modes .......................................................................... 41
1.5 Principles for Low-Power Applications .................................................................................. 42
1.6 Connection of Unused Pins ............................................................................................... 42
1.7 Reset Pin (RST/NMI) Configuration ..................................................................................... 42
1.8 Configuring JTAG Pins .................................................................................................... 43
1.9 Memory Map – Uses and Abilities ....................................................................................... 43
1.9.1 Memory Map ....................................................................................................... 43
1.9.2 Vacant Memory Space ........................................................................................... 48
1.9.3 FRAM Write Protection ........................................................................................... 48
1.9.4 Bootloader (BSL) .................................................................................................. 48
1.10 JTAG Mailbox (JMB) System ............................................................................................ 49
1.10.1 JMB Configuration ............................................................................................... 49
1.10.2 SYSJMBO0 and SYSJMBO1 Outgoing Mailbox ............................................................. 49
1.10.3 SYSJMBI0 and SYSJMBI1 Incoming Mailbox ................................................................ 49
1.10.4 JMB NMI Usage .................................................................................................. 49
1.11 Device Security ............................................................................................................. 50
1.11.1 JTAG and SBW Lock Mechanism (Electronic Fuse) ........................................................ 50
1.11.2 BSL Security Mechanism ....................................................................................... 50
1.12 Device-Specific Configurations ........................................................................................... 51
1.12.1 MSP430FR413x and MSP430FR203x Configurations ...................................................... 51
1.12.2 MSP430FR2433 Configurations................................................................................ 53
1.12.3 MSP430FR263x and MSP430FR253x Configurations ...................................................... 54
1.12.4 MSP430FR231x Configurations ................................................................................ 55
1.12.5 MSP430FR211x Configurations ................................................................................ 57
1.13 Device Descriptor Table ................................................................................................... 59
1.13.1 Identifying Device Type.......................................................................................... 60
1.13.2 TLV Descriptors .................................................................................................. 61
1.13.3 Calibration Values ................................................................................................ 61
List of Figures
1-1. BOR, POR, and PUC Reset Circuit ...................................................................................... 30
1-2. Interrupt Priority............................................................................................................. 32
1-3. Interrupt Processing........................................................................................................ 33
1-4. Return From Interrupt ...................................................................................................... 34
1-5. Operation Modes ........................................................................................................... 37
1-6. IR Modulation Combinatory Logics ...................................................................................... 52
1-7. 1.2-V Reference Output on A4 ........................................................................................... 52
1-8. IR Modulation Combinatory Logics ...................................................................................... 53
1-9. 1.2-V Reference Output on A4 ........................................................................................... 54
1-10. IR Modulation Combinatory Logics ...................................................................................... 55
1-11. 1.2-V Reference Output on A4 ........................................................................................... 55
1-12. IR Modulation Combinatory Logics ...................................................................................... 56
1-13. 1.2-V Reference Output on A7 ........................................................................................... 57
1-14. IR Modulation Combinatory Logics ...................................................................................... 58
1-15. 1.2-V Reference Output on A7 ........................................................................................... 59
1-16. Devices Descriptor Table.................................................................................................. 60
1-17. SFRIE1 Register ........................................................................................................... 65
1-18. SFRIFG1 Register.......................................................................................................... 66
1-19. SFRRPCR Register ........................................................................................................ 67
1-20. SYSCTL Register .......................................................................................................... 69
1-21. SYSBSLC Register ........................................................................................................ 70
1-22. SYSJMBC Register ........................................................................................................ 71
1-23. SYSJMBI0 Register ........................................................................................................ 72
1-24. SYSJMBI1 Register ........................................................................................................ 72
1-25. SYSJMBO0 Register....................................................................................................... 73
1-26. SYSJMBO1 Register....................................................................................................... 73
1-27. SYSUNIV Register ......................................................................................................... 74
1-28. SYSSNIV Register ......................................................................................................... 74
1-29. SYSRSTIV Register........................................................................................................ 75
1-30. SYSCFG0 Register ........................................................................................................ 77
1-31. SYSCFG1 Register ........................................................................................................ 78
1-32. SYSCFG2 Register ........................................................................................................ 79
1-33. SYSCFG0 Register ........................................................................................................ 81
1-34. SYSCFG1 Register ........................................................................................................ 82
1-35. SYSCFG2 Register ........................................................................................................ 83
1-36. SYSCFG0 Register ........................................................................................................ 85
1-37. SYSCFG1 Register ........................................................................................................ 86
1-38. SYSCFG2 Register ........................................................................................................ 87
1-39. SYSCFG0 Register ........................................................................................................ 89
1-40. SYSCFG1 Register ........................................................................................................ 90
1-41. SYSCFG2 Register ........................................................................................................ 91
1-42. SYSCFG0 Register ........................................................................................................ 93
1-43. SYSCFG1 Register ........................................................................................................ 94
1-44. SYSCFG2 Register ........................................................................................................ 95
1-45. SYSCFG0 Register ........................................................................................................ 97
1-46. SYSCFG1 Register ........................................................................................................ 98
1-47. SYSCFG2 Register ........................................................................................................ 99
List of Tables
0-1. Register Bit Accessibility and Initial Condition .......................................................................... 27
1-1. Interrupt Sources, Flags, and Vectors ................................................................................... 34
1-2. Operation Modes ........................................................................................................... 38
1-3. Requested vs Actual LPM................................................................................................. 38
1-4. Connection of Unused Pins ............................................................................................... 42
1-5. BSL and JTAG/SBW Signatures ......................................................................................... 50
1-6. Tag Values .................................................................................................................. 61
1-7. SFR Base Address ......................................................................................................... 64
1-8. SFR Registers .............................................................................................................. 64
1-9. SFRIE1 Register Description ............................................................................................. 65
1-10. SFRIFG1 Register Description ........................................................................................... 66
1-11. SFRRPCR Register Description.......................................................................................... 67
1-12. SYS Registers .............................................................................................................. 68
1-13. SYSCTL Register Description ............................................................................................ 69
1-14. SYSBSLC Register Description .......................................................................................... 70
1-15. SYSJMBC Register Description .......................................................................................... 71
1-16. SYSJMBI0 Register Description.......................................................................................... 72
1-17. SYSJMBI1 Register Description.......................................................................................... 72
1-18. SYSJMBO0 Register Description ........................................................................................ 73
1-19. SYSJMBO1 Register Description ........................................................................................ 73
1-20. SYSUNIV Register Description ........................................................................................... 74
1-21. SYSSNIV Register Description ........................................................................................... 74
1-22. SYSRSTIV Register Description ......................................................................................... 75
1-23. MSP430FR203x SYS Configuration Registers ......................................................................... 76
1-24. SYSCFG0 Register Description .......................................................................................... 77
1-25. SYSCFG1 Register Description .......................................................................................... 78
1-26. SYSCFG2 Register Description .......................................................................................... 79
1-27. FR413x SYS Configuration Registers ................................................................................... 80
1-28. SYSCFG0 Register Description .......................................................................................... 81
1-29. SYSCFG1 Register Description .......................................................................................... 82
1-30. SYSCFG2 Register Description .......................................................................................... 83
1-31. FR2433 SYS Configuration Registers ................................................................................... 84
1-32. SYSCFG0 Register Description .......................................................................................... 85
1-33. SYSCFG1 Register Description .......................................................................................... 86
1-34. SYSCFG2 Register Description .......................................................................................... 87
1-35. FR263x and FR253x SYS Configuration Registers ................................................................... 88
1-36. SYSCFG0 Register Description .......................................................................................... 89
1-37. SYSCFG1 Register Description .......................................................................................... 90
1-38. SYSCFG2 Register Description .......................................................................................... 91
1-39. FR231x SYS Configuration Registers ................................................................................... 92
1-40. SYSCFG0 Register Description .......................................................................................... 93
1-41. SYSCFG1 Register Description .......................................................................................... 94
1-42. SYSCFG2 Register Description .......................................................................................... 95
1-43. FR211x SYS Configuration Registers ................................................................................... 96
1-44. SYSCFG0 Register Description .......................................................................................... 97
1-45. SYSCFG1 Register Description .......................................................................................... 98
1-46. SYSCFG2 Register Description .......................................................................................... 99
FCC Warning
This equipment is intended for use in a laboratory test environment only. It generates, uses, and can
radiate radio frequency energy and has not been tested for compliance with the limits of computing
devices pursuant to subpart J of part 15 of FCC rules, which are designed to provide reasonable
protection against radio frequency interference. Operation of this equipment in other environments may
cause interference with radio communications, in which case the user at his own expense will be required
to take whatever measures may be required to correct this interference.
Notational Conventions
Program examples are shown in a special typeface; for example:
MOV #255,R10
XOR @R5,R6
Glossary
The system control module (SYS) is available on all devices. The basic features of SYS are:
• Brownout reset (BOR) and power on reset (POR) handling
• Power up clear (PUC) handling
• (Non)maskable interrupt (SNMI and UNMI) event source selection and management
• User data-exchange mechanism through the JTAG mailbox (JMB)
• Bootloader (BSL) entry mechanism
• Configuration management (device descriptors)
• Providing interrupt vector generators for reset and NMIs
• FRAM write protection
• On-chip module-to-module signaling control
28 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Control Module (SYS) Introduction
NOTE: The number and type of resets available may vary from device to device. See the device-
specific data sheet for all reset sources that are available.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 29
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Reset and Initialization www.ti.com
BOR shadow
s
Delay
brownout circuit
PMMRSTIFG
RST/NMI s clr
SYSNMI Delay BOR
notRST PMMBORIFG
s clr
PMMSWBOR event
SVSHIFG
s
from SVSH Delay POR
SVSHE
PMMPORIFG
s
PMMSWPOR event
WDTIFG
s
Watchdog Timer MCLK Module
PUCs
… .
PUC Logic
30 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Reset and Initialization
NOTE: A device that is unprogrammed or blank is defined as having its reset vector value, at
memory address FFFEh, equal to FFFFh. Upon system reset of a blank device, the device
automatically enters operating mode LPM4. See Section 1.4 for information on operating
modes and Section 1.3.6 for details on interrupt vectors.
1.3 Interrupts
The interrupt priorities are fixed and defined by the arrangement of the modules in the connection chain as
shown in Figure 1-2. Interrupt priorities determine which interrupt is acted on when more than one
interrupt is pending simultaneously.
There are three types of interrupts:
• System reset
• (Non)maskable
• Maskable
NOTE: The types of interrupt sources available and their respective priorities can change from
device to device. See the device-specific data sheet for all interrupt sources and their
priorities.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 31
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Interrupts www.ti.com
BOR
RST/NMI CPU
BOR, POR, PUC POR
...
circuit PUC
Password violations
.. . ..
daisy chain
and vectors
NOTE: The number and types of NMI sources may vary from device to device. See the device-
specific data sheet for all NMI sources available.
32 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Interrupts
Item1 Item1
SP Item2 TOS Item2
PC
SP SR TOS
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 33
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Interrupts www.ti.com
The return from the interrupt takes five cycles to execute the following actions and is shown in Figure 1-4.
1. The SR with all previous settings pops from the stack. All previous settings of GIE, CPUOFF, and the
other bits are now in effect, regardless of the settings used during the interrupt service routine.
2. The PC pops from the stack and begins execution where it was interrupted.
Before After
Return From Interrupt
Item1 Item1
Item2 SP Item2 TOS
PC PC
SP SR TOS SR
34 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Interrupts
Some interrupt enable bits, interrupt flags, and the control bits for the RST/NMI pin are located in the
special function registers (SFRs). The SFRs are located in the peripheral address range and are byte and
word accessible. See the device-specific data sheet for the SFR configuration.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 35
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Operating Modes www.ti.com
saved SR value on the stack inside of the interrupt service routine. When setting any of the mode-control
bits, the selected operating mode takes effect immediately. Peripherals operating with any disabled clock
are disabled until the clock becomes active. Peripherals may also be disabled with their individual control
register settings. All I/O port pins, RAM, and registers are unchanged. Wake-up from LPM0 through LPM4
is possible through all enabled interrupts.
When LPMx.5 (LPM3.5 or LPM4.5) is entered, the voltage regulator of the Power Management Module
(PMM) is disabled. All RAM and register contents are lost. Although the I/O register contents are lost, the
I/O pin states are locked upon LPMx.5 entry. See the Digital I/O chapter for further details. Wake-up from
LPM4.5 is possible from a power sequence, a RST event, or from specific I/O. Wake-up from LPM3.5 is
possible from a power sequence, a RST event, an RTC event, an LF crystal fault, or from specific I/O.
NOTE: The TEST/SBWTCK pin is used for interfacing to the development tools through Spy-Bi-
Wire. When the TEST/SBWTCK pin is high, wake-up times from LPM2 (device specific) ,
LPM3, and LPM4 may be different compared to when TEST/SBWTCK is low. Pay careful
attention to the real-time behavior when exiting from LPM2 (device specific), LPM3, and
LPM4 with the device connected to a development tool (for example, MSP-FET430UIF). See
the PMM chapter for details.
36 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Operating Modes
RST/NMI
‡ SW BOR
BOR event
(Reset event)
Load
SVSH fault calibration data
SW POR
event
POR
WDT Active
Time expired, Overflow PMM, WDT
Password violation
FRAM
Uncorrectable Bit Error PUC
CPUOFF = 1
OSCOFF = 0 Active Mode: CPU is Active PMMREGOFF = 1
SCG0 = 0 to LPMx.5
Various Modules are active
SCG1 = 0
†
LPM0: †
CPU/MCLK = off
ACLK = on
VCORE = on †
† LPM4:
CPUOFF = 1 CPU/MCLK = off
OSCOFF = 1 FLL = off
SCG0 = 1 ACLK = off
CPUOFF = 1 CPUOFF = 1 SCG1 = 1 VCORE = on
OSCOFF = 0 OSCOFF = 0
SCG0 = 0 SCG0 = 1
SCG1 = 1 SCG1 = 1
LPM3:
CPU/MCLK = off
LPM2*: ACLK = on
CPU/MCLK = off VCORE = on
ACLK = on
VCORE = on
Arbitrary transitions
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module (SYS) 37
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Operating Modes www.ti.com
38 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Operating Modes
(1)
The abbreviation "LPMx.5" is used in this document to indicate both LPM3.5 and LPM4.5.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 39
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Operating Modes www.ti.com
Compute Through Power Loss (CTPL) is a utility API set that leverages FRAM to enable ease of use with
LPMx.5 low-power modes and to provide a powerful shutdown mode that allows an application to save
and restore critical system components when a power loss is detected. Visit FRAM embedded software
utilities for MSP ultra-low-power microcontrollers for details.
The device enters LPM3.5 if any module that is connected to the RTC LDO is enabled. The device enters
LPM4.5 if none of the modules that are connected to the RTC LDO are enabled.
40 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Operating Modes
Any exit from LPMx.5 causes a BOR. The program execution starts at the address the reset vector points
to. PMMLPM5IFG = 1 indicates a wakeup from LPMx.5 or the System Reset Vector Word register
SYSRSTIV can be used to decode the reset condition (see the device-specific data sheet).
After wakeup from LPMx.5, the state of the I/Os and the modules connected to the RTC LDO are locked
and remain unchanged until you clear the LOCKLPM5 bit in the PM5CTL0 register.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 41
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Principles for Low-Power Applications www.ti.com
42 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Configuring JTAG Pins
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 43
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Memory Map – Uses and Abilities www.ti.com
44 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Memory Map – Uses and Abilities
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 45
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Memory Map – Uses and Abilities www.ti.com
46 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Memory Map – Uses and Abilities
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 47
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Memory Map – Uses and Abilities www.ti.com
CAUTION
To protect the program stored in FRAM from unintended writes, FRAM write
protection must be enabled at all times, except when an intentional write
operation is performed. The write operation should be completed within as
short a time as possible with interrupts disabled to reduce the risk of an
unintended write operation.
48 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com JTAG Mailbox (JMB) System
It may be desirable in some BSL applications to only allow changing of the Power Management Module
settings from the protected BSL segments. This is possible with the SYSPMMPE bit. Normally, this bit is
cleared and allows access of the PMM control registers from any memory location. Setting SYSPMMPE
allows access to the PMM control registers only from the protected BSL memory. After SYSPMMPE is set,
it can only be cleared by a BOR event.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 49
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Device Security www.ti.com
In 16-bit mode, JMBINIFG is set when SYSJMBI0 is available for reading. In 32-bit mode, JMBINIFG is
set when both SYSJMBI0 and SYSJMBI1 are available for reading. If JMBOUTIE is set, these events
cause a system NMI. In 16-bit mode, JMBINIFG is cleared automatically when SYSJMBI0 is read. In 32-
bit mode, JMBINIFG Is cleared automatically when both SYSJMBI0 and SYSJMBI1 are read. In addition,
the JMBINIFG can be cleared when reading SYSSNIV. Clearing JMBINIE disables the NMI interrupt.
NOTE: When a device has been protected, TI cannot access the device for a customer return.
Access is only possible if a BSL is provided with its corresponding key or an unlock
mechanism is provided by the customer.
A device can be locked by writing any value other than 0000h or FFFFh to both JTAG Signature 1 and
JTAG Signature 2. In this case, the JTAG and SBW interfaces grant access to a limited JTAG command
set that restricts accessibility into the device. The only way to unlock the device in this case is to use the
BSL to overwrite the JTAG signatures with 0000h or FFFFh. Some JTAG commands are still possible
when the device is secured, including the BYPASS command (see IEEE Std 1149-2001) and the
JMB_EXCHANGE command, which allows access to the JTAG Mailbox System (see Section 1.10.4 for
details).
Signatures that have been entered do not take effect until the next BOR event has occurred, at which time
the signatures are checked.
For more details, see MSP430 Programming With the Bootloader (BSL) and the MSP430FR4xx and
MSP430FR2xx Bootloader (BSL) User's Guide.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 51
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Device-Specific Configurations www.ti.com
TA0CLK 00
ACLK 01
SMCLK 10
Divider Counter Timer0_A3
from CapTouchIO 11 TA1CLK 00
(INCLK) ACLK 01
TA0CTL.TASSEL
CCR0 SMCLK 10
Divider Counter Timer1_A3
(TA0.0A)
00 11
(TA0.0B) INCLK
01 Input TA1CTL.TASSEL
Comparator 0 (TA0.0A) CCR0
DVSS 10 Logic (TA1.0A)
DVCC
Output 00
11 (TA0.0B) (TA1.0B)
Logic 01 Input
TA0CCTL0.CCIS CCR1 Comparator 0 (TA1.0A)
DVSS 10 Logic
(TA0.1A) Output
P1.7 DVCC 11 (TA1.0B)
00 Logic
(TA0.1B)
from RTC 01 Input TA1CCTL0.CCIS CCR1
DVSS Logic Comparator 1 (TA0.1A)
10 P1.7 (TA1.1A)
DVCC
Output P4.0 00
11 (TA0.1B) (TA1.1B)
Logic 01 Input
TA0CCTL1.CCIS CCR2 DVSS Logic Comparator 1 (TA1.1A)
10 P4.0
(TA0.2A) Output
P1.6 DVCC 11
(TA0.2B)
00 Logic (TA1.1B) to ADC Trigger
from CapTouchIO 01 Input TA1CCTL1.CCIS CCR2
Logic Comparator 2 (TA0.2A)
DVSS 10 P1.6 (TA1.2A)
DVCC
Output P8.3 00
11
Logic (TA0.2B) (TA1.2B)
01 Input
TA0CCTL2.CCIS Comparator 2 (TA1.2A)
DVSS 10 Logic P8.3
Output
DVCC 11
Logic (TA1.2B)
TA1CCTL2.CCIS
1
IR Modulation (SYS)
0
0
1 1
1 P1.0/UCA0TXD/UCA0SIMO
0
From UCA0TXD/UCA0SIMO 0
SYSCFG1.IRDSEL SYSCFG1.IRPSEL
1.2V REF
P1.4/MCLK/TCK/A4/VREF+ Bandgap
Generation
52 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Device-Specific Configurations
1
IR Modulation (SYS)
0
0
1 1
1 P2.6/UCA1TXD/UCA1SIMO
0
From UCA1TXD/UCA1SIMO 0
SYSCFG1.IRDSEL SYSCFG1.IRPSEL
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 53
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Device-Specific Configurations www.ti.com
1.2V REF
P1.4/UCA0TXD/UCA0SIMO/TA1.2/TCK/A4/VREF+ Bandgap
Generation
54 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Device-Specific Configurations
TA0CLK 00
ACLK 01
SMCLK 10
Divider Counter Timer0_A3
from CapTouchIO 11 TA1CLK 00
(INCLK) ACLK 01
TA0CTL.TASSEL
CCR0 SMCLK 10
Divider Counter Timer1_A3
(TA0.0A)
00 11
(TA0.0B) INCLK
01 Input TA1CTL.TASSEL
Comparator 0 (TA0.0A) CCR0
DVSS 10 Logic (TA1.0A)
DVCC
Output 00
11 (TA0.0B) (TA1.0B)
Logic 01 Input
TA0CCTL0.CCIS CCR1 Comparator 0 (TA1.0A)
DVSS 10 Logic
(TA0.1A) Output
P1.1 DVCC 11 (TA1.0B)
00 Logic
(TA0.1B)
from RTC 01 Input TA1CCTL0.CCIS CCR1
DVSS Logic Comparator 1 (TA0.1A)
10 P1.1 (TA1.1A)
DVCC
Output P1.5 00
11 (TA0.1B) (TA1.1B)
Logic 01 Input
TA0CCTL1.CCIS CCR2 DVSS Logic Comparator 1 (TA1.1A)
10 P1.5
(TA0.2A) Output
P1.2 DVCC 11
(TA0.2B)
00 Logic (TA1.1B) to ADC Trigger
from CapTouchIO 01 Input TA1CCTL1.CCIS CCR2
Logic Comparator 2 (TA0.2A)
DVSS 10 P1.2 (TA1.2A)
DVCC
Output P1.4 00
11
Logic (TA0.2B) (TA1.2B)
01 Input
TA0CCTL2.CCIS Comparator 2 (TA1.2A)
DVSS 10 Logic P1.4
Output
DVCC 11
Logic (TA1.2B)
TA1CCTL2.CCIS
1
IR Modulation (SYS)
0
0
1 1
1 P2.6/UCA1TXD/UCA1SIMO
0
From UCA1TXD/UCA1SIMO 0
SYSCFG1.IRDSEL SYSCFG1.IRPSEL
1.2V REF
P1.4/UCA0TXD/UCA0SIMO/TA1.2/TCK/A4/VREF+ Bandgap
Generation
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 55
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Device-Specific Configurations www.ti.com
Timer_B0 Timer_B1
TB0CLK 00
ACLK 01 TB1CLK 00
16-bit Counter
SMCLK 10 ACLK 01
from 16-bit Counter
CapTouch 11 SMCLK 10
11
RTC 00
ACLK 01 TB0.0A 00
CCR0
DVSS 10 TB0.0B 01 TB0.0A
CCR0
DVCC 11 DVSS 10 TB0.0B
DVCC 11
P1.6 00
DVCC 11
P1.7 00
from
CapTouch 01 TB0.2A P1.7 P2.1 00
CCR2
DVSS 10 TB0.2B 01 TB0.2A P2.1
CCR2
DVCC 11 DVSS 10 TB0.2B
DVCC 11
1
IR Modulation (SYS)
0
0
1 1
1 P1.7/UCA0TXD/UCA0SIMO
0
From UCA0TXD/UCA0SIMO 0
SYSCFG1.IRDSSEL SYSCFG1.IRPSEL
56 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Device-Specific Configurations
1.2 V REF
P1.7/UCA0STE/TB0.2/TDO/TRI0+/A7/VREF+ Bandgap
Generation
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 57
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Device-Specific Configurations www.ti.com
Timer_B0
TB1CLK 00
ACLK 01
16-bit Counter
SMCLK 10
from
11
CapTouch
00
01 TB0.0A
CCR0
DVSS 10 TB0.0B
DVCC 11
P2.0 00
01 TB0.1A P2.0
CCR1
DVSS 10 TB0.1B To ADC Trigger
DVCC 11
P2.1 00
01 TB0.2A P2.1
CCR2
DVSS 10 TB0.2B
DVCC 11
1
IR Modulation (SYS)
0
0
1 1
1 P1.7/UCA0TXD/UCA0SIMO or
0 P1.3/UCA0TXD/UCA0SIMO
From UCA0TXD/UCA0SIMO 0
SYSCFG1.IRDSSEL SYSCFG1.IRPSEL
58 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Device Descriptor Table
1.2 V REF
P1.7/UCA0STE/TB0.2/TDO/TRI0+/A7/VREF+ Bandgap
Generation
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 59
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Device Descriptor Table www.ti.com
CRC_length
Information block
CRC_value
DeviceID
Hardware revision
Tag 1
Len 1
First TLV entry
Value field 1
(optional)
Tag N
Len N
Final TLV entry
Value field N
(optional)
60 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Device Descriptor Table
Each tag field is unique to its respective descriptor and is always followed by a length field. The length
field is one byte if the tag value is 01h through 0FDh and represents the length of the descriptor in bytes.
If the tag value equals 0FEh (TAGEXT), the next byte extends the tag values, and the following two bytes
represent the length of the descriptor in bytes. In this way, a user can search through the TLV descriptor
table for a particular tag value using a routine similar to the following, which is written in pseudo code:
// Identify the descriptor ID (d_ID_value) for the TLV descriptor of interest:
descriptor_address = TLV_START address;
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 61
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Device Descriptor Table www.ti.com
VREF+
Factorgain _1.5Vref = ´ 215
1.5V (2)
In this way, a conversion result is corrected by multiplying it with the Factorgain_1.5Vref and dividing the result
by 215 as shown for each of the respective reference voltages:
1
ADCcalibrated = ADCraw ´ Factorgain _1.5Vref ´ 15
2 (3)
In the following example, the integrated 1.5-V reference voltage is used during a conversion.
• Conversion result: 0x0100 = 256 decimal
• Reference voltage calibration factor (Factorgain_1.5Vref) : 0x7BBB
The following steps show how the ADC conversion result can be corrected:
• Multiply the conversion result by 2 (this step simplifies the final division): 0x0100 × 0x0002 = 0x0200
• Multiply the result by Factorgain_1.5Vref: 0x200 × 0x7BBB = 0x00F7_7600
• Divide the result by 216: 0x00F7_7600 / 0x0001_0000 = 0x0000_00F7 = 247 decimal
62 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Device Descriptor Table
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 63
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
SFR Registers www.ti.com
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
64 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SFR Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 65
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
SFR Registers www.ti.com
66 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SFR Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 67
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
SYS Registers www.ti.com
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
68 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SYS Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 69
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
SYS Registers www.ti.com
70 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SYS Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 71
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
SYS Registers www.ti.com
72 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SYS Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 73
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
SYS Registers www.ti.com
NOTE: Additional events for more complex devices will be appended to this table; sources that are
removed reduce the length of this table. The vectors are expected to be accessed symbolic
only with the corresponding include file of the device in use.
NOTE: Additional events for more complex devices will be appended to this table; sources that are
removed reduce the length of this table. The vectors are expected to be accessed symbolic
only with the corresponding include file of the device in use.
74 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SYS Registers
NOTE: Additional events for more complex devices will be appended to this table; sources that are
removed reduce the length of this table. The vectors are expected to be accessed symbolic
only with the corresponding include file of the device in use.
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 75
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
76 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 77
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
78 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 79
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
80 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 81
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
82 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 83
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
84 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 85
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
86 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 87
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
88 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
1.16.4.1 MSP430FR263x and MSP430FR253x SYSCFG0 Register (offset = 00h) [reset = 9603h]
System Configuration Register 0
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 89
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
1.16.4.2 MSP430FR263x and MSP430FR253x SYSCFG1 Register (offset = 02h) [reset = 0000h]
System Configuration Register 1
90 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
1.16.4.3 MSP430FR263x and MSP430FR253x SYSCFG2 Register (offset = 04h) [reset = 0000h]
System Configuration Register 2
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 91
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
92 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 93
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
94 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 95
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
96 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 97
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
System Configuration Registers www.ti.com
98 System Resets, Interrupts, and Operating Modes, System Control Module SLAU445G – October 2014 – Revised August 2016
(SYS) Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com System Configuration Registers
SLAU445G – October 2014 – Revised August 2016 System Resets, Interrupts, and Operating Modes, System Control Module 99
Submit Documentation Feedback (SYS)
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 2
SLAU445G – October 2014 – Revised August 2016
This chapter describes the operation of the Power Management Module (PMM) and
Supply Voltage Supervisor (SVS).
100 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Power Management Module (PMM) Introduction
LPM3.5 Switch
PMMLPM5IFG
SVSH BOR SVSHIFG
PMMPORIFG
PMMRSTIFG
PMMBORIFG
LPM3.5 Switch
1.5V Control
To I/O Control
Reference
SLAU445G – October 2014 – Revised August 2016 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) 101
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
PMM Operation www.ti.com
DVCC
SVSH_IT+
SVSH_IT-
BOR
Time
102 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com PMM Operation
DVCC
SVSH_IT+
VCORE
BOR
Time
SLAU445G – October 2014 – Revised August 2016 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) 103
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
PMM Operation www.ti.com
104 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com PMM Operation
2.2.10 RST/NMI
The external RST/NMI terminal is pulled low on a BOR reset condition. RST/NMI can be used as reset
source for the rest of the application.
SLAU445G – October 2014 – Revised August 2016 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) 105
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
PMM Registers www.ti.com
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
106 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com PMM Registers
SLAU445G – October 2014 – Revised August 2016 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) 107
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
PMM Registers www.ti.com
108 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com PMM Registers
SLAU445G – October 2014 – Revised August 2016 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) 109
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
PMM Registers www.ti.com
110 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com PMM Registers
SLAU445G – October 2014 – Revised August 2016 Power Management Module (PMM) and Supply Voltage Supervisor (SVS) 111
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 3
SLAU445G – October 2014 – Revised August 2016
The Clock System (CS) module provides the various clocks used on MCU. This chapter describes the
operation of the CS module, which is implemented in all devices.
112 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Introduction
3.1 CS Introduction
The CS module supports low system cost and low power consumption. This module supports four internal
and two external clock sources, by which users can optimize the clock configuration for different design
goals. Not all clock sources present in one device. For a detailed description of the configuration for any
given device, see the device-specific data sheet. All clock sources can be fully selected by software.
External clock sources can use either crystal or ceramic oscillators or resonators.
The CS module includes up to six clock sources:
• XT1CLK: High-frequency or low-frequency oscillator that can be used with a high-frequency ceramic or
crystal oscillator or a low-frequency 32768-Hz crystal. XT1CLK can be used as a clock reference into
the FLL. Some devices only support the low-frequency oscillator for XT1CLK. Refer to the device-
specific data sheet for more details.
• VLOCLK: Internal very-low-power low-frequency oscillator with 10-kHz typical frequency
• REFOCLK: Internal trimmed low-frequency oscillator with 32768-Hz typical frequency. Can be used as
a clock reference into the FLL.
• DCOCLK: Internal digitally controlled oscillator (DCO) that can be stabilized by the FLL.
• MODCLK: Internal high-frequency oscillator with 5-MHz typical frequency.
Three clock signals are available from the CS module:
• ACLK: Auxiliary clock. ACLK can be used for peripherals low-frequency operation. This clock is
software selectable as XT1CLK or REFOCLK. The selected clock source must always be
approximately 32 kHz, no more than 40 kHz (typical). ACLK is software selectable by individual
peripheral modules.
• MCLK: Master clock. MCLK is the main clock source of CPU, CRC, and some other digital peripherals
directly operated by the CPU or its clock. This clock is software selectable as REFOCLK, DCOCLK,
XT1CLK, or VLOCLK. When available, the selected clock source can be predivided by 1, 2, 4, 8, 16,
32, 64, or 128.
• SMCLK: Subsystem master clock. SMCLK is the clock for the peripherals that can work independently
from CPU operation. This clock always derives from MCLK. When available, SMCLK can be predivided
by 1, 2, 4, or 8. SMCLK is software selectable by individual peripheral modules.
Figure 3-1 shows the block diagram of the CS module.
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 113
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Introduction www.ti.com
FLLWARNEN, FLLULIE
FLLUNLOCKHIS, FLLUNLOCK
FLLULIFG, DCOFFG
DCOFTRIM
FLLREFDIV
SELREF DCORSEL, DCO
DISMOD, MOD
REFOCLK
1 1/32/64/128
0 /256/512 FD
LPF
REFO
DCOCLK
DCO
FLLN FLLD
NOTE: XT1 HF setting is device specific. SELMS
Refer to the device-specific data sheet
for details. ÷ 1/2/4/8
(FLLN+1) /16/32
00
XT1AUTOOFF DCOCLKDIV
XT1AGCOFF
DIVM CPUOFF
XT1DRIVE
XTS XT1BYPASS
01
1, 2, 4, 8, 16, MCLK
XT1IN 32, 64, 128
1
XT1 10
0
VLOAUTOOFF
XT1OUT 1, 2, 4, 8
SMCLK
XT1 11
ENSTFCNT1 DIVS SMCLKOFF
XT1OFFG
VLO
VLOCLK
1
ACLK
0
1, 16, 32,
128, 256, 384,
512, 768, 1024
SELA
MODCLK
DIVA
MODO
XT1CLK
From Peripherlas
MODCLK Request
MODCLKREQEN
From Peripherlas
MCLK Request
MCLKREQEN
From Peripherlas
SMCLK Request
SMCLKREQEN
From Peripherlas
ACLK Request
ACLKREQEN
114 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Operation
3.2 CS Operation
After a PUC, the CS module default configuration is:
• MCLK and SMCLK use DCOCLKDIV, which is locked by the FLL and referenced by REFO if XT1 is
not available.
• ACLK uses REFO.
• XT1 external crystal oscillator is selected as the XT1CLK clock source. XT1IN and XT1OUT pins are
set to general-purpose I/Os and XT1 remains disabled until the I/O ports are configured for XT1
operation.
After PUC, DCO locked by FLL operation with XT1CLK is selected by default. The FLL stabilizes MCLK
and SMCLK to 1 MHz and fDCOCLKDIV = 1 MHz
An external 32768-Hz crystal can be used as the FLL reference. By default, the crystal pins (XT1IN,
XT1OUT) are shared with general-purpose I/Os. To enable XT1, the PSEL bits associated with the crystal
pins must be set to use the external 32768-Hz crystal as the clock source. After the crystal starts up and
settles, the FLL reference clock is automatically switched to XT1CLK when XT1OFFG, DCOFFG, and
OFIFG are clear.
A default monitor is engaged with XT1 oscillation. If XT1 is used but does not work properly, fault
protection logic forces REFO as the FLL reference clock.
The status register control bits (SCG0, SCG1, OSCOFF, and CPUOFF) configure the MSP430 operating
modes and enable or disable portions of the CS module. Registers CSCTL0 to CSCTL8 configure the CS
module.
The CS module can be configured or reconfigured by software at any time during program execution.
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 115
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Operation www.ti.com
116 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Operation
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 117
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Operation www.ti.com
MODx
31
24
16
15
118 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Operation
If the FLLULPUC bit is set (FLLULPUC = 1), when DCO runs too fast (FLLUNLOCK = 10b), the
FLLULIFG bit flag being set causes a PUC reset.
If FLLWARNEN bit is set, when FLLUNLOCKHIS changes to unlock, the OFIFG flag is set.
Unlock PUC reset
if FLLULPUC = 1 Unlock
and FLLUNLOCK = 10 (too fast) if FLLULPUC = 0
and FLLUNLOCK = 01 (too slow)
or FLLUNLOCK = 10 (too fast)
or FLLUNLOCK = 11 (out of DCO range)
Recover
FLLUNLOCKHIS = FLLUNLOCK (previous state)
FLLUNLOCK = 00
if FLLWARNEN = 1
An OFIFG interrupt generated
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 119
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Operation www.ti.com
120 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Operation
ACLK_REQ
SMCLK_REQ
MCLK_REQ
Clock
System SMCLK ALK MCLK SMCLK ALK MCLK SMCLK ALK MCLK SMCLK ALK
Request Request Request Request Request Request Request Request Request Request Request
(CS)
Watchdog Timer
Direct Clock Request Module 1 Module 2 Module n
Module
in Watchdog Mode
MCLK
SMCLK
ACLK
VLOCLK
By default, the clock request logic is enabled. The clock request logic can be disabled by clearing
ACLKREQEN, MCLKREQEN, or SMCLKREQEN, for each respective system clock. When ACLKREQEN
or MCLKREQEN bits are set, or active, the clock is available to the system and prevents entry into a low-
power mode until all modules requesting the clock are disabled. When ACLKREQEN or MCLKREQEN bits
are cleared, or disabled, the clock is always halted as defined by the low-power modes. The
SMCLKREQEN logic behaves similarly, but it is also influenced by the SMCLKOFF bit in the CSCTL5
register.
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 121
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Operation www.ti.com
Table 3-1 shows the relationship between the system clocks and the low-power modes in conjunction with
the clock request logic.
PUC S Q
R
NMI_IRQA
DCO FAULT
S Q S Q OFIE
NMIRS
R R OFIFG
DCOFFG DCO OF S Q
Q
S Q S Q
R R
XT1OFFG XT1 OF
POR
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 123
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Operation www.ti.com
DCOCLK
XT1CLK
MCLK
124 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Registers
3.3 CS Registers
Table 3-2 lists the CS registers with offsets. See the device-specific data sheet for the base address.
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L ) refers to the lower byte of the register (bits 0 to 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 to 15).
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 125
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Registers www.ti.com
126 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Registers
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 127
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Registers www.ti.com
128 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Registers
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 129
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Registers www.ti.com
130 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Registers
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 131
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Registers www.ti.com
(1)
These bits are valid only in XT1 HF mode. The divider setting depends on the external high-frequency oscillator value, because ACLK is
fixed to no more than 40 kHz (typical). See the device-specific data sheet for details.
(2)
This divider is always bypassed if ACLK sources from XT1 in LF mode.
(3)
The bits are read-only if XT1 HF mode is not supported in the device. See the device-specific data sheet for configuration information.
(4)
The bits are read-only as 0 if XT1 HF mode is not supported in the device. See the device-specific data sheet for configuration
information.
132 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Registers
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 133
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Registers www.ti.com
134 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CS Registers
SLAU445G – October 2014 – Revised August 2016 Clock System (CS) 135
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CS Registers www.ti.com
136 Clock System (CS) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 4
SLAU445G – October 2014 – Revised August 2016
CPUX
This chapter describes the extended MSP430X 16-bit RISC CPU (CPUX) with 1MB memory access, its
addressing modes, and instruction set.
NOTE: The MSP430X CPUX implemented on this device family, formally called CPUXV2, has in
some cases, slightly different cycle counts from the MSP430X CPUX implemented on the
2xx and 4xx families.
19 16 15 0
R0/PC Program Counter 0
R4 General Purpose
R5 General Purpose
R6 General Purpose
R7 General Purpose
R8 General Purpose
R9 General Purpose
4.2 Interrupts
The MSP430X has the following interrupt structure:
• Vectored interrupts with no polling necessary
• Interrupt vectors are located downward from address 0FFFEh.
The interrupt vectors contain 16-bit addresses that point into the lower 64KB memory. This means all
interrupt handlers must start in the lower 64KB memory.
During an interrupt, the program counter (PC) and the status register (SR) are pushed onto the stack as
shown in Figure 4-2. The MSP430X architecture stores the complete 20-bit PC value efficiently by
appending the PC bits 19:16 to the stored SR value automatically on the stack. When the RETI instruction
is executed, the full 20-bit PC is restored making return from interrupt to any address in the memory range
possible.
The PC can be addressed with all instructions and addressing modes. A few examples:
MOV.W #LABEL,PC ; Branch to address LABEL (lower 64KB)
SPold Item n
PC.19:16
SP PC.15:0
The RETA instruction restores bits 19:0 of the PC and adds 4 to the stack pointer (SP). The RET
instruction restores bits 15:0 to the PC and adds 2 to the SP.
Figure 4-6 shows the stack usage. Figure 4-7 shows the stack usage when 20-bit address words are
pushed.
19 1 0
0xxxh I1 I1 I1
0xxxh − 2 I2 I2 I2
0xxxh − 4 I3 SP I3 I3 SP
0xxxh − 6 0123h SP
0xxxh − 8
Item.19:16
SP Item.15:0
The special cases of using the SP as an argument to the PUSH and POP instructions are described and
shown in Figure 4-8.
PUSH SP POP SP
SPold
SP1 SPold SP2 SP1
The stack pointer is changed after The stack pointer is not changed after a POP SP
a PUSH SP instruction. instruction. The POP SP instruction places SP1 into the
stack pointer SP (SP2 = SP1)
rw-0
Figure 4-9. SR Bits
NOTE: Bit manipulations of the SR should be done by the following instructions: MOV, BIS, and
BIC.
19 16 15 87 0
Un- Unused
Memory Register
used
Operation Operation
Memory 0 0 Register
Figure 4-11 and Figure 4-12 show 16-bit word handling (.W suffix). The handling is shown for a source
register and a destination memory word and for a source memory word and a destination register.
Register-Word Operation
Memory
Operation
Memory
Memory
19 16 15 87 0
Un-
Register
used
Operation
0 Register
Figure 4-13 and Figure 4-14 show 20-bit address-word handling (.A suffix). The handling is shown for a
source register and a destination memory address-word and for a source memory address-word and a
destination register.
Register − Address-Word Operation
Operation
Memory +2 0 Memory
Register
Operation
Register
The seven addressing modes are explained in detail in the following sections. Most of the examples show
the same addressing mode for the source and destination, but any valid combination of source and
destination addressing modes is possible in an instruction.
Operation: The operand is the 8-, 16-, or 20-bit content of the used CPU register.
Length: One, two, or three words
Comment: Valid for source and destination
Byte operation: Byte operation reads only the eight least significant bits (LSBs) of the source
register Rsrc and writes the result to the eight LSBs of the destination register Rdst.
The bits Rdst.19:8 are cleared. The register Rsrc is not modified.
Word operation: Word operation reads the 16 LSBs of the source register Rsrc and writes the result
to the 16 LSBs of the destination register Rdst. The bits Rdst.19:16 are cleared.
The register Rsrc is not modified.
Address-word Address-word operation reads the 20 bits of the source register Rsrc and writes the
operation: result to the 20 bits of the destination register Rdst. The register Rsrc is not
modified
SXT exception: The SXT instruction is the only exception for register operation. The sign of the low
byte in bit 7 is extended to the bits Rdst.19:8.
Example: BIS.W R5,R6 ;
This instruction logically ORs the 16-bit data contained in R5 with the 16-bit
contents of R6. R6.19:16 is cleared.
Before: After:
Address Register Address Register
Space Space
A550h.or.1111h = B551h
Example: BISX.A R5,R6 ;
This instruction logically ORs the 20-bit data contained in R5 with the 20-bit
contents of R6.
The extension word contains the A/L bit for 20-bit data. The instruction word uses
byte mode with bits A/L:B/W = 01. The result of the instruction is:
Before: After:
Address Register Address Register
Space Space
AA550h.or.11111h = BB551h
10000
0FFFF
Lower 64KB
Before: After:
Address Register Address Register
Space Space
0479Ch
0579Eh xxxxh +1000h 0579Eh xxxxh
0579Ch
0579Ch xx32h 0579Ch xx32h
Rn.19:0 Rn ± 32KB
Rn.19:0
FFFFF
±32KB
Rn.19:0
±32KB
10000 Rn.19:0
0FFFF
Lower 64KB
Rn.19:0
0000C
Before: After:
Address Register Address Register
Space Space
23456h
1B79Eh xxxxh +F8346h 1B79Eh xxxxh
1B79Ch
1B79Ch 5432h 1B79Ch 5432h
The extension word contains the MSBs of the source index and of the destination index and the A/L bit for
20-bit data. The instruction word uses byte mode due to the 20-bit data length with bits A/L:B/W = 01.
Before: After:
Address Register Address Register
Space Space
23456h
3579Eh 0006h +12346h 3579Eh 0006h
3579Ch
3579Ch 5432h 3579Ch 5432h
Lower 64KB
PC.19:16 = 0
19 16 15 0
FFFFF
Program
0
counter PC
Lower 64KB
16-bit signed add
PC.19:0
Operation: The signed 16-bit index in the next word after the instruction is added temporarily to
the PC. The resulting bits 19:16 are cleared giving a truncated 16-bit memory
address, which points to an operand address in the range 00000h to 0FFFFh. The
operand is the content of the addressed memory location.
Length: Two or three words
Comment: Valid for source and destination. The assembler calculates the PC index and
inserts it.
Example: ADD.B EDE,TONI ;
This instruction adds the 8-bit data contained in source byte EDE and destination
byte TONI and places the result into the destination byte TONI. Bytes EDE and
TONI and the program are located in the lower 64KB.
Source: Byte EDE located at address 0579Ch, pointed to by PC + 4766h, where the PC
index 4766h is the result of 0579Ch – 01036h = 04766h. Address 01036h is the
location of the index for this example.
Destination: Byte TONI located at address 00778h, pointed to by PC + F740h, is the truncated
16-bit result of 00778h – 1038h = FF740h. Address 01038h is the location of the
index for this example.
Before: After:
Address Address
Space Space
01036h
0579Eh xxxxh +04766h 0579Eh xxxxh
0579Ch
0579Ch xx32h 0579Ch xx32h
PC.19:0 PC ±32KB
PC.19:0
FFFFF
±32KB
PC.19:0
±32KB
10000 PC.19:0
0FFFF
Lower 64KB
PC.19:0
0000C
Before: After:
Address Address
Space Space
2F036h
3379Eh xxxxh +04766h 3379Eh xxxxh
3379Ch
3379Ch 5432h 3379Ch 5432h
5432h src
0077Ah xxxxh 0077Ah xxxxh +2345h dst
7777h Sum
00778h 2345h 00778h 7777h
21036h
3579Eh xxxxh +14766h 3579Eh xxxxh
3579Ch
3579Ch xx32h 3579Ch xx32h
5432h src
0777Ah xxxxh 0777Ah xxxxh +2345h dst
7777h Sum
07778h 2345h 07778h 7777h
Before: After:
Address Address
Space Space
65432h src
7777Ah 0001h 7777Ah 0007h +12345h dst
77777h Sum
77778h 2345h 77778h 7777h
Before: After:
Address Register Address Register
Space Space
Before: After:
Address Register Address Register
Space Space
Length: Two or three words. One word less if a constant of the constant generator can be
used for the immediate operand.
Operation: The 16-bit immediate source operand is used together with the 16-bit destination
operand.
Comment: Valid only for the source operand
Example: ADD #3456h,&TONI
This instruction adds the 16-bit immediate operand 3456h to the data in the
destination address TONI.
Source: 16-bit immediate value 3456h
Destination: Word at address TONI
Before: After:
Address Address
Space Space
3456h src
0077Ah xxxxh 0077Ah xxxxh +2345h dst
579Bh Sum
00778h 2345h 00778h 579Bh
Length: Three or four words. One word less if a constant of the constant generator can be
used for the immediate operand.
Operation: The 20-bit immediate source operand is used together with the 20-bit destination
operand.
Comment: Valid only for the source operand
Example: ADDX.A #23456h,&TONI ;
This instruction adds the 20-bit immediate operand 23456h to the data in the
destination address TONI.
Source: 20-bit immediate value 23456h
Destination: Two words beginning with address TONI
Before: After:
Address Address
Space Space
23456h src
7777Ah 0001h 7777Ah 0003h +12345h dst
3579Bh Sum
77778h 2345h 77778h 579Bh
Destination 15:0
Destination 15:0
(1)
* = Status bit is affected.
– = Status bit is not affected.
0 = Status bit is cleared.
1 = Status bit is set.
4.5.1.5.1 Instruction Cycles and Length for Interrupt, Reset, and Subroutines
Table 4-8 lists the length and the CPU cycles for reset, interrupts, and subroutines.
Table 4-11. Description of the Extension Word Bits for Register Mode
Bit Description
15:11 Extension word op-code. Op-codes 1800h to 1FFFh are extension words.
10:9 Reserved
ZC Zero carry
0 The executed instruction uses the status of the carry bit C.
1 The executed instruction uses the carry bit as 0. The carry bit is defined by the result of the final operation after
instruction execution.
# Repetition
0 The number of instruction repetitions is set by extension word bits 3:0.
1 The number of instruction repetitions is defined by the value of the four LSBs of Rn. See description for bits 3:0.
A/L Data length extension. Together with the B/W bits of the following MSP430 instruction, the AL bit defines the used data
length of the instruction.
A/L B/W Comment
0 0 Reserved
0 1 20-bit address word
1 0 16-bit word
1 1 8-bit byte
5:4 Reserved
3:0 Repetition count
#=0 These four bits set the repetition count n. These bits contain n – 1.
#=1 These four bits define the CPU register whose bits 3:0 set the number of repetitions. Rn.3:0 contain n – 1.
NOTE: B/W and A/L bit settings for SWPBX and SXTX
A/L B/W
0 0 SWPBX.A, SXTX.A
0 1 N/A
1 0 SWPB.W, SXTX.W
1 1 N/A
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XORX.A R9,R8
1: Repetition count
in bits 3:0
0: Use Carry 01: Address word
0 0 0 1 1 0 0 0 0 0 0
14(XOR) 9 0 1 0 8(R8)
Destination
register mode
Source
register mode
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Source 15:0
Destination 15:0
X(Rn)
01: Address
word @PC+
0 0 0 1 1 1 0 0 4
The four possible addressing combinations for the extension word for Format I instructions are shown in
Figure 4-29.
15 14 13 12 11 10 9 8 7 6 5 4 3 0
0 0 0 1 1 0 0 ZC # A/L 0 0 n−1/Rn
0 0 0 1 1 src.19:16 A/L 0 0 0 0 0 0
src.15:0
0 0 0 1 1 0 0 0 0 A/L 0 0 dst.19:16
dst.15:0
src.15:0
dst.15:0
If the 20-bit address of a source or destination operand is located in memory, not in a CPU register, then
two words are used for this operand as shown in Figure 4-30.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The three possible addressing mode combinations for Format II instructions are shown in Figure 4-31.
15 14 13 12 11 10 9 8 7 6 5 4 3 0
0 0 0 1 1 0 0 ZC # A/L 0 0 n−1/Rn
0 0 0 1 1 0 0 0 0 A/L 0 0 0 0 0 0
0 0 0 1 1 0 0 0 0 A/L 0 0 dst.19:16
dst.15:0
15 12 11 10 9 4 3 0
15 12 11 8 7 4 3 0
#imm15:0 / &abs15:0
index15:0
15 4 3 0
Op-code Rdst
Op-code Rdst
index15:0
Op-code #imm/ix/abs19:16
000 040 080 0C0 100 140 180 1C0 200 240 280 2C0 300 340 380 3C0
0xxx MOVA, CMPA, ADDA, SUBA, RRCM, RRAM, RLAM, RRUM
RRC. SWP RRA. PUS PUS CALL
10xx RRC RRA SXT CALL RETI
B B B H H.B A
14xx PUSHM.A, POPM.A, PUSHM.W, POPM.W
18xx
Extension word for Format I and Format II instructions
1Cxx
20xx JNE, JNZ
24xx JEQ, JZ
28xx JNC
2Cxx JC
30xx JN
34xx JGE
38xx JL
3Cxx JMP
4xxx MOV, MOV.B
5xxx ADD, ADD.B
6xxx ADDC, ADDC.B
7xxx SUBC, SUBC.B
8xxx SUB, SUB.B
9xxx CMP, CMP.B
Axxx DADD, DADD.B
Bxxx BIT, BIT.B
Cxxx BIC, BIC.B
Dxxx BIS, BIS.B
Exxx XOR, XOR.B
Fxxx AND, AND.B
Instruction Instruction
src or data.19:16 dst
Instruction Group Identifier
15 12 11 8 7 4 3 0
MOVA 0 0 0 0 src 0 0 0 0 dst MOVA @Rsrc,Rdst
0 0 0 0 src 0 0 0 1 dst MOVA @Rsrc+,Rdst
0 0 0 0 &abs.19:16 0 0 1 0 dst MOVA &abs20,Rdst
&abs.15:0
0 0 0 0 src 0 0 1 1 dst MOVA x(Rsrc),Rdst
x.15:0 ±15-bit index x
0 0 0 0 src 0 1 1 0 &abs.19:16 MOVA Rsrc,&abs20
&abs.15:0
0 0 0 0 src 0 1 1 1 dst MOVA Rsrc,X(Rdst)
x.15:0 ±15-bit index x
0 0 0 0 imm.19:16 1 0 0 0 dst MOVA #imm20,Rdst
imm.15:0
CMPA 0 0 0 0 imm.19:16 1 0 0 1 dst CMPA #imm20,Rdst
imm.15:0
ADDA 0 0 0 0 imm.19:16 1 0 1 0 dst ADDA #imm20,Rdst
imm.15:0
SUBA 0 0 0 0 imm.19:16 1 0 1 1 dst SUBA #imm20,Rdst
imm.15:0
MOVA 0 0 0 0 src 1 1 0 0 dst MOVA Rsrc,Rdst
CMPA 0 0 0 0 src 1 1 0 1 dst CMPA Rsrc,Rdst
ADDA 0 0 0 0 src 1 1 1 0 dst ADDA Rsrc,Rdst
SUBA 0 0 0 0 src 1 1 1 1 dst SUBA Rsrc,Rdst
Instruction Instruction
Bit Loc. Inst. ID dst
Instruction Group Identifier
15 12 11 10 9 8 7 4 3 0
RRCM.A 0 0 0 0 n–1 0 0 0 1 0 0 dst RRCM.A #n,Rdst
RRAM.A 0 0 0 0 n–1 0 1 0 1 0 0 dst RRAM.A #n,Rdst
RLAM.A 0 0 0 0 n–1 1 0 0 1 0 0 dst RLAM.A #n,Rdst
RRUM.A 0 0 0 0 n–1 1 1 0 1 0 0 dst RRUM.A #n,Rdst
RRCM.W 0 0 0 0 n–1 0 0 0 1 0 1 dst RRCM.W #n,Rdst
RRAM.W 0 0 0 0 n–1 0 1 0 1 0 1 dst RRAM.W #n,Rdst
RLAM.W 0 0 0 0 n–1 1 0 0 1 0 1 dst RLAM.W #n,Rdst
RRUM.W 0 0 0 0 n–1 1 1 0 1 0 1 dst RRUM.W #n,Rdst
4.6.2.1 ADC
Example The 8-bit counter pointed to by R13 is added to a 16-bit counter pointed to by R12.
4.6.2.2 ADD
Example A table word pointed to by R5 (20-bit address in R5) is added to R6. The jump to label
TONI is performed on a carry.
Example A table byte pointed to by R5 (20-bit address) is added to R6. The jump to label TONI is
performed if no carry occurs. The table pointer is auto-incremented by 1. R6.19:8 = 0
4.6.2.3 ADDC
Example A table word pointed to by R5 (20-bit address) and the carry C are added to R6. The
jump to label TONI is performed on a carry. R6.19:16 = 0
Example A table byte pointed to by R5 (20-bit address) and the carry bit C are added to R6. The
jump to label TONI is performed if no carry occurs. The table pointer is auto-incremented
by 1. R6.19:8 = 0
4.6.2.4 AND
or shorter:
Example A table byte pointed to by R5 (20-bit address) is logically ANDed with R6. R5 is
incremented by 1 after the fetching of the byte. R6.19:8 = 0
4.6.2.5 BIC
Example A table word pointed to by R5 (20-bit address) is used to clear bits in R7. R7.19:16 = 0
Example A table byte pointed to by R5 (20-bit address) is used to clear bits in Port1.
4.6.2.6 BIS
Example A table word pointed to by R5 (20-bit address) is used to set bits in R7. R7.19:16 = 0
Example A table byte pointed to by R5 (20-bit address) is used to set bits in Port1. R5 is
incremented by 1 afterwards.
4.6.2.7 BIT
Example A table word pointed to by R5 (20-bit address) is used to test bits in R7. Jump to label
TONI if at least one bit is set. R7.19:16 are not affected.
Example A table byte pointed to by R5 (20-bit address) is used to test bits in output Port1. Jump
to label TONI if no bit is set. The next table byte is addressed.
4.6.2.9 CALL
Symbolic Mode: Call a subroutine at the 16-bit address contained in address EXEC.
EXEC is located at the address (PC + X) where X is within PC ± 32 K.
Absolute Mode: Call a subroutine at the 16-bit address contained in absolute address
EXEC in the lower 64 K.
Register mode: Call a subroutine at the 16-bit address contained in register R5.15:0.
Indirect Mode: Call a subroutine at the 16-bit address contained in the word pointed to by
register R5 (20-bit address).
4.6.2.10 CLR
CLR R5
4.6.2.11 CLRC
4.6.2.12 CLRN
CLRN
CALL SUBR
......
......
SUBR JN SUBRET ; If input is negative: do nothing and return
......
......
......
SUBRET RET
4.6.2.13 CLRZ
CLRZ
Indirect, Auto-Increment mode: Call a subroutine at the 16-bit address contained in the
word pointed to by register R5 (20-bit address) and increment the 16-bit address in R5
afterwards by 2. The next time the software uses R5 as a pointer, it can alter the
program execution due to access to the next word address in the table pointed to by R5.
Indexed mode: Call a subroutine at the 16-bit address contained in the 20-bit address
pointed to by register (R5 + X); for example, a table with addresses starting at X. The
address is within the lower 64KB. X is within ±32KB.
4.6.2.14 CMP
Example A table word pointed to by (R5 + 10) is compared with R7. Jump to label TONI if R7
contains a lower, signed 16-bit number. R7.19:16 is not cleared. The address of the
source operand is a 20-bit address in full memory range.
Example A table byte pointed to by R5 (20-bit address) is compared to the value in output Port1.
Jump to label TONI if values are equal. The next table byte is addressed.
4.6.2.15 DADC
Example The two-digit decimal number contained in R5 is added to a four-digit decimal number
pointed to by R8.
4.6.2.16 DADD
Example The eight-digit BCD number contained in 16-bit RAM addresses BCD and BCD+2 is
added decimally to an eight-digit BCD number contained in R4 and R5 (BCD+2 and R5
contain the MSDs). The carry C is added, and cleared.
Example The two-digit BCD number contained in word BCD (16-bit address) is added decimally to
a two-digit BCD number contained in R4. The carry C is added, also. R4.19:8 = 0
4.6.2.17 DEC
; Move a block of 255 bytes from memory location starting with EDE to
; memory location starting with TONI. Tables should not overlap: start of
; destination address TONI must not be within the range EDE to EDE+0FEh
MOV #EDE,R6
MOV #255,R10
L$1 MOV.B @R6+,TONI-EDE-1(R6)
DEC R10
JNZ L$1
Do not transfer tables using the routine above with the overlap shown in Figure 4-36.
EDE
TONI
EDE+254
TONI+254
4.6.2.18 DECD
; Move a block of 255 bytes from memory location starting with EDE to
; memory location starting with TONI.
; Tables should not overlap: start of destination address TONI must not
; be within the range EDE to EDE+0FEh
MOV #EDE,R6
MOV #255,R10
L$1 MOV.B @R6+,TONI-EDE-2(R6)
DECD R10
JNZ L$1
DECD.B STATUS
4.6.2.19 DINT
DINT ; All interrupt events using the GIE bit are disabled
NOP
MOV COUNTHI,R5 ; Copy counter
MOV COUNTLO,R6
EINT ; All interrupt events using the GIE bit are enabled
4.6.2.20 EINT
PUSH.B &P1IN
BIC.B @SP,&P1IFG ; Reset only accepted flags
EINT ; Preset port 1 interrupt flags stored on stack
; other interrupts are allowed
BIT #Mask,@SP
JEQ MaskOK ; Flags are present identically to mask: jump
......
MaskOK BIC #Mask,@SP
......
INCD SP ; Housekeeping: inverse to PUSH instruction
; at the start of interrupt subroutine. Corrects
; the stack pointer.
RETI
4.6.2.21 INC
INC.B STATUS
CMP.B #11,STATUS
JEQ OVFL
4.6.2.22 INCD
.......
PUSH R5 ; R5 is the result of a calculation, which is stored
; in the system stack
INCD SP ; Remove TOS by double-increment from stack
; Do not use INCD.B, SP is a word-aligned register
RET
4.6.2.23 INV
JC Jump if carry
JHS Jump if higher or same (unsigned)
Syntax JC label
JHS label
Operation If C = 1: PC + (2 × Offset) → PC
If C = 0: execute the following instruction
Description The carry bit C in the SR is tested. If it is set, the signed 10-bit word offset contained in
the instruction is multiplied by two, sign extended, and added to the 20-bit PC. This
means a jump in the range –511 to +512 words relative to the PC in the full memory
range. If C is reset, the instruction after the jump is executed.
JC is used for the test of the carry bit C.
JHS is used for the comparison of unsigned numbers.
Status Bits Status bits are not affected
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example The state of the port 1 pin P1IN.1 bit defines the program flow.
4.6.2.25 JEQ, JZ
Example R7 (20-bit counter) is incremented. If its content is zero, the program continues at
Label4.
4.6.2.26 JGE
Example If the content of R6 is greater than or equal to the memory pointed to by R7, the program
continues a Label5. Signed data. Data and program in full memory range.
Example If R5 ≥ 12345h (signed operands), the program continues at Label2. Program in full
memory range.
4.6.2.27 JL
Example If the signed content of R6 is less than the memory pointed to by R7 (20-bit address), the
program continues at Label5. Data and program in full memory range.
Example If R5 < 12345h (signed operands), the program continues at Label2. Data and program
in full memory range.
4.6.2.28 JMP
Example The interrupt vector TAIV of Timer_A3 is read and used for the program flow. Program in
full memory range, but interrupt handlers always starts in lower 64 K.
4.6.2.29 JN
JN Jump if negative
Syntax JN label
Operation If N = 1: PC + (2 × Offset) → PC
If N = 0: execute following instruction
Description The negative bit N in the SR is tested. If it is set, the signed 10-bit word offset contained
in the instruction is multiplied by two, sign extended, and added to the 20-bit program
PC. This means a jump in the range -511 to +512 words relative to the PC in the full
memory range. If N is reset, the instruction after the jump is executed.
Status Bits Status bits are not affected.
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example The byte COUNT is tested. If it is negative, program execution continues at Label0. Data
in lower 64 K, program in full memory range.
Example R6 is subtracted from R5. If the result is negative, program continues at Label2. Program
in full memory range.
Example R7 (20-bit counter) is decremented. If its content is below zero, the program continues at
Label4. Program in full memory range.
Example The word TONI is added to R5. If no carry occurs, continue at Label0. The address of
TONI is within PC ± 32 K.
Example If word EDE ≠ 1500, the program continues at Label2. Data in lower 64 K, program in full
memory range.
Example R7 (20-bit counter) is decremented. If its content is not zero, the program continues at
Label4. Program in full memory range.
4.6.2.32 MOV
Example The contents of table EDE (word data, 16-bit addresses) are copied to table TOM. The
length of the tables is 030h words. Both tables reside in the lower 64 K.
Example The contents of table EDE (byte data, 16-bit addresses) are copied to table TOM. The
length of the tables is 020h bytes. Both tables may reside in full memory range, but must
be within R10 ± 32 K.
4.6.2.33 NOP
* NOP No operation
Syntax NOP
Operation None
Emulation MOV #0, R3
Description No operation is performed. The instruction may be used for the elimination of instructions
during the software check or for defined waiting times.
Status Bits Status bits are not affected.
4.6.2.34 POP
POP R7 ; Restore R7
POP SR ; Restore status register
Example The contents of RAM byte LEO is restored from the stack.
Example The contents of the memory pointed to by R7 and the SR are restored from the stack.
4.6.2.35 PUSH
Example Save the two bytes EDE and TONI on the stack. The addresses EDE and TONI are
within PC ± 32 K.
4.6.2.36 RET
Item n SP Item n
SP PCReturn
4.6.2.37 RETI
4.6.2.38 RLA
C 0
Byte 7 0
An overflow occurs if dst ≥ 040h and dst < 0C0h before the operation is performed; the
result has changed sign.
Status Bits N: Set if result is negative, reset if positive
Z: Set if result is zero, reset otherwise
C: Loaded from the MSB
V: Set if an arithmetic overflow occurs; the initial value is 04000h ≤ dst < 0C000h,
reset otherwise
Set if an arithmetic overflow occurs; the initial value is 040h ≤ dst < 0C0h, reset
otherwise
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example R7 is multiplied by 2.
4.6.2.39 RLC
Byte 7 0
Example The input P1IN.1 information is shifted into the LSB of R5.
4.6.2.40 RRA
Example The signed RAM byte EDE is shifted arithmetically right one position.
19 15 7 0
C 0 0 0 0 0 0 0 0 0 0 0 0 MSB LSB
19 15 0
C 0 0 0 0 MSB LSB
4.6.2.41 RRC
19 15 7 0
C 0 0 0 0 0 0 0 0 0 0 0 0 MSB LSB
19 15 0
C 0 0 0 0 MSB LSB
4.6.2.42 SBC
Example The 8-bit counter pointed to by R13 is subtracted from a 16-bit counter pointed to by
R12.
4.6.2.43 SETC
4.6.2.44 SETN
4.6.2.45 SETZ
4.6.2.46 SUB
Example A table word pointed to by R5 (20-bit address) is subtracted from R7. Afterwards, if R7
contains zero, jump to label TONI. R5 is then auto-incremented by 2. R7.19:16 = 0.
Example Byte CNT is subtracted from byte R12 points to. The address of CNT is within PC ± 32K.
The address R12 points to is in full memory range.
4.6.2.47 SUBC
Example A 48-bit number (3 words) pointed to by R5 (20-bit address) is subtracted from a 48-bit
counter in RAM, pointed to by R7. R5 points to the next 48-bit number afterwards. The
address R7 points to is in full memory range.
Example Byte CNT is subtracted from the byte, R12 points to. The carry of the previous instruction
is used. The address of CNT is in lower 64 K.
4.6.2.48 SWPB
Before SWPB
15 8 7 0
After SWPB
15 8 7 0
Before SWPB
19 16 15 8 7 0
After SWPB
19 16 15 8 7 0
4.6.2.49 SXT
Example The signed 8-bit data in EDE (PC +32 K) is sign extended and added to the 20-bit data
in R7.
4.6.2.50 TST
TST R7 ; Test R7
JN R7NEG ; R7 is negative
JZ R7ZERO ; R7 is zero
R7POS ...... ; R7 is positive but not zero
R7NEG ...... ; R7 is negative
R7ZERO ...... ; R7 is zero
Example The low byte of R7 is tested. If it is negative, continue at R7NEG; if it is positive but not
zero, continue at R7POS.
4.6.2.51 XOR
Example A table word pointed to by R5 (20-bit address) is used to toggle bits in R6. R6.19:16 = 0.
Example Reset to zero those bits in the low byte of R7 that are different from the bits in byte EDE.
R7.19:8 = 0. The address of EDE is within PC ± 32 K.
4.6.3.1 ADCX
4.6.3.2 ADDX
Example A table word (16-bit) pointed to by R5 (20-bit address) is added to R6. The jump to label
TONI is performed on a carry.
Example A table byte pointed to by R5 (20-bit address) is added to R6. The jump to label TONI is
performed if no carry occurs. The table pointer is auto-incremented by 1.
Note: Use ADDA for the following two cases for better code density and execution.
ADDX.A Rsrc,Rdst
ADDX.A #imm20,Rdst
4.6.3.3 ADDCX
Example A table word pointed to by R5 (20-bit address) and the carry C are added to R6. The
jump to label TONI is performed on a carry.
Example A table byte pointed to by R5 (20-bit address) and the carry bit C are added to R6. The
jump to label TONI is performed if no carry occurs. The table pointer is auto-incremented
by 1.
4.6.3.4 ANDX
or shorter:
Example A table byte pointed to by R5 (20-bit address) is logically ANDed with R6. R6.19:8 = 0.
The table pointer is auto-incremented by 1.
4.6.3.5 BICX
Example A table word pointed to by R5 (20-bit address) is used to clear bits in R7. R7.19:16 = 0.
Example A table byte pointed to by R5 (20-bit address) is used to clear bits in output Port1.
4.6.3.6 BISX
Example A table word pointed to by R5 (20-bit address) is used to set bits in R7.
Example A table byte pointed to by R5 (20-bit address) is used to set bits in output Port1.
4.6.3.7 BITX
Example A table word pointed to by R5 (20-bit address) is used to test bits in R7. Jump to label
TONI if at least one bit is set.
Example A table byte pointed to by R5 (20-bit address) is used to test bits in input Port1. Jump to
label TONI if no bit is set. The next table byte is addressed.
4.6.3.8 CLRX
4.6.3.9 CMPX
Example A table word pointed to by R5 (20-bit address) is compared with R7. Jump to label TONI
if R7 contains a lower, signed, 16-bit number.
Example A table byte pointed to by R5 (20-bit address) is compared to the input in I/O Port1.
Jump to label TONI if the values are equal. The next table byte is addressed.
Note: Use CMPA for the following two cases for better density and execution.
CMPA Rsrc,Rdst
CMPA #imm20,Rdst
4.6.3.10 DADCX
4.6.3.11 DADDX
Example The eight-digit BCD number contained in 20-bit addresses BCD and BCD+2 is added
decimally to an eight-digit BCD number contained in R4 and R5 (BCD+2 and R5 contain
the MSDs).
Example The two-digit BCD number contained in 20-bit address BCD is added decimally to a two-
digit BCD number contained in R4.
4.6.3.12 DECX
4.6.3.13 DECDX
4.6.3.14 INCX
4.6.3.15 INCDX
4.6.3.16 INVX
INVX.A R5 ; Invert R5
INCX.A R5 ; R5 is now negated
4.6.3.17 MOVX
Example The contents of table EDE (word data, 20-bit addresses) are copied to table TOM. The
length of the table is 030h words.
Example The contents of table EDE (byte data, 20-bit addresses) are copied to table TOM. The
length of the table is 020h bytes.
Ten of the 28 possible addressing combinations of the MOVX.A instruction can use the
MOVA instruction. This saves two bytes and code cycles. Examples for the addressing
combinations are:
The next four replacements are possible only if 16-bit indexes are sufficient for the
addressing:
4.6.3.18 POPM
Example Restore the 16-bit registers R9, R10, R11, R12, R13 from the stack.
4.6.3.19 PUSHM
Example Save the five 16-bit registers R9, R10, R11, R12, R13 on the stack
4.6.3.20 POPX
4.6.3.21 PUSHX
4.6.3.22 RLAM
RLAM.A #3,R5 ; R5 = R5 x 8
19 16 15 0
19 0
C MSB LSB 0
4.6.3.23 RLAX
C MSB LSB 0
4.6.3.24 RLCX
Example The RAM byte LEO is shifted left one position. PC is pointing to upper memory.
C MSB LSB
4.6.3.25 RRAM
Example The signed 20-bit value in R15 is multiplied by 0.75. (0.5 + 0.25) × R15.
19 16 15 0
19 0
C MSB LSB
4.6.3.26 RRAX
RPT #4
RRAX.A R5 ; R5/16 -> R5
19 8 7 0
C 0 0 MSB LSB
19 16 15 0
19 0
C MSB LSB
7 0
C MSB LSB
15 0
C MSB LSB
31 20
0 0
19 0
C MSB LSB
4.6.3.27 RRCM
RRCM.A Rotate right through carry the 20-bit CPU register content
RRCM.[W] Rotate right through carry the 16-bit CPU register content
Syntax RRCM.A #n,Rdst 1≤n≤4
RRCM.W #n,Rdst or RRCM #n,Rdst 1≤n≤4
Operation C → MSB → MSB–1 ... LSB+1 → LSB → C
Description The destination operand is shifted right by one, two, three, or four bit positions as
shown in Figure 4-50. The carry bit C is shifted into the MSB, the LSB is shifted into the
carry bit. The word instruction RRCM.W clears the bits Rdst.19:16.
Note : This instruction does not use the extension word.
Status Bits N: Set if result is negative
.A: Rdst.19 = 1, reset if Rdst.19 = 0
.W: Rdst.15 = 1, reset if Rdst.15 = 0
Z: Set if result is zero, reset otherwise
C: Loaded from the LSB (n = 1), LSB+1 (n = 2), LSB+2 (n = 3), or LSB+3 (n = 4)
V: Reset
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example The address-word in R5 is shifted right by three positions. The MSB–2 is loaded with 1.
Example The word in R6 is shifted right by two positions. The MSB is loaded with the LSB. The
MSB–1 is loaded with the contents of the carry flag.
19 16 15 0
C 0 MSB LSB
19 0
C MSB LSB
4.6.3.28 RRCX
RPT #12
RRCX.W R6 ; R6 = R6 » 12. R6.19:16 = 0
19 8 7 0
19 16 15 0
C 0 0 0 0 MSB LSB
19 0
C MSB LSB
7 0
C MSB LSB
15 0
C MSB LSB
31 20
0 0
19 0
C MSB LSB
4.6.3.29 RRUM
RRUM.A Rotate right through carry the 20-bit CPU register content
RRUM.[W] Rotate right through carry the 16-bit CPU register content
Syntax RRUM.A #n,Rdst 1≤n≤4
RRUM.W #n,Rdst or RRUM #n,Rdst 1≤n≤4
Operation 0 → MSB → MSB–1 ... LSB+1 → LSB → C
Description The destination operand is shifted right by one, two, three, or four bit positions as
shown in Figure 4-53. Zero is shifted into the MSB, the LSB is shifted into the carry bit.
RRUM works like an unsigned division by 2, 4, 8, or 16. The word instruction RRUM.W
clears the bits Rdst.19:16.
Note : This instruction does not use the extension word.
Status Bits N: Set if result is negative
.A: Rdst.19 = 1, reset if Rdst.19 = 0
.W: Rdst.15 = 1, reset if Rdst.15 = 0
Z: Set if result is zero, reset otherwise
C: Loaded from the LSB (n = 1), LSB+1 (n = 2), LSB+2 (n = 3), or LSB+3 (n = 4)
V: Reset
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example The unsigned address-word in R5 is divided by 16.
Example The word in R6 is shifted right by one bit. The MSB R6.15 is loaded with 0.
19 16 15 0
19 0
C 0 MSB LSB
4.6.3.30 RRUX
RPT #12
RRUX.W R6 ; R6 = R6 » 12. R6.19:16 = 0
19 8 7 0
0
19 16 15 0
C 0 0 0 0 MSB LSB
19 0
C 0 MSB LSB
4.6.3.31 SBCX
4.6.3.32 SUBX
Example A table word pointed to by R5 (20-bit address) is subtracted from R7. Jump to label
TONI if R7 contains zero after the instruction. R5 is auto-incremented by two. R7.19:16 =
0.
Example Byte CNT is subtracted from the byte R12 points to in the full address space. Address of
CNT is within PC ± 512 K.
Note: Use SUBA for the following two cases for better density and execution.
SUBX.A Rsrc,Rdst
SUBX.A #imm20,Rdst
4.6.3.33 SUBCX
Example A 48-bit number (3 words) pointed to by R5 (20-bit address) is subtracted from a 48-bit
counter in RAM, pointed to by R7. R5 auto-increments to point to the next 48-bit number.
Example Byte CNT is subtracted from the byte R12 points to. The carry of the previous instruction
is used. 20-bit addresses.
4.6.3.34 SWPBX
Before SWPBX.A
19 16 15 8 7 0
After SWPBX.A
19 16 15 8 7 0
Before SWPBX.A
31 20 19 16 15 8 7 0
After SWPBX.A
31 20 19 16 15 8 7 0
Before SWPBX
19 16 15 8 7 0
After SWPBX
19 16 15 8 7 0
Before SWPBX
15 8 7 0
After SWPBX
15 8 7 0
4.6.3.35 SXTX
SXTX.A Rdst
19 16 15 8 7 6 0
SXTX.A dst
31 20 19 16 15 8 7 6 0
0 ...... 0 S
SXTX[.W] Rdst
19 16 15 8 7 6 0
SXTX[.W] dst
15 8 7 6 0
4.6.3.36 TSTX
4.6.3.37 XORX
Example A table word pointed to by R5 (20-bit address) is used to toggle bits in R6.
Example Reset to zero those bits in the low byte of R7 that are different from the bits in byte EDE
(20-bit address)
4.6.4.1 ADDA
4.6.4.2 BRA
Symbolic mode: Branch to the 20-bit address contained in addresses EXEC (LSBs) and
EXEC+2 (MSBs). EXEC is located at the address (PC + X) where X is within +32 K.
Indirect addressing.
Note: If the 16-bit index is not sufficient, a 20-bit index may be used with the following
instruction.
Absolute mode: Branch to the 20-bit address contained in absolute addresses EXEC
(LSBs) and EXEC+2 (MSBs). Indirect addressing.
Register mode: Branch to the 20-bit address contained in register R5. Indirect R5.
Indirect mode: Branch to the 20-bit address contained in the word pointed to by register
R5 (LSBs). The MSBs have the address (R5 + 2). Indirect, indirect R5.
Indirect, Auto-Increment mode: Branch to the 20-bit address contained in the words
pointed to by register R5 and increment the address in R5 afterwards by 4. The next
time the software flow uses R5 as a pointer, it can alter the program execution due to
access to the next address in the table pointed to by R5. Indirect, indirect R5.
Indexed mode: Branch to the 20-bit address contained in the address pointed to by
register (R5 + X) (for example, a table with addresses starting at X). (R5 + X) points to
the LSBs, (R5 + X + 2) points to the MSBs of the address. X is within R5 + 32 K.
Indirect, indirect (R5 + X).
Note: If the 16-bit index is not sufficient, a 20-bit index X may be used with the following
instruction:
4.6.4.3 CALLA
Symbolic mode: Call a subroutine at the 20-bit address contained in addresses EXEC
(LSBs) and EXEC+2 (MSBs). EXEC is located at the address (PC + X) where X is
within +32 K. Indirect addressing.
Absolute mode: Call a subroutine at the 20-bit address contained in absolute addresses
EXEC (LSBs) and EXEC+2 (MSBs). Indirect addressing.
Register mode: Call a subroutine at the 20-bit address contained in register R5. Indirect
R5.
Indirect mode: Call a subroutine at the 20-bit address contained in the word pointed to
by register R5 (LSBs). The MSBs have the address (R5 + 2). Indirect, indirect R5.
Indirect, Auto-Increment mode: Call a subroutine at the 20-bit address contained in the
words pointed to by register R5 and increment the 20-bit address in R5 afterwards by 4.
The next time the software flow uses R5 as a pointer, it can alter the program execution
due to access to the next word address in the table pointed to by R5. Indirect, indirect
R5.
Indexed mode: Call a subroutine at the 20-bit address contained in the address pointed
to by register (R5 + X); for example, a table with addresses starting at X. (R5 + X)
points to the LSBs, (R5 + X + 2) points to the MSBs of the word address. X is within R5
+ 32 K. Indirect, indirect (R5 + X).
4.6.4.4 CLRA
4.6.4.5 CMPA
Example The 20-bit values in R5 and R6 are compared. If R5 is greater than (signed) or equal to
R6, the program continues at label GRE.
4.6.4.6 DECDA
4.6.4.7 INCDA
4.6.4.8 MOVA
Copy 20-bit value addressed by (R9 + 100h) to R8. Source operand in addresses (R9 +
100h) LSBs and (R9 + 102h) MSBs.
Move 20-bit value in 20-bit absolute addresses EDE (LSBs) and EDE+2 (MSBs) to R12
Move 20-bit value in 20-bit addresses EDE (LSBs) and EDE+2 (MSBs) to R12. PC
index ± 32 K.
Copy 20-bit value R9 points to (20 bit address) to R8. Source operand in addresses
@R9 LSBs and @(R9 + 2) MSBs.
Copy 20-bit value R9 points to (20 bit address) to R8. R9 is incremented by four
afterwards. Source operand in addresses @R9 LSBs and @(R9 + 2) MSBs.
Move 20-bit value in R13 to 20-bit absolute addresses EDE (LSBs) and EDE+2 (MSBs)
Move 20-bit value in R13 to 20-bit addresses EDE (LSBs) and EDE+2 (MSBs). PC
index ± 32 K.
4.6.4.9 RETA
4.6.4.10 SUBA
4.6.4.11 TSTA
TSTA R7 ; Test R7
JN R7NEG ; R7 is negative
JZ R7ZERO ; R7 is zero
R7POS ...... ; R7 is positive but not zero
R7NEG ...... ; R7 is negative
R7ZERO ...... ; R7 is zero
SLAU445G – October 2014 – Revised August 2016 FRAM Controller (FRCTL) 293
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
FRAM Introduction www.ti.com
Control
Registers
MAB
FRAM
Controller
FRAM
Memory
Array
MDB
Cache
294 FRAM Controller (FRCTL) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Programming FRAM Devices
SLAU445G – October 2014 – Revised August 2016 FRAM Controller (FRCTL) 295
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Wait State Control www.ti.com
296 FRAM Controller (FRCTL) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com FRAM Cache
PUC
FRPWR = 1
FRPWR = 0
LPM entry
LPM entry
LPM0
FRAM_POWER = FRPWR
LPM1/2/3/4
FRAM_POWER = off
SLAU445G – October 2014 – Revised August 2016 FRAM Controller (FRCTL) 297
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
FRCTL Registers www.ti.com
NOTE: All registers have word or byte register access. For a generic registerANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
298 FRAM Controller (FRCTL) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com FRCTL Registers
SLAU445G – October 2014 – Revised August 2016 FRAM Controller (FRCTL) 299
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
FRCTL Registers www.ti.com
300 FRAM Controller (FRCTL) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com FRCTL Registers
SLAU445G – October 2014 – Revised August 2016 FRAM Controller (FRCTL) 301
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 6
SLAU445G – October 2014 – Revised August 2016
The Backup Memory provides up to 256 bytes that are retained during LPM3.5. The size of the Backup
Memory varies by device–see the device-specific data sheet for details. This chapter describes the
Backup Memory functionality and features.
302 Backup Memory (BAKMEM) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Backup Memory Introduction
SLAU445G – October 2014 – Revised August 2016 Backup Memory (BAKMEM) 303
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 7
SLAU445G – October 2014 – Revised August 2016
Digital I/O
This chapter describes the operation of the digital I/O ports in all devices.
Table 7-3. I/O Function Selection for Devices With Two Selection Bits – PxSEL0
and PxSEL1
PxSEL1 PxSEL0 I/O Function
0 0 General purpose I/O is selected
0 1 Primary module function is selected
1 0 Secondary module function is selected
1 1 Tertiary module function is selected
Setting the PxSEL1 or PxSEL0 bits to a module function does not automatically set the pin direction.
Other peripheral module functions may require the PxDIR bits to be configured according to the direction
needed for the module function. See the pin schematics in the device-specific data sheet.
When a port pin is selected as an input to peripheral modules, the input signal to those peripheral
modules is a latched representation of the signal at the device pin. While PxSEL1 and PxSEL0 is other
than 00, the internal input signal follows the signal at the pin for all connected modules. However, if
PxSEL1 and PxSEL0 = 00, the input to the peripherals maintain the value of the input signal at the device
pin before the PxSEL1 and PxSEL0 bits were reset.
Because the PxSEL1 and PxSEL0 bits do not reside in contiguous addresses, changing both bits at the
same time is not possible. For example, an application might need to change P1.0 from general purpose
I/O to the tertiary module function residing on P1.0. Initially, P1SEL1 = 00h and P1SEL0 = 00h. To change
the function, it would be necessary to write both P1SEL1 = 01h and P1SEL0 = 01h. This is not possible
without first passing through an intermediate configuration, and this configuration may not be desirable
from an application standpoint. The PxSELC complement register can be used to handle such situations.
The PxSELC register always reads 0. Each set bit of the PxSELC register complements the
corresponding respective bit of the PxSEL1 and PxSEL0 registers. In the example, with P1SEL1 = 00h
and P1SEL0 = 00h initially, writing P1SELC = 01h causes P1SEL1 = 01h and P1SEL0 = 01h to be written
simultaneously.
All Px interrupt flags are prioritized, with PxIFG.0 being the highest, and combined to source a single
interrupt vector. The highest priority enabled interrupt generates a number in the PxIV register. This
number can be evaluated or added to the program counter to automatically enter the appropriate software
routine. Disabled Px interrupts do not affect the PxIV value. The PxIV registers are word or byte access.
Each PxIFG bit is the interrupt flag for its corresponding I/O pin, and the flag is set when the selected
input signal edge occurs at the pin. All PxIFG interrupt flags request an interrupt when their corresponding
PxIE bit and the GIE bit are set. Software can also set each PxIFG flag, providing a way to generate a
software-initiated interrupt.
• Bit = 0: No interrupt is pending
• Bit = 1: An interrupt is pending
Only transitions, not static levels, cause interrupts. If any PxIFG flag becomes set during a Px interrupt
service routine or is set after the RETI instruction of a Px interrupt service routine is executed, the set
PxIFG flag generates another interrupt. This ensures that each transition is acknowledged.
Any access (read or write) of the lower byte of the PxIV register, either word or byte access, automatically
resets the highest pending interrupt flag. If another interrupt flag is set, another interrupt is immediately
generated after servicing the initial interrupt.
For example, assume that P1IFG.0 has the highest priority. If the P1IFG.0 and P1IFG.2 flags are set when
the interrupt service routine accesses the P1IV register, P1IFG.0 is reset automatically. After the RETI
instruction of the interrupt service routine is executed, the P1IFG.2 generates another interrupt.
Note that the same I/O initialization procedure can be used for all reset cases and wakeup from LPMx.5,
except for PxIFG:
NOTE: See Section 1.4.3, Low-Power Modes LPM3.5 and LPM4.5 (LPMx.5), in the System Resets,
Interrupts, and Operating Modes, System Control Module (SYS) chapter for details about
LPMx.5 low-power modes.
See the device-specific data sheet to determine which LPMx.5 low-power modes are
available and which modules can operate in LPM3.5, if any.
With regard to the digital I/Os, the following description is applicable to both LPM3.5 and
LPM4.5.
Upon entering LPMx.5 (LPM3.5 or LPM4.5), the LDO of the PMM module is disabled, which removes the
supply voltage from the core of the device. This causes all I/O register configurations to be lost, thus the
configuration of I/O pins must be handled differently to make sure that all pins in the application behave in
a controlled manner upon entering and exiting LPMx.5. Properly setting the I/O pins is critical to achieve
the lowest possible power consumption in LPMx.5 and to prevent an uncontrolled input or output I/O state
in the application. The application has complete control of the I/O pin conditions that are necessary to
prevent unwanted spurious activity upon entry and exit from LPMx.5.
Before entering LPMx.5, the following operations are required for the I/Os:
(a) Set all I/Os to general-purpose I/Os (PxSEL0 = 000h and PxSEL1 = 000h) and configure as needed.
Each I/O can be set to input high impedance, input with pulldown, input with pullup, output high, or
output low. It is critical that no inputs are left floating in the application; otherwise, excess current may
be drawn in LPMx.5.
Configuring the I/O in this manner makes sure that each pin is in a safe condition before entering
LPMx.5.
(b) Optionally, configure input interrupt pins for wake-up from LPMx.5. To wake the device from LPMx.5, a
general-purpose I/O port must contain an input port with interrupt and wakeup capability. Not all inputs
with interrupt capability offer wakeup from LPMx.5. See the device-specific data sheet for availability.
To wake up the device, a port pin must be configured properly before entering LPMx.5. Each port
should be configured as general-purpose input. Pulldowns or pullups can be applied if required. Setting
the PxIES bit of the corresponding register determines the edge transition that wakes the device. Last,
the PxIE for the port must be enabled, as well as the general interrupt enable.
NOTE: It is not possible to wake up from a port interrupt if its respective port interrupt flag is already
asserted. TI recommends clearing the flags before entering LPMx.5. TI also recommends
setting GIE = 1 before entry into LPMx.5. This allows any pending flags to be serviced before
LPMx.5 entry.
This completes the operations required for the I/Os before entering LPMx.5.
During LPMx.5 the I/O pin states are held and locked based on the settings before LPMx.5 entry. Note
that only the pin conditions are retained. All other port configuration register settings such as PxDIR,
PxREN, PxOUT, PxIES, and PxIE contents are lost.
Upon exit from LPMx.5, all peripheral registers are set to their default conditions but the I/O pins remain
locked while LOCKLPM5 remains set. Keeping the I/O pins locked ensures that all pin conditions remain
stable when entering the active mode, regardless of the default I/O register settings.
When back in active mode, the I/O configuration and I/O interrupt configuration such as PxDIR, PxREN,
PxOUT, and PxIES should be restored to the values before entering LPMx.5. The LOCKLPM5 bit can
then be cleared, which releases the I/O pin conditions and I/O interrupt configuration. Any changes to the
port configuration registers while LOCKLPM5 is set have no effect on the I/O pins.
After enabling the I/O interrupts by configuring PxIE, the I/O interrupt that caused the wakeup can be
serviced as indicated by the PxIFG flags. These flags can be used directly, or the corresponding PxIV
register may be used. Note that the PxIFG flag cannot be cleared until the LOCKLPM5 bit has been
cleared.
NOTE: It is possible that multiple events occurred on various ports. In these cases, multiple PxIFG
flags are set, and it cannot be determined which port caused the I/O wakeup.
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
00h P1IN Port 1 Input Read only Byte undefined Section 7.4.5
or PAIN_L
02h P1OUT Port 1 Output Read/write Byte undefined Section 7.4.6
or PAOUT_L
04h P1DIR Port 1 Direction Read/write Byte 00h Section 7.4.7
or PADIR_L
06h P1REN Port 1 Resistor Enable Read/write Byte 00h Section 7.4.8
or PAREN_L
0Ah P1SEL0 Port 1 Select 0 Read/write Byte 00h Section 7.4.9
or PASEL0_L
0Ch P1SEL1 Port 1 Select 1 Read/write Byte 00h Section 7.4.10
or PASEL1_L
16h P1SELC Port 1 Complement Selection Read/write Byte 00h Section 7.4.11
or PASELC_L
18h P1IES Port 1 Interrupt Edge Select Read/write Byte undefined Section 7.4.12
or PAIES_L
1Ah P1IE Port 1 Interrupt Enable Read/write Byte 00h Section 7.4.13
or PAIE_L
1Ch P1IFG Port 1 Interrupt Flag Read/write Byte 00h Section 7.4.14
or PAIFG_L
00h P3IN Port 3 Input Read only Byte undefined Section 7.4.5
or PBIN_L
02h P3OUT Port 3 Output Read/write Byte undefined Section 7.4.6
or PBOUT_L
04h P3DIR Port 3 Direction Read/write Byte 00h Section 7.4.7
or PBDIR_L
06h P3REN Port 3 Resistor Enable Read/write Byte 00h Section 7.4.8
or PBREN_L
0Ah P3SEL0 Port 3 Select 0 Read/write Byte 00h Section 7.4.9
or PBSEL0_L
0Ch P3SEL1 Port 3 Select 1 Read/write Byte 00h Section 7.4.10
or PBSEL1_L
16h P3SELC Port 3 Complement Selection Read/write Byte 00h Section 7.4.11
or PBSELC_L
18h P3IES Port 3 Interrupt Edge Select Read/write Byte undefined Section 7.4.12
or PBIES_L
1Ah P3IE Port 3 Interrupt Enable Read/write Byte 00h Section 7.4.13
or PBIE_L
1Ch P3IFG Port 3 Interrupt Flag Read/write Byte 00h Section 7.4.14
or PBIFG_L
00h P5IN Port 5 Input Read only Byte undefined Section 7.4.5
or PCIN_L
02h P5OUT Port 5 Output Read/write Byte undefined Section 7.4.6
or PCOUT_L
04h P5DIR Port 5 Direction Read/write Byte 00h Section 7.4.7
or PCDIR_L
06h P5REN Port 5 Resistor Enable Read/write Byte 00h Section 7.4.8
or PCREN_L
0Ah P5SEL0 Port 5 Select 0 Read/write Byte 00h Section 7.4.9
or PCSEL0_L
0Ch P5SEL1 Port 5 Select 1 Read/write Byte 00h Section 7.4.10
or PCSEL1_L
16h P5SELC Port 5 Complement Selection Read/write Byte 00h Section 7.4.11
or PCSELC_L
18h P5IES Port 5 Interrupt Edge Select Read/write Byte undefined Section 7.4.12
or PCIES_L
1Ah P5IE Port 5 Interrupt Enable Read/write Byte 00h Section 7.4.13
or PCIE_L
1Ch P5IFG Port 5 Interrupt Flag Read/write Byte 00h Section 7.4.14
or PCIFG_L
00h P7IN Port 7 Input Read only Byte undefined Section 7.4.5
or PDIN_L
02h P7OUT Port 7 Output Read/write Byte undefined Section 7.4.6
or PDOUT_L
04h P7DIR Port 7 Direction Read/write Byte 00h Section 7.4.7
or PDDIR_L
06h P7REN Port 7 Resistor Enable Read/write Byte 00h Section 7.4.8
or PDREN_L
0Ah P7SEL0 Port 7 Select 0 Read/write Byte 00h Section 7.4.9
or PDSEL0_L
0Ch P7SEL1 Port 7 Select 1 Read/write Byte 00h Section 7.4.10
or PDSEL1_L
16h P7SELC Port 7 Complement Selection Read/write Byte 00h Section 7.4.11
or PDSELC_L
18h P7IES Port 7 Interrupt Edge Select Read/write Byte undefined Section 7.4.12
or PDIES_L
1Ah P7IE Port 7 Interrupt Enable Read/write Byte 00h Section 7.4.13
or PDIE_L
1Ch P7IFG Port 7 Interrupt Flag Read/write Byte 00h Section 7.4.14
or PDIFG_L
00h P9IN Port 9 Input Read only Byte undefined Section 7.4.5
or PEIN_L
02h P9OUT Port 9 Output Read/write Byte undefined Section 7.4.6
or PEOUT_L
04h P9DIR Port 9 Direction Read/write Byte 00h Section 7.4.7
or PEDIR_L
06h P9REN Port 9 Resistor Enable Read/write Byte 00h Section 7.4.8
or PEREN_L
0Ah P9SEL0 Port 9 Select 0 Read/write Byte 00h Section 7.4.9
or PESEL0_L
0Ch P9SEL1 Port 9 Select 1 Read/write Byte 00h Section 7.4.10
or PESEL1_L
16h P9SELC Port 9 Complement Selection Read/write Byte 00h Section 7.4.11
or PESELC_L
18h P9IES Port 9 Interrupt Edge Select Read/write Byte undefined Section 7.4.12
or PEIES_L
1Ah P9IE Port 9 Interrupt Enable Read/write Byte 00h Section 7.4.13
or PEIE_L
1Ch P9IFG Port 9 Interrupt Flag Read/write Byte 00h Section 7.4.14
or PEIFG_L
00h P11IN Port 11 Input Read only Byte undefined Section 7.4.5
or PFIN_L
02h P11OUT Port 11 Output Read/write Byte undefined Section 7.4.6
or PFOUT_L
04h P11DIR Port 11 Direction Read/write Byte 00h Section 7.4.7
or PFDIR_L
06h P11REN Port 11 Resistor Enable Read/write Byte 00h Section 7.4.8
or PFREN_L
0Ah P11SEL0 Port 11 Select 0 Read/write Byte 00h Section 7.4.9
or PFSEL0_L
0Ch P11SEL1 Port 11 Select 1 Read/write Byte 00h Section 7.4.10
or PFSEL1_L
16h P11SELC Port 11 Complement Selection Read/write Byte 00h Section 7.4.11
or PFSELC_L
18h P11IES Port 11 Interrupt Edge Select Read/write Byte undefined Section 7.4.12
or PFIES_L
1Ah P11IE Port 11 Interrupt Enable Read/write Byte 00h Section 7.4.13
or PFIE_L
1Ch P11IFG Port 11 Interrupt Flag Read/write Byte 00h Section 7.4.14
or PFIFG_L
This chapter describes the functionality of the Capacitive Touch I/Os and related control.
SLAU445G – October 2014 – Revised August 2016 Capacitive Touch I/O 331
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Capacitive Touch I/O Introduction www.ti.com
DVSS 0
DVCC 1 1
Direction Control
PxOUT.y 0
Output Signal
Px.y
Cap.
Input Signal Q D
EN
332 Capacitive Touch I/O SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Capacitive Touch I/O Operation
Figure 8-2 shows the block diagram of the Capacitive Touch I/O module.
CAPTIOEN
EN
CAPTIOPOSELx One-
4 To Capacitive Touch
Hot enable of pins
CAPTIOPISELx 7 Dec.
3
CAPTIO
SLAU445G – October 2014 – Revised August 2016 Capacitive Touch I/O 333
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
CapTouch Registers www.ti.com
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
334 Capacitive Touch I/O SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com CapTouch Registers
SLAU445G – October 2014 – Revised August 2016 Capacitive Touch I/O 335
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 9
SLAU445G – October 2014 – Revised August 2016
CapTIvate™ Module
This chapter introduces the CapTIvate module. For additional documentation, examples, and other
information, see the CapTIvate Technology Guide.
9.2.1 Declarations
The following declarations, or terms, are used to describe parts of the CapTIvate module:
CapTIvate module
CapTIvate block
CapTIvate
CAP0.0
CAP0.1
CAP0
CAP0.2
CAP0.3
CAP1.0
CAP1.1 CapTIvate channel
CAP1
CAP1.2
Digital CAP1.3
and
Analog
CAP2.0
CAP2.1
CAP2
CAP2.2
CAP2.3
CAP3.0
CAP3.1
CAP3
CAP3.2
CAP3.3
CapTIvate core
NOTE: This figure shows the implementation in the MSP430FR26xx devices.
Figure 9-1. CapTIvate Declarations
9.2.2 Terms
The following is a list of abbreviations and application-specific terms.
CT Charge transfer
CAPx.y CapTIvate channel, x = 0 to 11, y = 0 to 7
CRx CapTIvate channel configured as receive input (x = 0 to 15 in FR26xx )
CTx CapTIvate channel configured as transmit output (x = 0 to 15 in FR26xx )
Vdd Voltage supply to the device
Vreg Regulated voltage supply
CS capacitor A capacitor used to accumulate charge from an unknown capacitor (CX), usually the
antenna or touch pad. CS stems from 'sampling capacitor'. This capacitor is
implemented on the chip.
Channel 0
Channel 1
CapTIvate Block Channel 2
Channel 3
Element The description of a single touch instance. This instance can be realized with a single
channel in self mode or with two channels in mutual mode.
Element
Self-capacitance
Element
Mutual-capacitance
Channel 0
Channel 1
Channel 3
Channel 0
Channel 1
Channel 3
Time slot A time slot represents a single time period during which a number of elements are
converted in parallel. For example, if there are four CapTIvate Blocks then four
elements can be measured in parallel during one time slot.
Wake on touch No CPU interaction is required to periodically measure, filter, and analyze a touch
element. If the analysis determines an event that requires further processing or
decision making, then an interrupt is provided to wake up the CPU.
Conversion The time required to make a capacitance measurement of all the elements within a
time slot. The measurement of the elements is in parallel, so the dominant element
(element with the longest measurement time) dictates the time of the conversion.
(From a hardware perspective, the conversion is the number of charge transfers
required to charge the CS capacitor to the Vtrip voltage.)
Tx Rx Tx Rx
PCB PCB
CRC Module
The cyclic redundancy check (CRC) module provides a signature for a given data sequence. This chapter
describes the operation and use of the CRC module.
Q D Q D Q D Q D Q D Q D Q D Q D Q D Q D
Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
15 12 11 10 6 5 4 3 1 0
Shift Clock
Figure 10-1. LFSR Implementation of CRC-CCITT Standard, Bit 0 is the MSB of the Result
Identical input data sequences result in identical signatures when the CRC is initialized with a fixed seed
value, whereas different sequences of input data, in general, result in different signatures.
If the checksum itself (with reversed bit order) is included into the CRC operation (as data written to
CRCDI or CRCDIRB), the result in the CRCINIRES and CRCRESR registers must be zero.
Data In
8-bit or 16-bit
8 8
Byte MUX
8 16
Figure 10-2. Implementation of CRC-CCITT Using the CRCDI and CRCINIRES Registers
...
PUSH R4 ; Save registers
PUSH R5
MOV #StartAddress,R4 ; StartAddress < EndAddress
MOV #EndAddress,R5
MOV &INIT, &CRCINIRES ; INIT to CRCINIRES
L1 MOV @R4+,&CRCDI ; Item to Data In register
CMP R5,R4 ; End address reached?
JLO L1 ; No
MOV &Check_Sum,&CRCDI ; Yes, Include checksum
TST &CRCINIRES ; Result = 0?
JNZ CRC_ERROR ; No, CRCRES <> 0: error
... ; Yes, CRCRES=0:
; information ok.
POP R5 ; Restore registers
POP R4
The details of the implemented CRC algorithm are shown by the data sequences in Example 10-2 using
word or byte accesses and the CRC data-in as well as the CRC data-in reverse byte registers.
...
mov #0FFFFh,&CRCINIRES ; initialize CRC
mov.b #00031h,&CRCDI_L ; "1"
mov.b #00032h,&CRCDI_L ; "2"
mov.b #00033h,&CRCDI_L ; "3"
mov.b #00034h,&CRCDI_L ; "4"
mov.b #00035h,&CRCDI_L ; "5"
mov.b #00036h,&CRCDI_L ; "6"
mov.b #00037h,&CRCDI_L ; "7"
mov.b #00038h,&CRCDI_L ; "8"
mov.b #00039h,&CRCDI_L ; "9"
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
The watchdog timer is a 32-bit timer that can be used as a watchdog or as an interval timer. This chapter
describes the watchdog timer. The enhanced watchdog timer, WDT_A, is implemented in all devices.
SLAU445G – October 2014 – Revised August 2016 Watchdog Timer (WDT_A) 353
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
WDT_A Introduction www.ti.com
354 Watchdog Timer (WDT_A) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com WDT_A Introduction
SMCLK 00
ACLK 01
VLOCLK 10
X_CLK 11
WDTHOLD
WDTSSEL1
WDTSSEL0
WDTTMSEL
WDTCNTCL
WDTIS2
WDTIS1
WDTIS0 LSB
X_CLK request
Clock SMCLK request
Request
Logic ACLK request
VLOCLK request
SLAU445G – October 2014 – Revised August 2016 Watchdog Timer (WDT_A) 355
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
WDT_A Operation www.ti.com
356 Watchdog Timer (WDT_A) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com WDT_A Operation
SLAU445G – October 2014 – Revised August 2016 Watchdog Timer (WDT_A) 357
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
WDT_A Registers www.ti.com
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
358 Watchdog Timer (WDT_A) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com WDT_A Registers
SLAU445G – October 2014 – Revised August 2016 Watchdog Timer (WDT_A) 359
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 12
SLAU445G – October 2014 – Revised August 2016
Timer_A
Timer_A is a 16-bit timer/counter with multiple capture/compare registers. There can be multiple Timer_A
modules on a given device (see the device-specific data sheet). This chapter describes the operation and
use of the Timer_A module.
NOTE: Nomenclature
There may be multiple instantiations of Timer_A on a given device. The prefix TAx is used,
where x is a greater than equal to zero indicating the Timer_A instantiation. For devices with
one instantiation, x = 0. The suffix n, where n = 0 to 6, represents the specific
capture/compare registers associated with the Timer_A instantiation.
Timer Block
TASSEL ID IDEX Timer Clock MC
2 15 0
2 3 2
TAxCLK 00 Divider Divider 16-bit Timer
Count
TAxR EQU0
ACLK 01 /1/2/4/8 /1.../8 Mode
Clear RC
SMCLK 10
INCLK 11 Set TAxCTL
TAIFG
TACLR
CCR0
CCR1
CCR2
CCR3
CCR4
CCR5
CCR6
Comparator 6
CCI
EQU6
CAP
A
SCCI Y
EN 0 Set TAxCCR6
1 CCIFG
OUT
Output
Unit4 D Set Q OUT6 Signal
EQU0
Timer Clock
Reset
3 POR
OUTMOD
To move from one mode to another, first stop the timer by writing zero to the MC bits (MC = 0), then set
the MC bits to the desired mode (see Table 12-1 for details).
12.2.3.1 Up Mode
The Up mode is used if the timer period must be different from 0FFFFh counts. The timer repeatedly
counts up to the value of compare register TAxCCR0, which defines the period (see Figure 12-2). The
number of timer counts in the period is TAxCCR0 + 1. When the timer value equals TAxCCR0, the timer
restarts counting from zero. If Up mode is selected when the timer value is greater than TAxCCR0, the
timer immediately restarts counting from zero.
TAxCCR0
The TAxCCR0 CCIFG interrupt flag is set when the timer counts to the TAxCCR0 value. The TAIFG
interrupt flag is set when the timer counts from TAxCCR0 to zero. Figure 12-3 shows the flag set cycle.
Timer Clock
0FFFFh
0h
The TAIFG interrupt flag is set when the timer counts from 0FFFFh to zero. Figure 12-5 shows the flag set
cycle.
Timer Clock
TAxCCR1b TAxCCR1c
TAxCCR0d
TAxCCR0b TAxCCR0c
0FFFFh
TAxCCR1a TAxCCR1d
TAxCCR0a
t0 t0 t0
t1 t1 t1
Time intervals can be produced with other modes as well, where TAxCCR0 is used as the period register.
Their handling is more complex because the sum of the old TAxCCRn data and the new period can be
higher than the TAxCCR0 value. When the previous TAxCCRn value plus tx is greater than the TAxCCR0
data, the TAxCCR0 value must be subtracted to obtain the correct time interval.
0h
The count direction is latched. This allows the timer to be stopped and then restarted in the same direction
it was counting before it was stopped. If this is not desired, the TACLR bit must be set in Stop mode to
clear the direction. The TACLR bit also clears the TAxR value and the timer clock divider (the divider
setting remains unchanged).
In Up/Down mode, the TAxCCR0 CCIFG interrupt flag and the TAIFG interrupt flag are set only once
during a period, separated by one-half the timer period. The TAxCCR0 CCIFG interrupt flag is set when
the timer counts from TAxCCR0 – 1 to TAxCCR0, and TAIFG is set when the timer completes counting
down from 0001h to 0000h. Figure 12-8 shows the flag set cycle.
Timer Clock
Up/Down
0FFFFh
TAxCCR0
TAxCCR1
TAxCCR2
0h
Dead Time
Output Mode 6: Toggle/Set
The capture signal can be asynchronous to the timer clock and cause a race condition. Setting the SCS
bit synchronizes the capture with the next timer clock. Setting the SCS bit to synchronize the capture
signal with the timer clock is recommended (see Figure 12-10).
Timer Clock
CCI
Capture
Overflow logic is provided in each capture/compare register to indicate if a second capture was performed
before the value from the first capture was read. Bit COV is set when this occurs as shown in Figure 12-
11. COV must be reset with software.
Idle
No Read
Capture Taken
Capture
Taken Capture
Taken
Capture
Capture
Clear Bit COV
in Register TAxCCTLn
Second
Capture Idle
Taken
COV = 1
0FFFFh
TAxCCR0
TAxCCR1
0h
0FFFFh
TAxCCR0
TAxCCR1
0h
0FFFFh
TAxCCR0
TAxCCR2
0h
Set CCIE
EQU0 IRQ, Interrupt Service Requested
D Q
CAP
Timer Clock
Reset
Timer_B
Timer_B is a 16-bit timer/counter with multiple capture/compare registers. There can be multiple Timer_B
modules on a given device (see the device-specific data sheet). This chapter describes the operation and
use of the Timer_B module.
NOTE: Nomenclature
There may be multiple instantiations of Timer_B on a given device. The prefix TBx is used,
where x is greater than or equal to zero, indicating the Timer_B instantiation. For devices
with one instantiation, x = 0.
The suffix n, where n = 0 to 6, represents the specific capture/compare registers associated
with the Timer_B instantiation.
Timer Block
TBSSEL ID IDEX Timer Clock MC
2 2 3 15 0
2
TBxCLK 00 Divider Divider 16-bit Timer
Count
/1.../8 TBxR RC EQU0
ACLK 01 /1/2/4/8 Mode
Clear 8 10 12 16
SMCLK 10 CNTL
INCLK 11
2
TBCLR
00
TBCLGRP
01
2
10 Set TBxCTL
Group TBIFG
11
Load Logic
CCR0
CCR1
CCR2
CCR3
CCR4
CCR5
CCIS CCR6
CM logic COV
2 2 SCS
CCI6A 00 Capture
Mode 15 0
CCI6B 01
0
GND 10 TBxCCR6
Timer Clock Sync 1
VCC 11
CLLD Load
CCI Group Compare Latch TBxCL6
2 Load Logic
VCC 00
TBxR=0 01 Comparator 6
CCR5
EQU0 10
CCR4 EQU6 CAP
UP/DOWN
11
CCR1
0
Set TBxCCR6
1 CCIFG
OUT
Output
Unit6 D Set Q OUT6 Signal
EQU0
Timer Clock
Reset
3 POR
OUTMOD
13.2.3.1 Up Mode
The up mode is used if the timer period must be different from TBxR(max) count. The timer repeatedly
counts up to the value of compare latch TBxCL0, which defines the period (see Figure 13-2). The number
of timer counts in the period is TBxCL0 + 1. When the timer value equals TBxCL0, the timer restarts
counting from zero. If up mode is selected when the timer value is greater than TBxCL0, the timer
immediately restarts counting from zero.
TBxR(max)
TBxCL0
0h
The TBxCCR0 CCIFG interrupt flag is set when the timer counts to the TBxCL0 value. The TBIFG
interrupt flag is set when the timer counts from TBxCL0 to zero. Figure 13-3 shows the flag set cycle.
Timer Clock
TBxR(max)
0h
The TBIFG interrupt flag is set when the timer counts from TBxR(max) to zero. Figure 13-5 shows the flag
set cycle.
Timer Clock
TBxCL1a TBxCL1d
TBxCL0a
0h
EQU0 Interrupt
t0 t0 t0
EQU1 Interrupt
t1 t1 t1
Time intervals can be produced with other modes as well, where TBxCL0 is used as the period register.
Their handling is more complex, because the sum of the old TBxCLn data and the new period can be
higher than the TBxCL0 value. When the sum of the previous TBxCLn value plus tx is greater than the
TBxCL0 data, the old TBxCL0 value must be subtracted to obtain the correct time interval.
TBxCL0
0h
The count direction is latched. This allows the timer to be stopped and then restarted in the same direction
it was counting before it was stopped. If this is not desired, the TBCLR bit must be set in stop mode to
clear the direction. Setting TBCLR also clears the TBxR value and the clock divider counter logic (the
divider setting remains unchanged).
In up/down mode, the TBxCCR0 CCIFG interrupt flag and the TBIFG interrupt flag are set only once
during the period, separated by one-half the timer period. The TBxCCR0 CCIFG interrupt flag is set when
the timer counts from TBxCL0 – 1 to TBxCL0, and TBIFG is set when the timer completes counting down
from 0001h to 0000h. Figure 13-8 shows the flag set cycle.
Timer Clock
Up/Down
TBR(max)
TBxCL0
TBxCL1
TBxCL3
0h
Dead Time
Output Mode 6: Toggle/Set
Timer Clock
CCI
Capture
Overflow logic is provided in each capture/compare register to indicate if a second capture was performed
before the value from the first capture was read. Bit COV is set when this occurs (see Figure 13-11). COV
must be reset with software.
Idle
No Read
Capture Taken
Capture
Taken Capture
Taken
Capture
Capture
Clear Bit COV
in Register TBxCCTLn
Second
Capture Idle
Taken
COV = 1
TBxR(max)
TBxCL0
TBxCL1
0h
TBxR(max)
TBxCL0
TBxCL1
0h
TBxR(max)
TBxCL0
TBxCL3
0h
Capture
Set CCIE
EQU0 IRQ, Interrupt Service Requested
D Q
CAP
Timer Clock
Reset
The following software example shows the recommended use of TBxIV for Timer_B3.
; Interrupt handler for TB0CCR0 CCIFG. Cycles
CCIFG_0_HND
; ... ; Start of handler Interrupt latency 6
RETI 5
• TBxCTL register
– TBxCLn group (TBCLGRP)
– Counter length (CNTL)
– Clock source select (TBSSEL)
– Input divider (ID)
– Timer_B clear (TBCLR)
• TBxCCTLn registers
– Capture mode (CM) (switching to no capture mode can be performed any time)
– Capture/compare input select (CCIS) (switching between GND an VCC can be performed at any
time)
– Synchronize capture source (SCS)
– Capture mode (CAP)
– Output mode (OUTMOD)
• TBxEX0 register
– Input divider expansion (TBIDEX)
To update Timer_B configuration:
1. Write zero to the mode control bits (MC = 0) (do not use the TBCLR bit to reset the mode control bits).
2. If necessary, write 1 to the TBCLR bit (TBCLR = 1 ) to clear TBxR, clock divider state, and the counter
direction.
3. If necessary, update counter value to TBxR.
4. If required to initialize TBxCLn, write zero to the CLLD bits so that the values written to TBxCCRn are
immediately transferred to TBxCLn.
5. To update the CM, CCIS, or SCS bits or the TBxCCRn register, and the timer is in capture mode,
disable capture mode first by writing zero to the CAP bit (CAP = 0) or the CM bits (CM = 0).
6. Apply desired configuration to TBxCCRn, TBIDEX, and TBxCCTLn.
7. Apply desired configuration to TBxCTL including the MC bits.
The Real-Time Clock (RTC) counter is a 16-bit counter that is functional in active mode (AM) and several
low-power modes (LPMs). RTC counter accepts multiple clock sources, which are selected by control
registers settings, to generate timing from less than 1 µs up to many hours. This chapter describes the
operation and use of the RTC counter module.
408 Real-Time Clock (RTC) Counter SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com RTC Counter Introduction
Reserved 00 reset
Device specific 01
Pre-Divider 16-bit Counter
XT1CLK 10
VLOCLK 11 Interrupt
Request
overflow
Compare Logics S Q
RTCSS RTCPS R
reload
16-bit Shadow Register
Overflow Event
to Other Modules
SLAU445G – October 2014 – Revised August 2016 Real-Time Clock (RTC) Counter 409
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
RTC Counter Operation www.ti.com
410 Real-Time Clock (RTC) Counter SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com RTC Counter Operation
Care should be taken when setting RTCMOD so that the overflow events do not happen too quickly to be
serviced. When the selected RTC counter source frequency is close to the CPU clock frequency, the
modulo value must be long enough that the CPU is able to respond to the RTC counter interrupt service
routine (ISR) in time before the next RTC counter interrupt occurs. In addition, frequent writes to the
RTCSR bit (software reset) could lead to an overflow event being missed, as the count is reset each time,
and the RTCMOD setting overwrites the current shadow register setting.
Figure 14-2 shows a hardware overflow event loading the new value (0x2000) from RTCMOD into the
shadow register, replacing the previous value (0x4000).
Divided Clock
RTCMODR 0x2000
Hardware Overflow
SLAU445G – October 2014 – Revised August 2016 Real-Time Clock (RTC) Counter 411
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
RTC Counter Registers www.ti.com
412 Real-Time Clock (RTC) Counter SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com RTC Counter Registers
SLAU445G – October 2014 – Revised August 2016 Real-Time Clock (RTC) Counter 413
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
RTC Counter Registers www.ti.com
414 Real-Time Clock (RTC) Counter SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com RTC Counter Registers
SLAU445G – October 2014 – Revised August 2016 Real-Time Clock (RTC) Counter 415
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 15
SLAU445G – October 2014 – Revised August 2016
This chapter describes the 32-bit hardware multiplier (MPY32). The MPY32 module is implemented in all
devices.
416 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com 32-Bit Hardware Multiplier (MPY32) Introduction
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 417
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
32-Bit Hardware Multiplier (MPY32) Introduction www.ti.com
Accessible
MPY
Register
MPYS
MAC
MACS
MPY32H MPY32L
MPYS32H MPYS32L
31 16 15 0 31 16 15 0
OP1 (high word) OP1 (low word) OP2 (high word) OP2 (low word)
16×16 Multiplier
OP1_32
OP2_32
2
MPYMx Control
Logic
MPYSAT 32-bit Adder
MPYFRAC
MPYC
32-bit Demultiplexer
32-bit Multiplexer
418 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Operation
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 419
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
MPY32 Operation www.ti.com
Writing the second operand to the OP2 initiates the multiply operation. Writing OP2 starts the selected
operation with a 16-bit-wide second operand together with the values stored in OP1. Writing OP2L starts
the selected operation with a 32-bit-wide second operand and the multiplier expects a the high word to be
written to OP2H. Writing to OP2H without a preceding write to OP2L is ignored.
For 8-bit or 24-bit operands, the operand registers can be accessed with byte instructions. Accessing the
multiplier with a byte instruction during a signed operation automatically causes a sign extension of the
byte within the multiplier module. For 24-bit operands, only the high word should be written as byte. If the
24-bit operands are sign-extended as defined by the register, that is used to write the low word to,
because this register defines if the operation is unsigned or signed.
The high-word of a 32-bit operand remains unchanged when changing the size of the operand to 16 bit,
either by modifying the operand size bits or by writing to the respective operand register. During the
execution of the 16-bit operation, the content of the high word is ignored.
420 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Operation
In addition to RES0 to RES3, for compatibility with the 16×16 hardware multiplier, the 32-bit result of a 8-
bit or 16-bit operation is accessible through RESLO, RESHI, and SUMEXT. In this case, the result low
register RESLO holds the lower 16 bits of the calculation result and the result high register RESHI holds
the upper 16 bits. RES0 and RES1 are identical to RESLO and RESHI, respectively, in usage and access
of calculated results.
The sum extension register SUMEXT contents depend on the multiply operation and are listed in
Table 15-4. If all operands are 16 bits wide or less, the 32-bit result is used to determine sign and carry. If
one of the operands is larger than 16 bits, the 64-bit result is used.
The MPYC bit reflects the multiplier's carry as listed in Table 15-4 and, thus, can be used as 33rd or 65th
bit of the result, if fractional or saturation mode is not selected. With MAC or MACS operations, the MPYC
bit reflects the carry of the 32-bit or 64-bit accumulation and is not taken into account for successive MAC
and MACS operations as the 33rd or 65th bit.
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 421
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
MPY32 Operation www.ti.com
422 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Operation
15 bits
1 1 1 1
S ...
2 4 8 16
Fractional part
Radix point
Sign bit
The range can be increased by shifting the radix point to the right as shown in Figure 15-3. The signed
Q14 format with 16 bits gives a range from –2.0 to 1.999938965 ≈ 2.0.
14 bits
1 1 1 1
S 1 ...
2 4 8 16
The benefit of using 16-bit signed Q15 or 32-bit signed Q31 numbers with multiplication is that the product
of two number in the range from –1.0 to 1.0 is always in that same range.
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 423
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
MPY32 Operation www.ti.com
The MPYC bit is not affected by the fractional mode. It always reads the carry of the nonfractional result.
; Example using
; Fractional 16x16 multiplication
BIS #MPYFRAC,&MPY32CTL0 ; Turn on fractional mode
MOV &FRACT1,&MPYS ; Load 1st operand as Q15
MOV &FRACT2,&OP2 ; Load 2nd operand as Q15
MOV &RES1,&PROD ; Save result as Q15
BIC #MPYFRAC,&MPY32CTL0 ; Back to normal mode
424 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Operation
Figure 15-4 shows the flow for 32-bit saturation used for 16×16 bit multiplications and the flow for 64-bit
saturation used in all other cases. Primarily, the saturated results depends on the carry bit MPYC and the
MSB of the result. Secondly, if the fractional mode is enabled, it depends also on the two MSBs of the
unshifted result, that is, the result that is read with fractional mode disabled.
Overflow: Overflow:
MPYC=0 and Yes RES3 unchanged MPYC=0 and Yes RES3 = 07FFFh
unshifted RES1, RES2 unchanged unshifted RES3, RES2 = 0FFFFh
bit15=1 RES1 = 07FFFh bit15=1 RES1 = 0FFFFh
RES0 = 0FFFFh RES0 = 0FFFFh
No No
Underflow: Underflow:
MPYC=1 and Yes RES3 unchanged MPYC=1 and Yes RES3 = 08000h
unshifted RES1, RES2 unchanged unshifted RES3, RES2 = 00000h
bit15=0 RES1 = 08000h bit15=0 RES1 = 00000h
RES0 = 00000h RES0 = 00000h
No No
No No
MPYFRAC=1 MPYFRAC=1
Yes Yes
Overflow: Overflow:
Yes RES3 unchanged Yes RES3 = 07FFFh
Unshifted RES1, Unshifted RES3,
RES2 unchanged RES2 = 0FFFFh
bit 15=0 and bit 15=0 and
RES1 = 07FFFh RES1 = 0FFFFh
bit 14=1 bit 14=1
RES0 = 0FFFFh RES0 = 0FFFFh
No No
Underflow: Underflow:
Unshifted RES1, Yes RES3 unchanged Unshifted RES3, Yes RES3 = 08000h
bit 15=1 and RES2 unchanged bit 15=1 and RES2 = 00000h
bit 14=0 RES1 = 08000h bit 14=0 RES1 = 00000h
RES0 = 00000h RES0 = 00000h
No No
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 425
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
MPY32 Operation www.ti.com
The following example illustrates a special case showing the saturation function in fractional mode. It also
uses the 8-bit functionality of the MPY32 module.
; Turn on fractional and saturation mode,
; clear all other bits in MPY32CTL0:
MOV #MPYSAT+MPYFRAC,&MPY32CTL0
;Pre-load result registers to demonstrate overflow
MOV #0,&RES3 ;
MOV #0,&RES2 ;
MOV #07FFFh,&RES1 ;
MOV #0FA60h,&RES0 ;
MOV.B #050h,&MACS_B ; 8-bit signed MAC operation
MOV.B #012h,&OP2_B ; Start 16x16 bit operation
MOV &RES0,R6 ; R6 = 0FFFFh
MOV &RES1,R7 ; R7 = 07FFFh
The result is saturated because before the result is converted into a fractional number, it shows an
overflow. The multiplication of the two positive numbers 00050h and 00012h gives 005A0h. 005A0h added
to 07FFF FA60h results in 8000 059Fh, without MPYC being set. Because the MSB of the unmodified
result RES1 is 1 and MPYC = 0, the result is saturated according Figure 15-4.
426 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Operation
New Multiplication
Started
Yes No
16×16
?
No Yes Yes No
MAC or MACS MAC or MACS
? ?
Yes Yes
MPYSAT=1 MPYSAT=1
? ? Clear Result:
Clear Result: RES3 = 00000h
RES1 = 00000h non-fractional No No non-fractional RES2 = 00000h
RES0 = 00000h 32-bit Saturation 64-bit Saturation RES1 = 00000h
RES0 = 00000h
Yes Yes
MPYFRAC=1 MPYFRAC=1
? ?
No No
Shift 64-bit result. Shift 64-bit result.
Calculate SUMEXT based on Calculate SUMEXT based on
MPYC and bit 15 of MPYC and bit 15 of
unshifted RES1. unshifted RES3.
Yes Yes
MPYSAT=1 MPYSAT=1
? ?
Multiplication
completed
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 427
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
MPY32 Operation www.ti.com
Given the separation in processing of 16-bit operations (32-bit results) and 32-bit operations (64-bit
results) by the module, it is important to understand the implications when using MAC or MACS operations
and mixing 16-bit operands or results with 32-bit operands or results. User software must address these
points during use when mixing these operations. The following code illustrates the issue.
; Mixing 32x24 multiplication with 16x16 MACS operation
MOV #MPYSAT,&MPY32CTL0 ; Saturation mode
MOV #052C5h,&MPY32L ; Load low word of 1st operand
MOV #06153h,&MPY32H ; Load high word of 1st operand
MOV #001ABh,&OP2L ; Load low word of 2nd operand
MOV.B #023h,&OP2H_B ; Load high word of 2nd operand
;... 5 NOPs required
MOV &RES0,R6 ; R6 = 00E97h
MOV &RES1,R7 ; R7 = 0A6EAh
MOV &RES2,R8 ; R8 = 04F06h
MOV &RES3,R9 ; R9 = 0000Dh
; Note that MPYC = 0!
MOV #0CCC3h,&MACS ; Signed MAC operation
MOV #0FFB6h,&OP2 ; 16x16 bit operation
MOV &RESLO,R6 ; R6 = 0FFFFh
MOV &RESHI,R7 ; R7 = 07FFFh
The second operation gives a saturated result because the 32-bit value used for the 16×16-bit MACS
operation was already saturated when the operation was started; the carry bit MPYC was 0 from the
previous operation, but the MSB in result register RES1 is set. As one can see in the flow chart, the
content of the result registers are saturated for multiply-and-accumulate operations after starting a new
operation based on the previous results, but depending on the size of the result (32 bit or 64 bit) of the
newly initiated operation.
The saturation before the multiplication can cause issues if the MPYC bit is not properly set as the
following code shows.
;Pre-load result registers to demonstrate overflow
MOV #0,&RES3 ;
MOV #0,&RES2 ;
MOV #0,&RES1 ;
MOV #0,&RES0 ;
; Saturation mode and set MPYC:
MOV #MPYSAT+MPYC,&MPY32CTL0
MOV.B #082h,&MACS_B ; 8-bit signed MAC operation
MOV.B #04Fh,&OP2_B ; Start 16x16 bit operation
MOV &RES0,R6 ; R6 = 00000h
MOV &RES1,R7 ; R7 = 08000h
Even though the result registers were loaded with all zeros, the final result is saturated. This is because
the MPYC bit was set, causing the result used for the multiply-and-accumulate to be saturated to
08000 0000h. Adding a negative number to it would again cause an underflow, thus, the final result is also
saturated to 08000 0000h.
428 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Operation
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 429
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
MPY32 Operation www.ti.com
430 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Registers
NOTE: All registers have word or byte register access. For a generic register ANYREG, the suffix
"_L" (ANYREG_L) refers to the lower byte of the register (bits 0 through 7). The suffix "_H"
(ANYREG_H) refers to the upper byte of the register (bits 8 through 15).
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 431
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
MPY32 Registers www.ti.com
432 32-Bit Hardware Multiplier (MPY32) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com MPY32 Registers
SLAU445G – October 2014 – Revised August 2016 32-Bit Hardware Multiplier (MPY32) 433
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 16
SLAU445G – October 2014 – Revised August 2016
LCD_E Controller
The LCD_E controller drives static and 2-mux to 8-mux LCDs. This chapter describes the LCD_E
controller. The differences between LCD_B, LCD_C and LCD_E are listed in Table 16-1.
LCDCLRM LCDCLRBM
LCD Blinking
Memory Memory
Registers Registers
(1),(2)
LCDMx LCDBMx
LCDBLKPREx LCDBLKMODx
LCDMXx
3
3
fFRAME Blinking fBLINK Blinking
Divider Frequency (1)
Divider Control
Display
Control
LCDCSS0
LCDDISP LCDS0 LCDM0(3)
example for
connecting
COM/SEG
L0
MUX
LCDSSEL
LCDDIVx LCDMXx
LCDCSS1
5 3
XT1CLK 00
fSOURCE fDIV fLCD Timing LCDS1 LCDM0(3)
ACLK 01
Divider Divider Generator
VLOCLK 10
Reserved 11
3 L1
MUX
LCDCPFSELx
LCDMXx LCDON
4
fCP
Divider
LCDCSSx
VLCDx
LCDSx LCDMx
4
V1 VA
LCDCPEN
V2 VB Lx
MUX
LCD Bias
Analog
Generator
LCDSELVDD Voltage
V4 Multiplexer VC
LCDREFEN Charge Pump
V5 VD
LCDREFMODE
LCDLP
LCDCAP1
LCDCAP0
Associated
3 2 1 0 3 2 1 0
Common Pins
n Associated
Register
7 0 LCD Pins
LCDM31 -- -- -- -- -- -- -- -- 62 L63, L62
LCDM30 -- -- -- -- -- -- -- -- 60 L61, L60
LCDM29 -- -- -- -- -- -- -- -- 58 L59, L58
LCDM28 -- -- -- -- -- -- -- -- 56 L57, L56
LCDM27 -- -- -- -- -- -- -- -- 54 L55, L54
LCDM26 -- -- -- -- -- -- -- -- 52 L53, L52
LCDM25 -- -- -- -- -- -- -- -- 50 L51, L50
LCDM24 -- -- -- -- -- -- -- -- 48 L49, L48
LCDM23 -- -- -- -- -- -- -- -- 46 L47, L46
LCDM22 -- -- -- -- -- -- -- -- 44 L45, L44
LCDM21 -- -- -- -- -- -- -- -- 42 L43, L42
LCDM20 -- -- -- -- -- -- -- -- 40 L41, L40
LCDM19 -- -- -- -- -- -- -- -- 38 L39, L38
LCDM18 -- -- -- -- -- -- -- -- 36 L37, L36
LCDM17 -- -- -- -- -- -- -- -- 34 L35, L34
LCDM16 -- -- -- -- -- -- -- -- 32 L33, L32
LCDM15 -- -- -- -- -- -- -- -- 30 L31, L30
LCDM14 -- -- -- -- -- -- -- -- 28 L29, L28
LCDM13 -- -- -- -- -- -- -- -- 26 L27, L26
LCDM12 -- -- -- -- -- -- -- -- 24 L25, L24
LCDM11 -- -- -- -- -- -- -- -- 22 L23, L22
LCDM10 -- -- -- -- -- -- -- -- 20 L21, L20
LCDM9 -- -- -- -- -- -- -- -- 18 L19, L18
LCDM8 -- -- -- -- -- -- -- -- 16 L17, L16
LCDM7 -- -- -- -- -- -- -- -- 14 L15, L14
LCDM6 -- -- -- -- -- -- -- -- 12 L13, L12
LCDM5 -- -- -- -- -- -- -- -- 10 L11, L10
LCDM4 -- -- -- -- -- -- -- -- 8 L9, L8
LCDM3 -- -- -- -- -- -- -- -- 6 L7, L6
LCDM2 -- -- -- -- -- -- -- -- 4 L5, L4
1 1
LCDM1 COM3 -- -- -- -- COM2 -- -- 2 L3 , L2
1 1
LCDM0 -- -- COM1 -- -- -- -- COM0 0 L1 , L0
Figure 16-2. LCD Memory for Static to 4-Mux Mode – Example for 4-Mux Mode With 240 Segments
Register Associated
7 0 n LCD Pins
LCDM19 -- -- -- -- -- -- -- -- 19 L19
LCDM18 -- -- -- -- -- -- -- -- 18 L18
LCDM17 -- -- -- -- -- -- -- -- 17 L17
LCDM16 -- -- -- -- -- -- -- -- 16 L16
LCDM15 -- -- -- -- -- -- -- -- 15 L15
LCDM14 -- -- -- -- -- -- -- -- 14 L14
LCDM13 -- -- -- -- -- -- -- -- 13 L13
LCDM12 -- -- -- -- -- -- -- -- 12 L12
LCDM11 -- -- -- -- -- -- -- -- 11 L11
LCDM10 -- -- -- -- -- -- -- -- 10 L10
LCDM9 -- -- -- -- -- -- -- -- 9 L9
LCDM8 -- -- -- -- -- -- -- -- 8 L8
1
LCDM7 COM7 -- -- -- -- -- -- -- 7 L7
1
LCDM6 -- COM6 -- -- -- -- -- -- 6 L6
1
LCDM5 -- -- COM5 -- -- -- -- -- 5 L5
1
LCDM4 -- -- -- COM4 -- -- -- -- 4 L4
1
LCDM3 -- -- -- -- COM3 -- -- -- 3 L3
1
LCDM2 -- -- -- -- -- COM2 -- -- 2 L2
1
LCDM1 -- -- -- -- -- -- COM1 -- 1 L1
1
LCDM0 -- -- -- -- -- -- -- COM0 0 L0
Ln
1) LCD pins L0 to L7 are configured
to have common functionality by setting
register bits LCDCSS0 to LCDCSS7 = 1
Figure 16-3. LCD Memory for 5-Mux to 8-Mux Mode – Example for 8-Mux Mode With 96 Segments
NOTE: LCDSx Bits Do Not Affect Dedicated LCD Segment and Common Pins
The LCDSx bits affect only pins with multiplexed LCD segment and common functions and
digital I/O functions. Dedicated LCD segment and common pins are not affected by the
LCDSx bits.
NOTE: See the device-specific data sheet to determine whether or not 5-, 6-, 7-, or 8-mux mode is
available on a device.
NOTE: Only one common (COMx) pin per LCD pin can be selected. Assigning two or more
common functions to one LCD pin can lead to unpredicted behavior.
To define the LCD pin to have LCD common functionality, the corresponding bit in LCDCSSELx register
must be set to 1. With this setting, the LCDMx register is used to configure the associated LCD pin to
have COMx functionality.
The LCDMx setting behaves differently depending on whether static- to 4-mux mode or 5-mux to 8-mux
mode is used. The differences are described in the following sections.
LCDMx COM3 COM2 COM1 COM0 COM3 COM2 COM1 COM0 4-mux Mode
Ln+1 Ln
Examples:
To use LCD pin L4 as COM2, make the following configuration:
LCDPCTL0 = BIT4; // configure I/O pad as LCD pin
LCDCSSEL0 = BIT4; // configure LCD pin L4 as COM
LCDM2 = BIT2; // define L4 as COM2
NOTE: See the device-specific data sheet to determine whether or not 5-, 6-, 7-, or 8-mux mode is
available on a device.
LCDMx COM7 COM6 COM5 COM4 COM3 COM2 COM1 COM0 8-mux Mode
LCDMx 0 COM6 COM5 COM4 COM3 COM2 COM1 COM0 7-mux Mode
Ln
Examples:
To use LCD pin L4 as COM6, make the following configuration:
LCDPCTL0 |= BIT4; // configure I/O pad as LCD pin
LCDCSSEL0 |= BIT4; // configure LCD pin L4 as COM
LCDM4 = BIT6; // define L4 as COM6
EXAMPLE 1:
The proper fLCD frequency depends on the LCD's requirement for framing frequency and the LCD multiplex
rate. To avoid ghosting effects on the LCD, fLCD should be in the range of approximately 30 Hz to 60 Hz. It
is calculated by:
fLCD = 2 × mux × fFRAME
For example, to calculate fLCD for a 3-mux LCD with a frame frequency of 25 Hz to 80 Hz:
fFRAME (from LCD data sheet) = 25 Hz to 80 Hz
fLCD = 2 × 3 × fFRAME
fLCD(min) = 150 Hz
fLCD(max) = 480 Hz
With fSOURCE = 32768 Hz, LCDDIVx = 01101, and LCDMXx = 010:
fLCD = 32768 Hz / ((13+1) × 16) = 32768 Hz / 224 = 146 Hz
With LCDDIVx = 00100 and LCDMXx = 010:
fLCD = 32768 Hz / ((4+1) × 16) = 32768 Hz / 56 = 409 Hz
The lowest frequency has the lowest current consumption. The highest frequency has the least flicker.
EXAMPLE 2:
Table 16-3 shows the possible fLCD, fFRAME, and fBLINK frequencies for a given fSOURCE = 32.768 kHz
depending on the selected mux mode.
By saying LCDBMx must be configured according to LCDMx it means that the same memory number "x"
must be used. For example if LCDM2 = 02h (LCD pin L2 = COM1), then LCDBM2 has also to be
programmed to 02h.
Example:
LCD configured in 4-MUX mode, 20 LCD pins, 4 configured as common, 16 configured as segment
L0 = COM0, L1 = COM1, L2 = COM2, L3 = COM3; L4 ... L19 = SEG0 ... SEG19
The following configuration must be done:
Figure 16-6 shows how to configure the display memory LCDMx and the blinking memory LCDBMx during
different blinking modes.
0x00
LCDM2 L5 L4 LCDBM2 L5 L4
LCDM0 0 0 1 0 0 0 0 1 LCDBM0 0 0 1 0 0 0 0 1
LCDM1 1 0 0 0 0 1 0 0 LCDBM1 0 0 0 0 0 0 0 0
LCDM0 0 0 1 0 0 0 0 1 LCDBM0 0 0 0 0 0 0 0 0
LCDM1 1 0 0 0 0 1 0 0 LCDBM1 x x x x x x x x
LCDM0 0 0 1 0 0 0 0 1 LCDBM0 x x x x x x x x
The divider generating the blinking frequency fBLINK is reset when LCDBLKMODx = 00. After a blinking
mode LCDBLKMODx = 01 or 10 is selected, the enabled segments or all segments go blank at the next
frame boundary and stay off for half of a BLKCLK period. Then they go active at the next frame boundary
and stay on for another half BLKCLK period before they go blank again at a frame boundary.
LCDCAP0
LCDCAP1
R33
fCP R23
Charge Pump
R13
1 1
LCDCPEN
LCDSELVDD Bias Voltage 1
LCDREFMODE
Generator
4 LCDREFEN
VLCDx
(2) VCC
Mode
0a 0b 1 4 1
LCDSELVDD
VEXT VEXT R33
V1 (VLCD)
(1)
C
R R
R23
V2 (2/3 VLCD)
(1)
C
R R
VREF,EXT R13
V4 (1/3 VLCD)
(1)
C
R R
V5
The bias voltages V1, V2, and V4 are available on pin R33, R23, and R13, repectively. To source the bias
voltages V1, V2, and V4 externally, an equally weighted resistor divider is used with resistors ranging from
a few kΩ to 1 MΩ, depending on the size of the display. When using the internal charge pump it is
possible to derive the bias voltages V1, V2, and V4 from several sources. It is possible to connect either
an external voltage VEXT or internally VDD to R33 to generate V2 and V4. See section Section 16.2.8.1
(Mode 1 and Mode 2). The third possibility is to source R13 either externally or internally. See
Section 16.2.8.2 (Mode 3) and Section 16.2.8.3 (Mode 4).
A typical approach to determine the required VLCD is by equating VRMS,OFF with a defined LCD threshold
voltage, typically when the LCD exhibits approximately 10% contrast (Vth,10%): VRMS,OFF = Vth,10%. Using the
values for VRMS,OFF / VLCD provided in the table results in VLCD = Vth,10% / (VRMS,OFF / VLCD). In the static mode,
a suitable choice is VLCD greater than or equal to 3 × Vth,10%.
16.2.8.1 Internal Charge Pump Enabled, Internal VREF Disabled (Mode 1, Mode 2)
In Figure 16-8 Mode 1 is depicted. LCD voltages are sourced from an external voltage VEXT, which is
connected to pin R33. The internal charge pump is used to generate the LCD voltages V1, V2, V4 and V5.
Contrast can be adjusted by changing VEXT.
LCDSELVDD = 0; // Pin R33 is connected to external supply voltage
LCDCPEN = 1; // internal charge pump enabled
LCDREFEN = 0; // internal reference voltage at R13 is disabled
LCDCPFSELx = 0b1111; // charge pump frequency select, slowest value
VLCDx = 0b0000; // not used, set to reset value
LCDON = 1; // enable LCD
Mode 2 is shown in Figure 16-9. R33 is connected to internal supply voltage VDD. The internal charge
pump generates the LCD voltages V1, V2, V4, and V5. Contrast can be adjusted by changing VDD from
3.6 V to 1.8 V.
LCDSELVDD = 1; // Pin R33 is connected to internal supply voltage
LCDCPEN = 1; // internal charge pump enabled
LCDREFEN = 0; // internal reference voltage at R13 is disabled
LCDCPFSELx = 0b1111; // charge pump frequency select, slowest value
VLCDx = 0b0000; // not used, set to reset value
LCDON = 1; // enable LCD
Off-Chip On-Chip
Off-Chip On-Chip
VEXT VCC
1
R33 LCDSELVDD = 1
V1
R33
V1
R23
V2 R23
V2
R13
V4
R13
V4
1 1 1
LCDCPEN=1 1 1 1
LCDCPEN=1
LCDCAP1
V5
LCDCAP1
Charge V5
Pump Charge
LCDCAP0 Pump
LCDCAP0
Off-Chip On-Chip
R33
V1
R23
V2
R13
V4
1 1 1
LCDCPEN=1 V5
LCDCAP1
Bias
Charge
Voltage
Pump
Generator
LCDCAP0
NOTE: Mode 3 is the recommended operating mode, as this provides the lowest external
component cost and very low operating currents.
Off-Chip On-Chip
R33
V1
R23
V2
R13
VREF,EXT V4
1 1 1
LCDCPEN=1
LCDCAP1
V5
Charge
Pump
LCDCAP0
The LCDBLKOFFIFG is set at the BLKCLK falling edge and LCD switches to non-blinking status when
blinking is enabled with LCDBLKMODx = 01 or 10. It is also set at the BLKCLK edge that selects the LCD
memory as display memory when LCDBLKMODx = 11. It is automatically cleared when a LCD or blinking
memory register is written. Setting the LCDBLKOFFIE bit enables the interrupt.
The LCDFRMIFG is set at a frame boundary. It is automatically cleared when a LCD or blinking memory
register is written. Setting the LCDFRMIFGIE bit enables the interrupt.
V1
S0 V2
V4
V5
V1
S1 V2
V4
V5
V1
V2
COM0-S0 V4
Segment is on. 0V
−V4
−V2
−V1
V1
V2
COM0-S1 V4
Segment is off. 0V
−V4
−V2
−V1
Figure 16-12. Example Static Waveforms
V1
S0 V2
V4
V5
V1
S1 V2
V4
V5
V1
COM0-S0 0V
Segment is on.
−V1
V1
COM1-S1
Segment is off. 0V
−V1
Figure 16-13. Example 2-Mux Waveforms
V1
S0 V2
V4
V5
V1
S1 V2
V4
V5
V1
COM0-S0 0V
Segment is on.
−V1
V1
COM1-S1
Segment is off. 0V
−V1
Figure 16-14. Example 3-Mux Waveforms
V1
S1 V2
V4
V5
V1
COM0-S0 0V
Segment is on.
−V1
V1
COM1-S1
Segment is off. 0V
−V1
Figure 16-15. Example 4-Mux Waveforms
COM4 V1
S0 V2
V4
COM5 V5
V1
S1 V2
V4
V5
V1
COM0-S0 0V
Segment is on.
−V1
V1
COM1-S1
Segment is off. 0V
−V1
Figure 16-16. Example 6-Mux Waveforms
COM4 V1
S0 V2
V4
COM5 V5
COM6
V1
S1 V2
COM7 V4
V5
V1
COM0-S0 0V
Segment is on.
−V1
V1
COM1-S1
Segment is off. 0V
−V1
Figure 16-17. Example 8-Mux, 1/3 Bias Waveforms (LCDLP = 0)
Figure 16-18 shows some example 8-mux 1/3-bias waveforms with LCDLP = 1. With LCDLP = 1, the
voltage sequence compared to the non-low power waveform is reshuffled; that is, all of the timeslots
marked with "*" in Figure 16-17 are grouped together. The same principle applies to all mux modes.
S0 S1 * * * * * * * *
on V1
COM0 V2
V4
COM0 off V5
fframe
COM1
V1
COM1 V2
COM2 V4
V5
COM3
COM4 V1
S0 V2
V4
COM5 V5
COM6
V1
S1 V2
COM7 V4
V5
V1
COM0-S0 0V
Segment is on.
−V1
V1
COM1-S1
Segment is off. 0V
−V1
Figure 16-18. Example 8-Mux, 1/3 Bias Low-Power Waveforms (LCDLP = 1)
(1)
The LCD memory registers can also be accessed as word.
(2)
The number of available memory registers on a given device depends on the amount of available segment pins. See the device-specific
data sheet.
Table 16-7. LCD Memory Registers for Static and 2-Mux to 4-Mux Modes (1) (2)
(continued)
Offset Acronym Register Name Type Reset
03Eh LCDM30W LCD memory 30 Word (S63, S62, S61, S60) Read/write Unchanged
03Eh LCDM30 LCD memory 30 (S61, S60) Read/write Unchanged
03Fh LCDM31 LCD memory 31 (S63, S62) Read/write Unchanged
(1)
The LCD blinking memory registers can also be accessed as word.
(2)
The number of available memory registers on a given device depends on the amount of available segment pins (see the device-specific
data sheet).
Table 16-8. LCD Blinking Memory Registers for Static and 2-Mux to 4-Mux Modes (1) (2) (continued)
Offset Acronym Register Name Type Reset
05Eh LCDBM30W LCD blinking memory 30 Word Read/write Unchanged
05Eh LCDBM30 LCD blinking memory 30 Read/write Unchanged
05Fh LCDBM31 LCD blinking memory 31 Read/write Unchanged
(1)
The LCD memory registers can also be accessed as word.
(2)
The number of available memory registers on a given device depends on the number of available segment pins (see the device-specific
data sheet).
Table 16-9. LCD Memory Registers for 5-Mux to 8-Mux Modes (1) (2) (continued)
Offset Acronym Register Name Type Reset
03Eh LCDM30W LCD memory 30 Word (S31, S30) Read/write Unchanged
03Eh LCDM30 LCD memory 30 (S30) Read/write Unchanged
03Fh LCDM31 LCD memory 31 (S31) Read/write Unchanged
040h LCDM32W LCD memory 32 Word (S33, S32) Read/write Unchanged
040h LCDM32 LCD memory 32 (S32) Read/write Unchanged
041h LCDM33 LCD memory 33 (S33) Read/write Unchanged
042h LCDM34W LCD memory 34 Word (S35, S34) Read/write Unchanged
042h LCDM34 LCD memory 34 (S34) Read/write Unchanged
043h LCDM35 LCD memory 35 (S35) Read/write Unchanged
044h LCDM36W LCD memory 36 Word (S37, S36) Read/write Unchanged
044h LCDM36 LCD memory 36 (S36) Read/write Unchanged
045h LCDM37 LCD memory 37 (S37) Read/write Unchanged
046h LCDM38W LCD memory 38 Word (S39, S38) Read/write Unchanged
046h LCDM38 LCD memory 38 (S38) Read/write Unchanged
047h LCDM39 LCD memory 39 (S39) Read/write Unchanged
048h LCDM40W LCD memory 40 Word (S41, S40) Read/write Unchanged
048h LCDM40 LCD memory 40 (S40) Read/write Unchanged
049h LCDM41 LCD memory 41 (S41) Read/write Unchanged
04Ah LCDM42W LCD memory 42 Word (S43, S42) Read/write Unchanged
04Ah LCDM42 LCD memory 42 (S42) Read/write Unchanged
04Bh LCDM43 LCD memory 43 (S43) Read/write Unchanged
04Ch LCDM44W LCD memory 44 Word (S45, S44) Read/write Unchanged
04Ch LCDM44 LCD memory 44 (S44) Read/write Unchanged
04Dh LCDM45 LCD memory 45 (S45) Read/write Unchanged
04Eh LCDM46W LCD memory 46 Word (S47, S46) Read/write Unchanged
04Eh LCDM46 LCD memory 46 (S46) Read/write Unchanged
04Fh LCDM47 LCD memory 47 (S47) Read/write Unchanged
050h LCDM48W LCD memory 48 Word (S49, S48) Read/write Unchanged
050h LCDM48 LCD memory 48 (S48) Read/write Unchanged
051h LCDM49 LCD memory 49 (S49) Read/write Unchanged
052h LCDM50W LCD memory 50 Word (S51, S50) Read/write Unchanged
052h LCDM50 LCD memory 50 (S50) Read/write Unchanged
053h LCDM51 LCD memory 51 (S51) Read/write Unchanged
054h LCDM52W LCD memory 52 Word (S53, S52) Read/write Unchanged
054h LCDM52 LCD memory 52 (S52) Read/write Unchanged
055h LCDM53 LCD memory 53 (S53) Read/write Unchanged
056h LCDM54W LCD memory 54 Word (S55, S54) Read/write Unchanged
056h LCDM54 LCD memory 54 (S54) Read/write Unchanged
057h LCDM55 LCD memory 55 (S55) Read/write Unchanged
058h LCDM56W LCD memory 56 Word (S57, S56) Read/write Unchanged
058h LCDM56 LCD memory 56 (S56) Read/write Unchanged
059h LCDM57 LCD memory 57 (S57) Read/write Unchanged
05Ah LCDM58W LCD memory 58 Word (S59, S58) Read/write Unchanged
05Ah LCDM58 LCD memory 58 (S58) Read/write Unchanged
05Bh LCDM59 LCD memory 59 (S59) Read/write Unchanged
05Ch LCDM60W LCD memory 60 Word (S61, S60) Read/write Unchanged
05Ch LCDM60 LCD memory 60 (S60) Read/write Unchanged
Table 16-9. LCD Memory Registers for 5-Mux to 8-Mux Modes (1) (2) (continued)
Offset Acronym Register Name Type Reset
05Dh LCDM61 LCD memory 61 (S61) Read/write Unchanged
05Eh LCDM62W LCD memory 62 Word (S63, S62) Read/write Unchanged
05Eh LCDM62 LCD memory 62 (S62) Read/write Unchanged
05Fh LCDM63 LCD memory 63 (S63) Read/write Unchanged
(1)
To use LCD, an external resistor divider must be connected to R13, R23, and R33.
The Enhanced Comparator (eCOMP) module is an analog voltage comparator with an internal reference
DAC. The eCOMP supports general comparator functionality for up to 7 channels including 4 external
inputs, 2 internal inputs, and 1 for a reference DAC output. eCOMP also implements programmable
hysteresis and configurable power modes. This chapter describes the eCOMP.
496 Enhanced Comparator (eCOMP) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eCOMP Introduction
C0 000
C1 001
CPPEN
C2 010
C3 011 CPEN
Device Specific 100
Device Specific 101
110
Reserved 111 CPINV CPOUT
0
Analog To Timer CPTM
LPF
1
Edge
Detection 0
000 Circuit 1
001
CPNEN CPMSEL CPHSEL CPFLTDLY CPFLT
CPIES
010 CPIE
011 CPIFG
CPNSEL
CPDACREFS
SLAU445G – October 2014 – Revised August 2016 Enhanced Comparator (eCOMP) 497
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eCOMP Operation www.ti.com
17.2.1 eCOMP
The eCOMP compares the analog voltages at the positive (V+) and negative (V–) input terminals. If the
V+ terminal is higher than the V– terminal, the eCOMP output CPOUT is high. The eCOMP output is
connected to an optional analog low-pass filter and edge detection module for different trigger conditions.
The eCOMP is enabled or disabled using control bit CPEN. The eCOMP output is controlled by CPEN bit.
The bias current of the eCOMP has two programmable modes (CPMSEL bit): high-power mode (high
speed) and low-power (low speed) mode. The eCOMP integrates a 6-bit DAC as the reference voltage
input, and this DAC has a dual buffer and on-chip reference voltage selection features.
+ Terminal
Comparator Output
Unfiltered at CPOUT
Comparator Output
Filtered at CPOUT
498 Enhanced Comparator (eCOMP) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eCOMP Operation
CPDACBUF1 CPDACBUF2
6-bit 6-bit
0
0 1
1 CPDACSW
6-bit
CPDACBUFS
CPDACREFS
SLAU445G – October 2014 – Revised August 2016 Enhanced Comparator (eCOMP) 499
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eCOMP Interrupts www.ti.com
6-bit
CPDACBUFS
CPDACEN
COMPREF
500 Enhanced Comparator (eCOMP) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eCOMP Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Comparator (eCOMP) 501
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eCOMP Registers www.ti.com
502 Enhanced Comparator (eCOMP) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eCOMP Registers
(1)
Both bit 15 and bit 14 must be asserted for dual-edge mode.
(2)
The filter delay values are only valid in HP mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Comparator (eCOMP) 503
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eCOMP Registers www.ti.com
504 Enhanced Comparator (eCOMP) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eCOMP Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Comparator (eCOMP) 505
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eCOMP Registers www.ti.com
506 Enhanced Comparator (eCOMP) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 18
SLAU445G – October 2014 – Revised August 2016
The TIA module is a transimpedance amplifier. This chapter describes the TIA functionality and features.
NOTE: The transimpedance amplifier was originally given an abbreviation of TRI for use in
descriptive text, pin names, and register names. The abbreviation has been changed to TIA
in all descriptive text, but pin names and register names still use TRI.
SLAU445G – October 2014 – Revised August 2016 Transimpedance Amplifier (TIA) 507
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
TIA Introduction www.ti.com
OPAx
TRIx- TRIPM
COMP
TRIx+ 00
TIA ADC
Device Specific 01
Device Specific 10
Reserved 11
TRIEN
TRIPSEL
508 Transimpedance Amplifier (TIA) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com TIA Operation
TRIO
Rf
OAx
TRI- TRIPM
COMP
TRI+ 00
TIA ADC
Device Specific 01
Device Specific 10
Reserved
11
TRIPSEL TRIEN
SLAU445G – October 2014 – Revised August 2016 Transimpedance Amplifier (TIA) 509
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
TIA Registers www.ti.com
510 Transimpedance Amplifier (TIA) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 19
SLAU445G – October 2014 – Revised August 2016
The Smart Analog Combo (SAC) integrates a high-performance low-power operational amplifier, up to 33x
gain PGA, and a 12-bit digital-to-analog converter (DAC) core. The SAC can be used for signal
conditioning for either input or output path. This chapter describes SAC functionality and features.
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 511
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Introduction www.ti.com
512 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Introduction
OAx−
To other peripherals
OAx+
reference
00
12-bit
Reference 01
DAC
10 OA OAxO
00
01
10
Noninverting
Amplifying (10)
Paired OA
Output (11)
MSEL GAIN
From paired
SAC output
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 513
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Operation www.ti.com
19.2.1 SAC OA
SAC integrates a high-performance low-power rail-to-rail output operational amplifier. This OA can be
configured to work independently in general purpose (GP) mode. The OA output slew rate can be
configured for optimized settling time and power consumption with the OAxPM bit. See the device-specific
data sheet for parameters.
514 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Operation
OAx+
00
12-bit
Reference 01 +
DAC
10 OA OAxO
−
00
01
10
Noninverting
Amplifying (10)
Paired OA
Output (11)
MSEL GAIN
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 515
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Operation www.ti.com
OAx+
00
12-bit
Reference 01 +
DAC
10 OA OAxO
−
00
01
10
Noninverting
Amplifying (10)
Paired OA
Output (11)
MSEL GAIN
516 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Operation
OAx+
00
12-bit
Reference 01 +
DAC
10 OA OAxO
−
00
01
10
Noninverting
Amplifying (10)
Paired OA
Output (11)
MSEL GAIN
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 517
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Operation www.ti.com
OAx+
00
12-bit
Reference 01 +
DAC
10 OA OAxO
−
00
01
10
Noninverting
Amplifying (10)
Paired OA
Output (11)
MSEL GAIN
518 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Operation
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 519
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Operation www.ti.com
Primary Reference 0
Secondary Reference 1
Vref+
DAC DAC
Data 12 bit Latch 12 bit 12-bit DAC
Core To OA
Register Register
Vref–
Reserved 01 R
520 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Operation
When DAC output is enabled (DACEN = 1b), the maximum DACDAT value is 0FFFh, which leads to a rail
output of (4095 ÷ 4096) × Vref. The minimum DACDAT value is 0000h, which outputs ground. A value
greater than 4095 can be written to the register, but all leading bits are ignored.
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 521
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Configuration www.ti.com
522 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Registers
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 523
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Registers www.ti.com
524 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Registers
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 525
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Registers www.ti.com
526 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Registers
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 527
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
SAC Registers www.ti.com
528 Smart Analog Combo (SAC) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com SAC Registers
SLAU445G – October 2014 – Revised August 2016 Smart Analog Combo (SAC) 529
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 20
SLAU445G – October 2014 – Revised August 2016
ADC Module
The ADC module is a high-performance 10-bit or 12-bit analog-to-digital converter (ADC). See the device-
specific data sheet to determine the resolution supported by a device. This chapter describes the
operation of the ADC module.
ADCSR
Auto ADCCONSEQx
10
Reference
Buffer From on-chip
01
Reference Voltage
A0 0000
A2 0010
ADC ADC
A3 0011 1 0 11 10 01 00
SREF2 SREFx
ADC
A4 0100 ADCON ADCDIVx ADCPDIVx
SSELx
A5 0101
A10 1010
ADC ADC
ADCCLK
MSC SHTx
A11 1011
A12 1100
ADC
00 ADCSC
BUSY
A13 1101
Sample Timer Timer Trigger 0
1 01
÷4 – ÷1024 Sync
A14 1110 1
0 10 Timer Trigger 1
A15 1111 0
ADCDF 11 Timer Trigger 2
ADC
SHP ADC ADC
ISSH SHSx
ADCHIx
Data Format
ADCLOx
ADCMEM
A The MODOSC is part of the Clock System. See the Clock System chapter for more information.
B When using ADCSHP = 0, no synchronisation of the trigger input is done.
Figure 20-1. ADC Block Diagram
The ADC core is configured by the control registers ADCCTL0, ADCCTL1, and ADCCTL2. The core is
enabled with the ADCON bit. The ADC can be turned off when not in use to save power. With few
exceptions, the ADC control bits can be modified only when ADCENC = 0. ADCENC must be set to 1
before any conversion can take place.
Input
Ax
ESD Protection
SHI
SAMPCON 12 × ADCCLK
tsample tconvert
tsync
ADCCLK
SHI
SAMPCON 14 × ADCCLK
tsample tconvert
tsync
ADCCLK
SHI
SAMPCON 12 × ADCCLK
tsample tconvert
tsync
ADCCLK
SHI
SAMPCON 14 × ADCCLK
tsample tconvert
tsync
ADCCLK
MSP430
VI = Input voltage at pin Ax
VS = External source voltage
RS VI RI RS = External source resistance
VS VC RI = Internal MUX-on input resistance
CI = Input capacitance
Cpint = Parasitic capacitance, internal
Cpext Cpint CI CPext = Parasitic capacitance, external
VC = Capacitance-charging voltage
The resistance of the sources (RS and RI) affects tsample. See the device-specific data sheet for the tsample
limits.
ADCCONSEQx = 00 ADC
off
ADCON = 1
ADCENC
x = ADCINCHx
Wait for Enable
ADCENC =
ADCSHSx = 0
and ADCENC =
ADCENC = 1 or
and
ADCSC = Wait for Trigger
SAMPCON =
ADCENC = 0
SAMPCON = 1
Sample Input
Channel x
ADCENC = 0 *
SAMPCON =
10 × ADCCLK
Convert
ADCENC = 0 *
1 × ADCCLK
Conversion
Completed,
Result Stored Into
ADCMEM0,
ADCIFG0 is Set
ADCCONSEQx = 00 ADC
off
ADCON = 1
ADCENC
x = ADCINCHx
Wait for Enable
ADCENC =
ADCSHSx = 0
and ADCENC =
ADCENC = 1 or
and
ADCSC = Wait for Trigger
SAMPCON =
ADCENC = 0
SAMPCON = 1
Sample Input
Channel x
ADCENC = 0 *
SAMPCON =
12 × ADCCLK
Convert
ADCENC = 0 *
1 × ADCCLK
Conversion
Completed,
Result Stored Into
ADCMEM0,
ADCIFG0 is Set
ADCCONSEQx = 01 ADC
off
ADCON = 1
ADCENC
x = ADCINCHx
Wait for Enable
ADCENC =
ADCSHSx = 0 ADCENC =
and
ADCENC = 1 or
and Wait for Trigger
ADCSC =
SAMPCON = x=0
SAMPCON = 1
Sample Input
Channel x
If x > 0 then x = x - 1
x=x-1 x=x-1
SAMPCON =
10 × ADCCLK
(ADCMSC = 0
Convert or
ADCMSC = 1
ADCSHP = 0)
and
and
ADCSHP = 1 1 × ADCCLK x 0
and
x 0
Conversion
Completed,
Result Stored Into
ADCMEM0,
ADCIFG0 is set
x = Input channel Ax
All bit and register names are in bold font; signals are in normal font.
ADCCONSEQx = 01 ADC
off
ADCON = 1
ADCENC
x = ADCINCHx
Wait for Enable
ADCENC =
ADCSHSx = 0 ADCENC =
and
ADCENC = 1 or
and Wait for Trigger
ADCSC =
SAMPCON = x=0
SAMPCON = 1
Sample Input
Channel x
If x > 0 then x = x - 1
x=x-1 x=x-1
SAMPCON =
12 × ADCCLK
(ADCMSC = 0
Convert or
ADCMSC = 1
ADCSHP = 0)
and
and
ADCSHP = 1 1 × ADCCLK x 0
and
x 0
Conversion
Completed,
Result Stored Into
ADCMEM0,
ADCIFG0 is set
x = Input channel Ax
All bit and register names are in bold font; signals are in normal font.
ADCCONSEQx = 10 ADC
off
ADCON = 1
ADCENC
x = ADCINCHx
Wait for Enable
ADCENC
ADCSHSx = 0 ADCENC =
and =
ADCENC = 1 or
and
ADCSC = Wait for Trigger
SAMPCON = ADCENC = 0
SAMPCON = 1
Sample Input
Channel x
SAMPCON = 10 × ADCCLK
(ADCMSC = 0
ADCMSC = 1 Convert or
and ADCSHP = 0)
ADCSHP = 1 and
and 1 × ADCCLK
ADCENC = 1
ADCENC = 1
Conversion
Completed,
Result Stored Into
ADCMEM0,
ADCIFG0 is Set
ADCCONSEQx = 10 ADC
off
ADCON = 1
ADCENC
x = ADCINCHx
Wait for Enable
ADCENC
ADCSHSx = 0 ADCENC =
and =
ADCENC = 1 or
and
ADCSC = Wait for Trigger
SAMPCON = ADCENC = 0
SAMPCON = 1
Sample Input
Channel x
SAMPCON = 12 × ADCCLK
(ADCMSC = 0
ADCMSC = 1 Convert or
and ADCSHP = 0)
ADCSHP = 1 and
and 1 × ADCCLK
ADCENC = 1
ADCENC = 1
Conversion
Completed,
Result Stored Into
ADCMEM0,
ADCIFG0 is Set
ADCCONSEQx = 11 ADC
off
ADCON = 1
ADCENC
ADCINCHx
Wait for Enable
ADCENC =
ADCSHSx = 0 ADCENC =
and
ADCENC = 1 or
and Wait for Trigger
ADCSC =
ADCENC = 0
SAMPCON = and
x=0
SAMPCON = 1
Sample Input
Channel x
If x > 0 then x = x - 1 If x > 0 then x = x - 1
else else
SAMPCON
x = ADCINCHx x = ADCINCHx
=
10 × ADCCLK
(ADCMSC = 0
Convert
or
ADCMSC = 1 ADCSHP = 0)
and and
ADCSHP = 1 (ADCENC = 1
and 1 × ADCCLK or
(ADCENC = 1 x¹0
or Conversion Completed,
x 0) Result Stored Into
ADCMEM0,
ADCIFG0 is Set
x = Input channel Ax
All bit and register names are in bold font; signals are in normal font.
ADCCONSEQx = 11 ADC
off
ADCON = 1
ADCENC
ADCINCHx
Wait for Enable
ADCENC =
ADCSHSx = 0 ADCENC =
and
ADCENC = 1 or
and Wait for Trigger
ADCSC =
ADCENC = 0
SAMPCON = and
x=0
SAMPCON = 1
Sample Input
Channel x
If x > 0 then x = x - 1 If x > 0 then x = x - 1
else else
SAMPCON
x = ADCINCHx x = ADCINCHx
=
12 × ADCCLK
(ADCMSC = 0
Convert
or
ADCMSC = 1 ADCSHP = 0)
and and
ADCSHP = 1 (ADCENC = 1
and 1 × ADCCLK or
(ADCENC = 1 x 0
or Conversion Completed,
x 0) Result Stored Into
ADCMEM0,
ADCIFG0 is Set
x = Input channel Ax
All bit and register names are in bold font; signals are in normal font.
1200
Temperature Sensor Voltage (mV)
1000
800
600
400
200
0
-40 -20 0 20 40 60 80 100
Temperature (°C)
DVCC
Power Supply +
Decoupling
DVSS
10 µF 100 nF
Can be modified only when ADCENC = 0. Resetting ADCENC = 0 by software and changing these fields immediately
shows an effect when a conversion is active.
Can be modified only when ADCENC = 0. Resetting ADCENC = 0 by software and changing these fields immediately
shows an effect when a conversion is active.
The enhanced universal serial communication interface A (eUSCI_A) supports multiple serial
communication modes with one hardware module. This chapter describes the operation of the
asynchronous UART mode.
21.1 Enhanced Universal Serial Communication Interface A (eUSCI_A) Overview .......... 565
21.2 eUSCI_A Introduction – UART Mode ................................................................... 565
21.3 eUSCI_A Operation – UART Mode ...................................................................... 567
21.4 eUSCI_A UART Registers .................................................................................. 582
564 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Enhanced Universal Serial Communication Interface A (eUSCI_A) Overview
Figure 21-1 shows the eUSCI_Ax when configured for UART mode.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 565
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Introduction – UART Mode www.ti.com
UCABEN
UCSSELx
Receive Baudrate Generator
UC0BRx
UCLK 00 16
Device specific 01 Receive Clock
Prescaler/Divider
SMCLK 10 BRCLK
SMCLK 11 Modulator Transmit Clock
4 8
UCBRFx UCBRSx UCOS16
2
UCMODEx UCSPB
566 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 567
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Operation – UART Mode www.ti.com
Blocks of
characters
UCAxTXD
UCAxRXD
UCAxTXD
UCAxRXD
The UCDORM bit is used to control data reception in the idle-line multiprocessor format. When
UCDORM = 1, all nonaddress characters are assembled but not transferred into the UCAxRXBUF, and
interrupts are not generated. When an address character is received, the character is transferred into
UCAxRXBUF, UCRXIFG is set, and any applicable error flag is set when UCRXEIE = 1. When
UCRXEIE = 0 and an address character is received but has a framing error or parity error, the character is
not transferred into UCAxRXBUF, and UCRXIFG is not set.
If an address is received, user software can validate the address and must reset UCDORM to continue
receiving data. If UCDORM remains set, only address characters are received. When UCDORM is cleared
during the reception of a character, the receive interrupt flag is set after the reception completes. The
UCDORM bit is not modified automatically by the eUSCI_A hardware.
For address transmission in idle-line multiprocessor format, a precise idle period can be generated by the
eUSCI_A to generate address character identifiers on UCAxTXD. The double-buffered UCTXADDR flag
indicates if the next character loaded into UCAxTXBUF is preceded by an idle line of 11 bits. UCTXADDR
is automatically cleared when the start bit is generated.
568 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
UCAxTXD
UCAxRXD
UCAxTXD
ST Address 1 SP ST Data 0 SP ST Data 0 SP
UCAxRXD
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 569
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Operation – UART Mode www.ti.com
For LIN conformance, the character format should be set to eight data bits, LSB first, no parity, and one
stop bit. No address bit is available.
The synch field consists of the data 055h inside a byte field (see Figure 21-6). The synchronization is
based on the time measurement between the first falling edge and the last falling edge of the pattern. The
transmit baud-rate generator is used for the measurement if automatic baud-rate detection is enabled by
setting UCABDEN. Otherwise, the pattern is received but not measured. The result of the measurement is
transferred into the baud-rate control registers (UCAxBRW and UCAxMCTLW). If the length of the synch
field exceeds the measurable time, the synch timeout error flag UCSTOE is set. The result can be read
after the receive interrupt flag UCRXIFG is set.
Synch
8 Bit Times
Start Stop
0 1 2 3 4 5 6 7
Bit Bit
Figure 21-6. Auto Baud-Rate Detection – Synch Field
The UCDORM bit is used to control data reception in this mode. When UCDORM is set, all characters are
received but not transferred into the UCAxRXBUF, and interrupts are not generated. When a break/synch
field is detected, the UCBRK flag is set. The character following the break/synch field is transferred into
UCAxRXBUF and the UCRXIFG interrupt flag is set. Any applicable error flag is also set. If the UCBRKIE
bit is set, reception of the break/synch sets the UCRXIFG. The UCBRK bit is reset by user software or by
reading the receive buffer UCAxRXBUF.
When a break/synch field is received, user software must reset UCDORM to continue receiving data. If
UCDORM remains set, only the character after the next reception of a break/synch field is received. The
UCDORM bit is not modified by the eUSCI_A hardware automatically.
When UCDORM = 0, all received characters set the receive interrupt flag UCRXIFG. If UCDORM is
cleared during the reception of a character, the receive interrupt flag is set after the reception is complete.
The counter used to detect the baud rate is limited to 0FFFFh (216) counts. This means the minimum baud
rate detectable is 244 baud in oversampling mode and 15 baud in low-frequency mode. The highest
detectable baud rate is 1 Mbaud.
The automatic baud-rate detection mode can be used in a full-duplex communication system with some
restrictions. The eUSCI_A cannot transmit data while receiving the break/sync field and, if a 0h byte with
framing error is received, any data transmitted during this time is corrupted. The latter case can be
discovered by checking the received data and the UCFE bit.
570 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
UART
IrDA
To set the pulse time of 3/16 bit period required by the IrDA standard, the BITCLK16 clock is selected with
UCIRTXCLK = 1, and the pulse length is set to six one-half clock cycles with UCIRTXPLx = 6 – 1 = 5.
When UCIRTXCLK = 0, the pulse length tPULSE is based on BRCLK and is calculated as:
UCIRTXPLx = tPULSE × 2 × fBRCLK – 1
When UCIRTXCLK = 0, the prescaler UCBRx must be set to a value greater or equal to 5.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 571
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Operation – UART Mode www.ti.com
When UCRXEIE = 0 and a framing error or parity error is detected, no character is received into
UCAxRXBUF. When UCRXEIE = 1, characters are received into UCAxRXBUF and any applicable error
bit is set.
When any of the UCFE, UCPE, UCOE, UCBRK, or UCRXERR bit is set, the bit remains set until user
software resets it or UCAxRXBUF is read. UCOE must be reset by reading UCAxRXBUF. Otherwise, it
does not function properly. To detect overflows reliably, the following flow is recommended. After a
character is received and UCAxRXIFG is set, first read UCAxSTATW to check the error flags including the
overflow flag UCOE. Read UCAxRXBUF next. This clears all error flags except UCOE, if UCAxRXBUF
was overwritten between the read access to UCAxSTATW and to UCAxRXBUF. Therefore, the UCOE flag
should be checked after reading UCAxRXBUF to detect this condition. Note that, in this case, the
UCRXERR flag is not set.
572 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
UCAxRXD
URXS
tt
When a glitch is longer than tt, or a valid start bit occurs on UCAxRXD, the eUSCI_A receive operation is
started and a majority vote is taken (see Figure 21-9). If the majority vote fails to detect a start bit, the
eUSCI_A halts character reception.
Majority Vote Taken
UCAxRXD
URXS
tt
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 573
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Operation – UART Mode www.ti.com
BRCLK
BITCLK
Bit Period
m: corresponding modulation bit
R: Remainder from N/2 division
Figure 21-10. BITCLK Baud-Rate Timing With UCOS16 = 0
Modulation is based on the UCBRSx setting as shown in Table 21-2. A 1 in the table indicates that m = 1
and the corresponding BITCLK period is one BRCLK period longer than a BITCLK period with m = 0. The
modulation wraps around after 8 bits but restarts with each new start bit.
574 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 575
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Operation – UART Mode www.ti.com
Table 21-4 can be used as a lookup table for finding the correct UCBRSx modulation pattern for the
corresponding fractional part of N. The values there are optimized for transmitting.
576 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
( (
15
1
tbit,TX[i] =
fBRCLK (16 × UCBRx) + mUCBRFx[j] + mUCBRSx[i]
j=0
Where:
15
mUCBRFx[j]
≤ j=0 = Sum of ones from the corresponding row in Table 21-3
mUCBRSx[i] = Modulation of bit i of UCBRSx
This results in an end-of-bit time tbit,TX[i] equal to the sum of all previous and the current bit times:
i
tbit,TX[i] = St
j=0
[j]
bit,TX
To calculate bit error, this time is compared to the ideal bit time tbit,ideal,TX[i]:
tbit,ideal,TX[i] = (1/Baud Rate)(i + 1)
This results in an error normalized to one ideal bit time (1/baud rate):
ErrorTX[i] = (tbit,TX[i] – tbit,ideal,TX[i]) × Baud Rate × 100%
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 577
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Operation – UART Mode www.ti.com
i 0 1 2
tideal t0 t1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7
BRCLK
UCAxRXD ST D0 D1
RXD synch. ST D0 D1
tactual t0 t1 t2
Synchronization Error ± 0.5x BRCLK
Sample
RXD synch.
Where:
tbit,RX[i] = (1/fBRCLK)(UCBRx + mUCBRSx[i])
mUCBRSx[i] = Modulation of bit i of UCBRSx
For the oversampling baud-rate mode, the sampling time tbit,RX[i] of bit i is calculated by:
i–1 7
1
tbit,RX[i] = tSYNC +
j=0
Tbit,RX[j] + (
fBRCLK (8 * UCBRx) + j=0
(
mUCBRFx[j] + mUCBRSx[i]
Where:
( (
15
1
tbit,RX[i] =
fBRCLK (16 × UCBRx) + mUCBRFx[j] + mUCBRSx[i]
j=0
7 +mUCBRSx [i]
å mUCBRFx [j]
j=0 = Sum of ones from columns 0 to (7 + mUCBRSx[i]) from the corresponding row in
Table 21-3.
mUCBRSx[i] = Modulation of bit i of UCBRSx
This results in an error normalized to one ideal bit time (1/baud rate) according to the following formula:
ErrorRX[i] = (tbit,RX[i] – tbit,ideal,RX[i]) × Baud Rate × 100%
578 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
The receive error is the accumulated time versus the ideal scanning time in the middle of each bit. The
worst-case error is given for the reception of an 8-bit character with parity and one stop bit including
synchronization error.
The transmit error is the accumulated timing error versus the ideal time of the bit period. The worst-case
error is given for the transmission of an 8-bit character with parity and stop bit.
Table 21-5. Recommended Settings for Typical Crystals and Baud Rates (1)
TX Error (%) (2) RX Error (%) (2)
BRCLK Baud Rate UCOS16 UCBRx UCBRFx UCBRSx
neg pos neg pos
32768 1200 1 1 11 0x25 -2.29 2.25 -2.56 5.35
32768 2400 0 13 – 0xB6 -3.12 3.91 -5.52 8.84
32768 4800 0 6 – 0xEE -7.62 8.98 -21 10.25
32768 9600 0 3 – 0x92 -17.19 16.02 -23.24 37.3
1000000 9600 1 6 8 0x20 -0.48 0.64 -1.04 1.04
1000000 19200 1 3 4 0x2 -0.8 0.96 -1.84 1.84
1000000 38400 1 1 10 0x0 0 1.76 0 3.44
1000000 57600 0 17 – 0x4A -2.72 2.56 -3.76 7.28
1000000 115200 0 8 – 0xD6 -7.36 5.6 -17.04 6.96
1048576 9600 1 6 13 0x22 -0.46 0.42 -0.48 1.23
1048576 19200 1 3 6 0xAD -0.88 0.83 -2.36 1.18
1048576 38400 1 1 11 0x25 -2.29 2.25 -2.56 5.35
1048576 57600 0 18 – 0x11 -2 3.37 -5.31 5.55
1048576 115200 0 9 – 0x08 -5.37 4.49 -5.93 14.92
4000000 9600 1 26 0 0xB6 -0.08 0.16 -0.28 0.2
4000000 19200 1 13 0 0x84 -0.32 0.32 -0.64 0.48
4000000 38400 1 6 8 0x20 -0.48 0.64 -1.04 1.04
4000000 57600 1 4 5 0x55 -0.8 0.64 -1.12 1.76
4000000 115200 1 2 2 0xBB -1.44 1.28 -3.92 1.68
4000000 230400 0 17 – 0x4A -2.72 2.56 -3.76 7.28
4194304 9600 1 27 4 0xFB -0.11 0.1 -0.33 0
4194304 19200 1 13 10 0x55 -0.21 0.21 -0.55 0.33
4194304 38400 1 6 13 0x22 -0.46 0.42 -0.48 1.23
4194304 57600 1 4 8 0xEE -0.75 0.74 -2 0.87
4194304 115200 1 2 4 0x92 -1.62 1.37 -3.56 2.06
4194304 230400 0 18 – 0x11 -2 3.37 -5.31 5.55
8000000 9600 1 52 1 0x49 -0.08 0.04 -0.1 0.14
8000000 19200 1 26 0 0xB6 -0.08 0.16 -0.28 0.2
8000000 38400 1 13 0 0x84 -0.32 0.32 -0.64 0.48
8000000 57600 1 8 10 0xF7 -0.32 0.32 -1 0.36
8000000 115200 1 4 5 0x55 -0.8 0.64 -1.12 1.76
8000000 230400 1 2 2 0xBB -1.44 1.28 -3.92 1.68
8000000 460800 0 17 – 0x4A -2.72 2.56 -3.76 7.28
8388608 9600 1 54 9 0xEE -0.06 0.06 -0.11 0.13
8388608 19200 1 27 4 0xFB -0.11 0.1 -0.33 0
8388608 38400 1 13 10 0x55 -0.21 0.21 -0.55 0.33
8388608 57600 1 9 1 0xB5 -0.31 0.31 -0.53 0.78
8388608 115200 1 4 8 0xEE -0.75 0.74 -2 0.87
(1)
The listed UCBRSx settings are determined by a search algorithm for the lowest error. Other settings for UCBRSx might result in
similar or same errors.
(2)
Assumes a stable clock source for BRCLK with negligible jitter (for example, from a crystal oscillator). Any frequency variation or
jitter of the clock source will make the errors worse.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 579
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A Operation – UART Mode www.ti.com
Table 21-5. Recommended Settings for Typical Crystals and Baud Rates (1) (continued)
TX Error (%) (2) RX Error (%) (2)
BRCLK Baud Rate UCOS16 UCBRx UCBRFx UCBRSx
neg pos neg pos
8388608 230400 1 2 4 0x92 -1.62 1.37 -3.56 2.06
8388608 460800 0 18 – 0x11 -2 3.37 -5.31 5.55
12000000 9600 1 78 2 0x0 0 0 0 0.04
12000000 19200 1 39 1 0x0 0 0 0 0.16
12000000 38400 1 19 8 0x65 -0.16 0.16 -0.4 0.24
12000000 57600 1 13 0 0x25 -0.16 0.32 -0.48 0.48
12000000 115200 1 6 8 0x20 -0.48 0.64 -1.04 1.04
12000000 230400 1 3 4 0x2 -0.8 0.96 -1.84 1.84
12000000 460800 1 1 10 0x0 0 1.76 0 3.44
16000000 9600 1 104 2 0xD6 -0.04 0.02 -0.09 0.03
16000000 19200 1 52 1 0x49 -0.08 0.04 -0.1 0.14
16000000 38400 1 26 0 0xB6 -0.08 0.16 -0.28 0.2
16000000 57600 1 17 5 0xDD -0.16 0.2 -0.3 0.38
16000000 115200 1 8 10 0xF7 -0.32 0.32 -1 0.36
16000000 230400 1 4 5 0x55 -0.8 0.64 -1.12 1.76
16000000 460800 1 2 2 0xBB -1.44 1.28 -3.92 1.68
16777216 9600 1 109 3 0xB5 -0.03 0.02 -0.05 0.06
16777216 19200 1 54 9 0xEE -0.06 0.06 -0.11 0.13
16777216 38400 1 27 4 0xFB -0.11 0.1 -0.33 0
16777216 57600 1 18 3 0x44 -0.16 0.15 -0.2 0.45
16777216 115200 1 9 1 0xB5 -0.31 0.31 -0.53 0.78
16777216 230400 1 4 8 0xEE -0.75 0.74 -2 0.87
16777216 460800 1 2 4 0x92 -1.62 1.37 -3.56 2.06
20000000 9600 1 130 3 0x25 -0.02 0.03 0 0.07
20000000 19200 1 65 1 0xD6 -0.06 0.03 -0.1 0.1
20000000 38400 1 32 8 0xEE -0.1 0.13 -0.27 0.14
20000000 57600 1 21 11 0x22 -0.16 0.13 -0.16 0.38
20000000 115200 1 10 13 0xAD -0.29 0.26 -0.46 0.66
20000000 230400 1 5 6 0xEE -0.67 0.51 -1.71 0.62
20000000 460800 1 2 11 0x92 -1.38 0.99 -1.84 2.8
21.3.14 Using the eUSCI_A Module in UART Mode With Low-Power Modes
The eUSCI_A module provides automatic clock activation for use with low-power modes. When the
eUSCI_A clock source is inactive because the device is in a low-power mode, the eUSCI_A module
automatically activates it when needed, regardless of the control-bit settings for the clock source. The
clock remains active until the eUSCI_A module returns to its idle condition. After the eUSCI_A module
returns to the idle condition, control of the clock source reverts to the settings of its control bits.
580 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A Operation – UART Mode
UCTXIFG is set after a PUC or when UCSWRST = 1. UCTXIE is reset after a PUC or when
UCSWRST = 1.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 581
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A UART Registers www.ti.com
582 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A UART Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 583
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A UART Registers www.ti.com
584 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A UART Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 585
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A UART Registers www.ti.com
586 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A UART Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 587
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A UART Registers www.ti.com
588 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A UART Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 589
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A UART Registers www.ti.com
590 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A UART Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode 591
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A UART Registers www.ti.com
592 Enhanced Universal Serial Communication Interface (eUSCI) – UART Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 22
SLAU445G – October 2014 – Revised August 2016
The enhanced universal serial communication interfaces, eUSCI_A and eUSCI_B, support multiple serial
communication modes with one hardware module. This chapter describes the operation of the
synchronous peripheral interface (SPI) mode.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 593
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Enhanced Universal Serial Communication Interfaces (eUSCI_A, eUSCI_B) Overview www.ti.com
594 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI Introduction – SPI Mode
UCLISTEN UCMST
Receive Buffer UC xRXBUF
UCxSOMI
1
0
Receive Shift Register 0
1
UCMSB UC7BIT
UCSSELx
Bit Clock Generator
UCxBRx UCCKPH UCCKPL
N/A 00 16
Device Specific 01 UCxCLK
Clock Direction,
Prescaler/Divider
SMCLK 10 BRCLK Phase and Polarity
SMCLK 11
UCMSB UC7BIT
UCxSIMO
Transmit Shift Register
UCMODEx UCSTEM
2 UCxSTE
Transmit Buffer UC xTXBUF
Transmit Enable
Control Set UCFE
Transmit State Machine
Set UCxTXIFG
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 595
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI Operation – SPI Mode www.ti.com
596 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI Operation – SPI Mode
Px.x STE
SS
UCxSTE
Port.x
UCx
SOMI SOMI
Receive Shift Register Transmit Shift Register Data Shift Register (DSR)
UCxCLK SCLK
MSP430 USCI COMMON SPI
The eUSCI initiates data transfer when data is moved to the transmit data buffer UCxTXBUF. The
UCxTXBUF data is moved to the transmit (TX) shift register when the TX shift register is empty, initiating
data transfer on UCxSIMO starting with either the MSB or LSB, depending on the UCMSB setting. Data
on UCxSOMI is shifted into the receive shift register on the opposite clock edge. When the character is
received, the receive data is moved from the receive (RX) shift register to the received data buffer
UCxRXBUF and the receive interrupt flag UCRXIFG is set, indicating that the RX or TX operation is
complete.
A set transmit interrupt flag, UCTXIFG, indicates that data has moved from UCxTXBUF to the TX shift
register and UCxTXBUF is ready for new data. It does not indicate RX or TX completion.
To receive data into the eUSCI in master mode, data must be written to UCxTXBUF, because receive and
transmit operations operate concurrently.
There two different options for configuring the eUSCI as a 4-pin master, which are described in the
following sections:
• The fourth pin is used as input to prevent conflicts with other masters (UCSTEM = 0).
• The fourth pin is used as output to generate a slave enable signal (UCSTEM = 1).
The bit UCSTEM is used to select the corresponding mode.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 597
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI Operation – SPI Mode www.ti.com
Receive Buffer
SPI Receive Buffer Transmit Buffer UCxTXBUF UCxRXBUF
Px.x UCxSTE
SS
STE
Port.x
UCx
SOMI SOMI
Data Shift Register DSR Transmit Shift Register Receive Shift Register
SCLK UCxCLK
COMMON SPI MSP430 USCI
UCxCLK is used as the input for the SPI clock and must be supplied by the external master. The data-
transfer rate is determined by this clock and not by the internal bit clock generator. Data written to
UCxTXBUF and moved to the TX shift register before the start of UCxCLK is transmitted on UCxSOMI.
Data on UCxSIMO is shifted into the receive shift register on the opposite edge of UCxCLK and moved to
UCxRXBUF when the set number of bits are received. When data is moved from the RX shift register to
UCxRXBUF, the UCRXIFG interrupt flag is set, indicating that data has been received. The overrun error
bit UCOE is set when the previously received data is not read from UCxRXBUF before new data is moved
to UCxRXBUF.
598 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI Operation – SPI Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 599
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI Operation – SPI Mode www.ti.com
UC UC Cycle# 1 2 3 4 5 6 7 8
CKPH CKPL
0 0 UCxCLK
0 1 UCxCLK
1 0 UCxCLK
1 1 UCxCLK
UCxSTE
UCxSIMO/
0 X MSB LSB
UCxSOMI
UCxSIMO
1 X MSB LSB
UCxSOMI
Move to UCxTXBUF
RX Sample Points
600 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI Operation – SPI Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 601
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A SPI Registers www.ti.com
602 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A SPI Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 603
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A SPI Registers www.ti.com
604 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A SPI Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 605
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A SPI Registers www.ti.com
606 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_A SPI Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 607
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_A SPI Registers www.ti.com
608 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B SPI Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 609
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B SPI Registers www.ti.com
610 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B SPI Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 611
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B SPI Registers www.ti.com
612 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B SPI Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 613
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B SPI Registers www.ti.com
614 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B SPI Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – SPI Mode 615
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 23
SLAU445G – October 2014 – Revised August 2016
The enhanced universal serial communication interface B (eUSCI_B) supports multiple serial
communication modes with one hardware module. This chapter describes the operation of the I2C mode.
23.1 Enhanced Universal Serial Communication Interface B (eUSCI_B) Overview ........... 617
23.2 eUSCI_B Introduction – I2C Mode ....................................................................... 617
23.3 eUSCI_B Operation – I2C Mode ........................................................................... 619
23.4 eUSCI_B I2C Registers ...................................................................................... 638
616 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Enhanced Universal Serial Communication Interface B (eUSCI_B) Overview
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 617
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Introduction – I2C Mode www.ti.com
UCA10 UCGCEN
Address Mask
UCBxADDMASK
Own Address Own Address Own Address Own Address
UCBxI2COA0 UCBxI2COA1 UCBxI2COA2 UCBxI2COA3
UCxSDA
Receive Shift Register
(2)
Clock Low
UCSLA10 MODCLK
timeout generator
UCxSCL
UCSSELx
Bit Clock Generator
UCxBRx
(1)
UCLKI 00 16
(2)
(1)
Externally provided clock on the eUSCI_B SPI clock input pin
(2)
Not the actual implementation (transistor not located in eUSCI_B module)
618 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
VCC
MSP430 Device A
Device B Device C
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 619
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
2
23.3.2 I C Serial Data
One clock pulse is generated by the master device for each data bit transferred. The I2C mode operates
with byte data. Data is transferred MSB first as shown in Figure 23-3.
The first byte after a START condition consists of a 7-bit slave address and the R/W bit. When R/W = 0,
the master transmits data to a slave. When R/W = 1, the master receives data from a slave. The ACK bit
is sent from the receiver after each byte on the ninth SCL clock.
SDA
MSB Acknowledgement Acknowledgement
Signal From Receiver Signal From Receiver
SCL
1 2 7 8 9 1 2 8 9
START STOP
Condition (S) R/W ACK ACK Condition (P)
START and STOP conditions are generated by the master and are shown in Figure 23-3. A START
condition is a high-to-low transition on the SDA line while SCL is high. A STOP condition is a low-to-high
transition on the SDA line while SCL is high. The bus busy bit, UCBBUSY, is set after a START and
cleared after a STOP.
Data on SDA must be stable during the high period of SCL (see Figure 23-4). The high and low state of
SDA can change only when SCL is low, otherwise START or STOP conditions are generated.
Data Line
Stable Data
SDA
SCL
620 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
S Slave Address 1st byte R/W ACK Slave Address 2nd byte ACK Data ACK P
1 1 1 1 0 X X
S Slave Address R/W ACK Data ACK S Slave Address R/W ACK Data ACK P
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 621
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
As shown in the code example, all configurations must be done while UCSWRST is set. To select the I2C
operation of the eUSCI_B, UCMODE must be set accordingly. The baud rate of the transmission is set by
writing the correct divider in the UCBxBRW register. The default clock selected is SMCLK. How many
bytes are transmitted in one frame is controlled by the byte counter threshold register UCBxTBCNT
together with the UCASTPx bits.
The slave address to send to is specified in the UCBxI2CSA register. Finally, the ports must be
configured. This step is device dependent; see the data sheet for the pins that must be used.
Each byte that is to be transmitted must be written to UCBxTXBUF inside the interrupt service routine.
Example 23-3 shows the recommended structure of the interrupt service routine.
Example 23-2 shows the steps needed to set up the eUSCI_B as a slave with the address 0x12h that is
able to receive and transmit data to the master.
As shown in Example 23-2, all configurations must be done while UCSWRST is set. For the slave, I2C
operation is selected by setting UCMODE. The slave address is specified in the UCBxI2COA0 register. To
enable the interrupts for receive and transmit requests, the according bits in UCBxIE and, at the end, GIE
need to be set. Finally the ports must be configured. This step is device dependent; see the data sheet for
the pins that are used.
The RX interrupt service routine is called for every byte received by a master device. The TX interrupt
service routine is executed each time the master requests a byte. The recommended structure of the
interrupt service routine can be found in Example 23-3.
622 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
Other Master
Other Slave
USCI Master
USCI Slave
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 623
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
UCTR = 1 (Transmitter)
UCSTTIFG = 1
UCTXIFG = 1
UCBxTXBUF discarded
UCALIFG = 1
UCMST = 0
UCTR = 1 (Transmitter)
UCSTTIFG = 1
UCTXIFG = 1
624 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
If the master generates a repeated START condition, the eUSCI_B I2C state machine returns to its
address-reception state.
Figure 23-10 shows the I2C slave receiver operation.
Reception of own S SLA/W DATA DATA DATA P or S
A A A A
address and data
bytes. All are
acknowledged.
UCRXIFG = 1
UCTR = 0 (Receiver)
UCSTTIFG = 1
Bus stalled
UCSTPIFG = 0 (SCL held low)
if UCBxRXBUF not read Refer to:
”Slave Transmitter”
Timing Diagram
Read data from UCBxRXBUF
UCTXNACK = 1 UCTXNACK = 0
UCTR = 0 (Receiver)
UCSTTIFG = 1
UCSTPIFG = 0
UCGC = 1
Arbitration lost as
A
master and
addressed as slave
UCALIFG = 1
UCMST = 0
UCTR = 0 (Receiver)
UCSTTIFG = 1
(UCGC = 1 if general call)
UCTXIFG = 0
UCSTPIFG = 0
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 625
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
Slave Receiver
Slave Transmitter
UCTR = 1 (Transmitter)
UCSTTIFG = 1
UCTXIFG = 1
UCSTPIFG = 0
626 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 627
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
Successful A A A A
S SLA/W DATA DATA DATA P
transmission to a
slave receiver
1) UCTR=1 (Transmitter)
2) UCTXSTT=1
UCTXSTT=0
UCNACKIFG=1 DATA A S SLA/R
UCBxTXBUF discarded
1) UCTR=0 (Receiver)
2) UCTXSTT=1
UCTXSTP=1
Not acknowledge A P
received after slave UCTXSTP=0
address
1) UCTR=1 (Transmitter)
2) UCTXSTT=1
S SLA/W
UCTXIFG=1
UCBxTXBUF discarded
UCNACKIFG=1
UCBxTXBUF discarded
UCALIFG=1
UCMST=0
UCALIFG=1
UCMST=0
UCTR=0 (Receiver)
UCSTTIFG=1
(UCGC=1 if general call)
USCI continues as Slave Receiver
628 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 629
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
1) UCTR = 1 (Transmitter)
2) UCTXSTT = 1
DATA A S SLA/R
Not acknowledge A P
received after slave UCTXSTP = 0
address
UCTXSTT = 0
UCNACKIFG = 1
1) UCTR = 1 (Transmitter)
S SLA/W 2) UCTXSTT = 1
UCTXIFG = 1
UCALIFG = 1
UCMST = 0
UCALIFG = 1
UCMST = 0
UCTR = 1 (Transmitter)
UCSTTIFG = 1
UCTXIFG = 1
USCI continues as Slave Transmitter
630 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
Successful A A A A
transmission to a S 11110xx/W SLA(2.) DATA DATA P
slave receiver
Master Receiver
UCTXSTP = 1
23.3.5.3 Arbitration
If two or more master transmitters simultaneously start a transmission on the bus, an arbitration procedure
is invoked. Figure 23-15 shows the arbitration procedure between two devices. The arbitration procedure
uses the data presented on SDA by the competing transmitters. The first master transmitter that generates
a logic high is overruled by the opposing master generating a logic low. The arbitration procedure gives
priority to the device that transmits the serial data stream with the lowest binary value. The master
transmitter that lost arbitration switches to the slave receiver mode and sets the arbitration lost flag
UCALIFG. If two or more devices send identical first bytes, arbitration continues on the subsequent bytes.
Bus Line
SCL
Device 1 Lost Arbitration
n and Switches Off
Data From
Device 1
1
0 0 0
Data From
Device 2
1 1 1
0 0 0
Bus Line
SDA
1 1 1
Figure 23-15. Arbitration Procedure Between Two Master Transmitters
There is an undefined condition if the arbitration procedure is still in progress when one master sends a
repeated START or a STOP condition while the other master is still sending data. In other words, the
following combinations result in an undefined condition:
• Master 1 sends a repeated START condition and master 2 sends a data bit.
• Master 1 sends a STOP condition and master 2 sends a data bit.
• Master 1 sends a repeated START condition and master 2 sends a STOP condition.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 631
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
SCL From
Device 2
Bus Line
SCL
Figure 23-16. Synchronization of Two I2C Clock Generators During Arbitration
632 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 633
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
634 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
23.3.10 Using the eUSCI_B Module in I2C Mode With Low-Power Modes
The eUSCI_B module provides automatic clock activation for use with low-power modes. When the
eUSCI_B clock source is inactive because the device is in a low-power mode, the eUSCI_B module
automatically activates it when needed, regardless of the control-bit settings for the clock source. The
clock remains active until the eUSCI_B module returns to its idle condition. After the eUSCI_B module
returns to the idle condition, control of the clock source reverts to the settings of its control bits.
In I2C slave mode, no internal clock source is required because the clock is provided by the external
master. It is possible to operate the eUSCI_B in I2C slave mode while the device is in LPM4 and all
internal clock sources are disabled. The receive or transmit interrupts can wake up the CPU from any low-
power mode.
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 635
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B Operation – I2C Mode www.ti.com
636 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B Operation – I2C Mode
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 637
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
638 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 639
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
640 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 641
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
642 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
23.4.4 UCBxSTATW
eUSCI_Bx Status Word Register
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 643
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
644 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
23.4.7 UCBxTXBUF
eUSCI_Bx Transmit Buffer Register
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 645
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
646 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 647
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
648 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 649
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
650 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 651
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
652 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com eUSCI_B I2C Registers
SLAU445G – October 2014 – Revised August 2016 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode 653
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
eUSCI_B I2C Registers www.ti.com
654 Enhanced Universal Serial Communication Interface (eUSCI) – I2C Mode SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Chapter 24
SLAU445G – October 2014 – Revised August 2016
This chapter describes the embedded emulation module (EEM) that is implemented in all devices.
SLAU445G – October 2014 – Revised August 2016 Embedded Emulation Module (EEM) 655
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Embedded Emulation Module (EEM) Introduction www.ti.com
656 Embedded Emulation Module (EEM) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com Embedded Emulation Module (EEM) Introduction
MB1
MB2
MB3
MB4
MB5
MB6
MB7
CPU0
CPU1
& & & & & & & & & &
Trigger Sequencer
OR CPU Stop
SLAU445G – October 2014 – Revised August 2016 Embedded Emulation Module (EEM) 657
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
EEM Building Blocks www.ti.com
24.2.1 Triggers
The event control in the EEM of the MSP430 system consists of triggers, which are internal signals
indicating that a certain event has happened. These triggers may be used as simple breakpoints, but it is
also possible to combine two or more triggers to allow detection of complex events and cause various
reactions other than stopping the CPU.
In general, the triggers can be used to control the following functional blocks of the EEM:
• Breakpoints (CPU stop)
• State storage
• Sequencer
• Cycle counter
There are two different types of triggers – the memory trigger and the CPU register write trigger.
Each memory trigger block can be independently selected to compare either the MAB or the MDB with a
given value. Depending on the implemented EEM, the comparison can be =, ≠, ≥, or ≤. The comparison
can also be limited to certain bits with the use of a mask. The mask is either bit-wise or byte-wise,
depending upon the device. In addition to selecting the bus and the comparison, the condition under which
the trigger is active can be selected. The conditions include read access, write access, DMA access, and
instruction fetch.
Each CPU register write trigger block can be independently selected to compare what is written into a
selected register with a given value. The observed register can be selected for each trigger independently.
The comparison can be =, ≠, ≥, or ≤. The comparison can also be limited to certain bits with the use of a
bit mask.
Both types of triggers can be combined to form more complex triggers. For example, a complex trigger
can signal when a particular value is written into a user-specified address.
658 Embedded Emulation Module (EEM) SLAU445G – October 2014 – Revised August 2016
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
www.ti.com EEM Building Blocks
SLAU445G – October 2014 – Revised August 2016 Embedded Emulation Module (EEM) 659
Submit Documentation Feedback
Copyright © 2014–2016, Texas Instruments Incorporated
Revision History www.ti.com
Revision History
NOTE: Page numbers for previous revisions may differ from page numbers in the current version.
Changes from March 29, 2016 to August 11, 2016 ......................................................................................................... Page
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other
changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest
issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and
complete. All semiconductor products (also referred to herein as “components”) are sold subject to TI’s terms and conditions of sale
supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms
and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary
to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily
performed.
TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide
adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or
other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information
published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or
endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the
third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration
and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered
documentation. Information of third parties may be subject to additional restrictions.
Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service
voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice.
TI is not responsible or liable for any such statements.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which
anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause
harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use
of any TI components in safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed a special agreement specifically governing such use.
Only those TI components which TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components
which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and
regulatory requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.
Products Applications
Audio www.ti.com/audio Automotive and Transportation www.ti.com/automotive
Amplifiers amplifier.ti.com Communications and Telecom www.ti.com/communications
Data Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computers
DLP® Products www.dlp.com Consumer Electronics www.ti.com/consumer-apps
DSP dsp.ti.com Energy and Lighting www.ti.com/energy
Clocks and Timers www.ti.com/clocks Industrial www.ti.com/industrial
Interface interface.ti.com Medical www.ti.com/medical
Logic logic.ti.com Security www.ti.com/security
Power Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense
Microcontrollers microcontroller.ti.com Video and Imaging www.ti.com/video
RFID www.ti-rfid.com
OMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.com
Wireless Connectivity www.ti.com/wirelessconnectivity
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2016, Texas Instruments Incorporated