Ir para a página of
Manuais similares
-
Computer Hardware
Texas Instruments SCAU020
21 páginas 0.94 mb -
Computer Hardware
Texas Instruments MSP430x4xx
512 páginas 1.89 mb -
Computer Hardware
Texas Instruments TMS320DM643X DMP
38 páginas 0.2 mb -
Computer Hardware
Texas Instruments TPS65023B
14 páginas 0.46 mb -
Computer Hardware
Texas Instruments ADS61B23EVM
30 páginas 1.33 mb -
Computer Hardware
Texas Instruments TMDXEVM6472
2 páginas 0.43 mb -
Computer Hardware
Texas Instruments ADS61xx
30 páginas 1.33 mb -
Computer Hardware
Texas Instruments TMS320C6454
225 páginas 1.75 mb
Bom manual de uso
As regras impõem ao revendedor a obrigação de fornecer ao comprador o manual com o produto Texas Instruments MSP430x4xx. A falta de manual ou informações incorretas fornecidas ao consumidor são a base de uma queixa por não conformidade do produto com o contrato. De acordo com a lei, pode anexar o manual em uma outra forma de que em papel, o que é frequentemente utilizado, anexando uma forma gráfica ou manual electrónicoTexas Instruments MSP430x4xx vídeos instrutivos para os usuários. A condição é uma forma legível e compreensível.
O que é a instrução?
A palavra vem do latim "Instructio" ou instruir. Portanto, no manual Texas Instruments MSP430x4xx você pode encontrar uma descrição das fases do processo. O objetivo do manual é instruir, facilitar o arranque, a utilização do equipamento ou a execução de determinadas tarefas. O manual é uma coleção de informações sobre o objeto / serviço, um guia.
Infelizmente, pequenos usuários tomam o tempo para ler o manual Texas Instruments MSP430x4xx, e um bom manual não só permite conhecer uma série de funcionalidades adicionais do dispositivo, mas evita a formação da maioria das falhas.
Então, o que deve conter o manual perfeito?
Primeiro, o manual Texas Instruments MSP430x4xx deve conte:
- dados técnicos do dispositivo Texas Instruments MSP430x4xx
- nome do fabricante e ano de fabricação do dispositivo Texas Instruments MSP430x4xx
- instruções de utilização, regulação e manutenção do dispositivo Texas Instruments MSP430x4xx
- sinais de segurança e certificados que comprovam a conformidade com as normas pertinentes
Por que você não ler manuais?
Normalmente, isso é devido à falta de tempo e à certeza quanto à funcionalidade específica do dispositivo adquirido. Infelizmente, a mesma ligação e o arranque Texas Instruments MSP430x4xx não são suficientes. O manual contém uma série de orientações sobre funcionalidades específicas, a segurança, os métodos de manutenção (mesmo sobre produtos que devem ser usados), possíveis defeitos Texas Instruments MSP430x4xx e formas de resolver problemas comuns durante o uso. No final, no manual podemos encontrar as coordenadas do serviço Texas Instruments na ausência da eficácia das soluções propostas. Atualmente, muito apreciados são manuais na forma de animações interessantes e vídeos de instrução que de uma forma melhor do que o o folheto falam ao usuário. Este tipo de manual é a chance que o usuário percorrer todo o vídeo instrutivo, sem ignorar especificações e descrições técnicas complicadas Texas Instruments MSP430x4xx, como para a versão papel.
Por que ler manuais?
Primeiro de tudo, contem a resposta sobre a construção, as possibilidades do dispositivo Texas Instruments MSP430x4xx, uso dos acessórios individuais e uma gama de informações para desfrutar plenamente todos os recursos e facilidades.
Após a compra bem sucedida de um equipamento / dispositivo, é bom ter um momento para se familiarizar com cada parte do manual Texas Instruments MSP430x4xx. Atualmente, são cuidadosamente preparados e traduzidos para sejam não só compreensíveis para os usuários, mas para cumprir a sua função básica de informação
Índice do manual
-
Página 1
2005 Mixed Signal Products User ’ s G uide SLAU056E[...]
-
Página 2
IMPORT ANT NOTICE T exas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orde[...]
-
Página 3
Related Documentation From T exas Instruments iii Preface Read This First About This Manual This manual discusses modules and peripherals of the MSP430x4xx family of devices. Each discussion presents the module or peripheral in a general sense. Not all features and functions of all modules or peripherals are present on all devices. In addition, mod[...]
-
Página 4
Glossary iv Glossary ACLK Auxiliary Clock See Basic Clock Module ADC Analog-to-Digital Converter BOR Brown-Out Reset See System Resets, Interrupts, and Operating Modes BSL Bootstrap Loader See www .ti.com/msp430 for application reports CPU Central Processing Unit See RISC 16-Bit CPU DAC Digital-to-Analog Converter DCO Digitally Controlled Oscillato[...]
-
Página 5
Register Bit Conventions v Register Bit Conventions Each register is shown with a key indicating the accessibility of the each individual bit, and the initial condition: Register Bit Accessibility and Initial Condition Key Bit Accessibility rw Read/write r Read only r0 Read as 0 r1 Read as 1 w W rite only w0 Write as 0 w1 Write as 1 (w) No register[...]
-
Página 6
vi[...]
-
Página 7
Contents vii Contents 1 Introduction 1-1 1.1 Architecture 1-2 1.2 Flexible Clock System 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Embedded Emulation 1-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Address S[...]
-
Página 8
Contents viii 3.3.5 Indirect Register Mode 3-14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.6 Indirect Autoincrement Mode 3-15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.7 Immediate Mode 3-16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]
-
Página 9
Contents ix 7 Hardware Multiplier 7-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 Hardware Multiplier Introduction 7-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Hardware Multiplier Operation 7-3 . . . . . . . . . .[...]
-
Página 10
Contents x 1 1 Basic Timer1 1 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Basic T imer1 Introduction 1 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Basic T imer1 Operation 1 1-4 . . . . .[...]
-
Página 11
Contents xi 15 USART Peripheral Interface, SPI Mode 15-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.1 USAR T Introduction: SPI Mode 15-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15.2 USAR T Operation: SPI Mode 15-4 . . . . . . . . . . . . . . . . . . . . . [...]
-
Página 12
Contents xii 19 LCD_A Controller 19-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.1 LCD_A Controller Introduction 19-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.2 LCD_A Controller Operation 19-4 . . . . . . . . . .[...]
-
Página 13
Contents xiii 22 SD16_A 22-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.1 SD16_A Introduction 22-2 22.2 SD16_A Operation 22-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.2.1 ADC[...]
-
Página 14
1-1 Introduction Introduction This chapter describes the architecture of the MSP430. T opic Page 1.1 Architecture 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Flexible Clock System 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3 Embedded Emulati[...]
-
Página 15
Architecture 1-2 Introduction 1.1 Architecture Th e MSP430 incorporates a 16-bit RISC CPU, peripherals, and a flexible clock system that interconnect using a von-Neumann common memory address bus (MAB) and memory data bus (MDB). Partnering a modern CPU with modular memory-mapped analog and digital peripherals, the MSP430 of fers solutions for deman[...]
-
Página 16
Embedded Emulation 1-3 Introduction Figure 1−1. MSP430 Architecture ACLK Bus Conv . Peripheral MAB 16-Bit MDB 16-Bit MCLK SMCLK Clock System Peripheral Peripheral Peripheral Peripheral Peripheral Peripheral Watchdog RAM Flash/ RISC CPU 16-Bit JT AG/Debug ACLK SMCLK ROM MDB 8-Bit JT AG 1.3 Embedded Emulation Dedicated embedded emulation logic resi[...]
-
Página 17
Address Space 1-4 Introduction 1.4 Address Space The MSP430 von-Neumann architecture has one address space shared with special function registers (SFRs), peripherals, RAM, and Flash/ROM memory as shown in Figure 1−2. See the device-specific data sheets for specific memory maps. Code access are always performed on even addresses. Data can be acces[...]
-
Página 18
Address Space 1-5 Introduction 1.4.3 Peripheral Modules Peripheral modules are mapped into the address space. The address space from 0100 to 01FFh is reserved for 16-bit peripheral modules. These modules should be accessed with word instructions. If byte instructions are used, only even addresses are permissible, and the high byte of the result is [...]
-
Página 19
2-1 System Resets, Interrupts, and Operating Modes System Resets, Interrupts, and Operating Modes This chapter describes the MSP430x4xx system resets, interrupts, and operating modes. T opic Page 2.1 System Reset and Initialization 2-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Interrupts 2-5 . . . . . . . . . . . . . . .[...]
-
Página 20
System Reset and Initialization 2-2 System Resets, Interrupts, and Operating Modes 2.1 System Reset and Initialization Th e system reset circuitry shown in Figure 2−1 sources both a power-on reset (POR) and a power-up clear (PUC) signal. Dif ferent events trigger these reset signals and different initial conditions exist depending on which signal[...]
-
Página 21
System Reset and Initialization 2-3 System Resets, Interrupts, and Operating Modes 2.1.1 Brownout Reset (BOR) All MSP430x4xx devices have a brownout reset circuit. The brownout reset circuit detects low supply voltages such as when a supply voltage is applied to or removed from the V CC terminal. The brownout reset circuit resets the device by trig[...]
-
Página 22
System Reset and Initialization 2-4 System Resets, Interrupts, and Operating Modes 2.1.2 Device Initial Conditions After System Reset After a POR, the initial MSP430 conditions are: - The RST /NMI pin is configured in the reset mode. - I/ O pins are switched to input mode as described in the Digital I/O chapter . - Other peripheral modules and regi[...]
-
Página 23
System Reset and Initialization 2-5 System Resets, Interrupts, and Operating Modes 2.2 Interrupts The interrupt priorities are fixed and defined by the arrangement of the modules i n the connection chain as shown in Figure 2 − 3. The nearer a module is to the CPU/NMIRS, the higher the priority . Interrupt priorities determine what interrupt is ta[...]
-
Página 24
System Reset and Initialization 2-6 System Resets, Interrupts, and Operating Modes 2.2.1 (Non)-Maskable Interrupts (NMI) (Non)-maskable NMI interrupts are not masked by the general interrupt enable bit (GIE), but are enabled by individual interrupt enable bits (ACCVIE, NMIIE, OFIE). When a NMI interrupt is accepted, all NMI interrupt enable bits ar[...]
-
Página 25
System Reset and Initialization 2-7 System Resets, Interrupts, and Operating Modes Figure 2 − 4. Block Diagram of (Non)-Maskable Interrupt Sources Flash Module KEYV System Reset Generator V CC POR PUC WDTQn EQU PUC POR PUC POR NMIRS Clear S WDTIFG IRQ WDTIE Clear IE1.0 PUC POR IRQA WDTTMSEL Counter IFG1.0 WDTNMI WDTTMSEL WDTNMIES Watchdog T imer [...]
-
Página 26
System Reset and Initialization 2-8 System Resets, Interrupts, and Operating Modes Oscillator Fault The oscillator fault signal warns of a possible error condition with the crystal oscillator . The oscillator fault can be enabled to generate an NMI interrupt by setting the OFIE bit. The OFIFG flag can then be tested by NMI the interrupt service rou[...]
-
Página 27
System Reset and Initialization 2-9 System Resets, Interrupts, and Operating Modes Example of an NMI Interrupt Handler Th e NMI interrupt is a multiple-source interrupt. An NMI interrupt automatically resets the NMIIE, OFIE and ACCVIE interrupt-enable bits. The user NMI service routine resets the interrupt flags and re-enables the interrupt-enable [...]
-
Página 28
System Reset and Initialization 2-10 System Resets, Interrupts, and Operating Modes Each individual peripheral interrupt is discussed in the associated peripheral module chapter in this manual. 2.2.3 Interrupt Processing When an interrupt is requested from a peripheral and the peripheral interrupt enable bit and GIE bit are set, the interrupt servi[...]
-
Página 29
System Reset and Initialization 2-1 1 System Resets, Interrupts, and Operating Modes Return From Interrupt The interrupt handling routine terminates with the instruction: RETI (return from an interrupt service routine) The return from the interrupt takes 5 cycles to execute the following actions and is illustrated in Figure 2 − 7. 1) The SR with [...]
-
Página 30
System Reset and Initialization 2-12 System Resets, Interrupts, and Operating Modes 2.2.4 Interrupt V ectors The interrupt vectors and the power-up starting address are located in the address range 0FFFFh − 0FFE0h as described in T able 2 − 1. A vector is programmed b y the user with the 16-bit address of the corresponding interrupt service rou[...]
-
Página 31
Operating Modes 2-13 System Resets, Interrupts, and Operating Modes 2.3 Operating Modes The MSP430 family is designed for ultralow-power applications and uses different operating modes shown in Figure 2 − 9. The operating modes take into account three different needs: - Ultralow-power - Speed and data throughput - Minimization of individual perip[...]
-
Página 32
Operating Modes 2-14 System Resets, Interrupts, and Operating Modes Figure 2 − 9. MSP430x4xx Operating Modes For Basic Clock System Active Mode CPU Is Active Peripheral Modules Are Active LPM0 CPU Off, FLL+ On, MCLK On, ACLK On CPUOFF = 1 SCG0 = 0 SCG1 = 0 CPUOFF = 1 SCG0 = 1 SCG1 = 0 LPM2 CPU Off, FLL+ Off, MCLK Off, ACLK On CPUOFF = 1 SCG0 = 0 [...]
-
Página 33
Operating Modes 2-15 System Resets, Interrupts, and Operating Modes 2.3.1 Entering and Exiting Low-Power Modes An enabled interrupt event wakes the MSP430 from any of the low-power operating modes. The program flow is: - Enter interrupt service routine: J The PC and SR are stored on the stack J The CPUOFF , SCG1, and OSCOFF bits are automatically r[...]
-
Página 34
Principles for Low - Power Applications 2-16 System Resets, Interrupts, and Operating Modes 2.4 Principles for Low - Power Applications Often, the most important factor for reducing power consumption is using the MSP430 ’ s clock system to maximize the time in LPM3. LPM3 power consumption is less than 2 µ A typical with both a real-time clock fu[...]
-
Página 35
3-1 RISC 16-Bit CPU This chapter describes the MSP430 CPU, addressing modes, and instruction set. T opic Page 3.1 CPU Introduction 3-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 CPU Registers 3-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]
-
Página 36
CPU Introduction 3-2 RISC 16-Bit CPU 3.1 CPU Introduction The CPU incorporates features specifically designed for modern programming techniques such as calculated branching, table processing and th e use of high-level languages such as C. The CPU can address the complete address range without paging. The CPU features include: - RISC architecture wi[...]
-
Página 37
CPU Introduction 3-3 RISC 16-Bit CPU Figure 3−1. CPU Block Diagram 0 15 MDB − Memory Data Bus Memory Address Bus − MAB 16 Zero, Z Carry , C Overflow , V Negative, N 16−bit ALU dst src R8 General Purpose R9 General Purpose R10 General Purpose R1 1 General Purpose R12 General Purpose R13 General Purpose R14 General Purpose R15 General Purpose[...]
-
Página 38
CPU Registers 3-4 RISC 16-Bit CPU 3.2 CPU Registers The CPU incorporates sixteen 16-bit registers. R0, R1, R2 and R3 have dedicated functions. R4 to R15 are working registers for general use. 3.2.1 Program Counter (PC) The 16-bit program counter (PC/R0) points to the next instruction to be executed. Each instruction uses an even number of bytes (tw[...]
-
Página 39
CPU Registers 3-5 RISC 16-Bit CPU 3.2.2 Stack Pointer (SP) The stack pointer (SP/R1) is used by the CPU to store the return addresses of subroutine calls and interrupts. It uses a predecrement, postincrement scheme. In addition, the SP can be used by software with all instructions and addressing modes. Figure 3 − 3 shows the SP . The SP is initia[...]
-
Página 40
CPU Registers 3-6 RISC 16-Bit CPU 3.2.3 Status Register (SR) The status register (SR/R2), used as a source or destination register , can be used in the register mode only addressed with word instructions. The remain- ing combinations of addressing modes are used to support the constant gen- erator . Figure 3 − 6 shows the SR bits. Figure 3 − 6.[...]
-
Página 41
CPU Registers 3-7 RISC 16-Bit CPU 3.2.4 Constant Generator Registers CG1 and CG2 Six commonly-used constants are generated with the constant generator registers R2 and R3, without requiring an additional 16-bit word of program code. The constants are selected with the source-register addressing modes (As), as described in T able 3 − 2. T able 3 ?[...]
-
Página 42
CPU Registers 3-8 RISC 16-Bit CPU 3.2.5 General − Purpose Registers R4 - R15 The twelve registers, R4 − R15, are general-purpose registers. All of these registers can be used as data registers, address pointers, or index values and can be accessed with byte or word instructions as shown in Figure 3 − 7. Figure 3 − 7. Register -Byte/Byte-Reg[...]
-
Página 43
Addressing Modes 3-9 RISC 16-Bit CPU 3.3 Addressing Modes Seven addressing modes for the source operand and four addressing modes for the destination operand can address the complete address space with no exceptions. The bit numbers in T able 3 − 3 describe the contents of the As (source) and Ad (destination) mode bits. T able 3 − 3. Source/Des[...]
-
Página 44
Addressing Modes 3-10 RISC 16-Bit CPU 3.3.1 Register Mode The register mode is described in T able 3 − 4. T able 3 − 4. Register Mode Description Assembler Code Content of ROM MOV R10,R11 MOV R10,R11 Length: One or two words Operation: Move the content of R10 to R1 1. R10 is not affected. Comment: V alid for source and destination Example: MOV [...]
-
Página 45
Addressing Modes 3-1 1 RISC 16-Bit CPU 3.3.2 Indexed Mode The indexed mode is described in T able 3 − 5. T able 3 − 5. Indexed Mode Description Assembler Code Content of ROM MOV 2(R5),6(R6) MOV X(R5),Y(R6) X = 2 Y = 6 Length: T wo or three words Operation: Move the contents of the source address (contents of R5 + 2) to the destination address ([...]
-
Página 46
Addressing Modes 3-12 RISC 16-Bit CPU 3.3.3 Symbolic Mode The symbolic mode is described in T able 3 − 6. T able 3 − 6. Symbolic Mode Description Assembler Code Content of ROM MOV EDE,TONI MOV X(PC),Y(PC) X = EDE − PC Y = TONI − PC Length: T wo or three words Operation: Move the contents of the source address EDE (contents of PC + X) to the[...]
-
Página 47
Addressing Modes 3-13 RISC 16-Bit CPU 3.3.4 Absolute Mode The absolute mode is described in T able 3 − 7. T able 3 − 7. Absolute Mode Description Assembler Code Content of ROM MOV &EDE,&TONI MOV X(0),Y(0) X = EDE Y = TONI Length: T wo or three words Operation: Move the contents of the source address EDE to the destination address TONI. [...]
-
Página 48
Addressing Modes 3-14 RISC 16-Bit CPU 3.3.5 Indirect Register Mode The indirect register mode is described in T able 3 − 8. T able 3 − 8. Indirect Mode Description Assembler Code Content of ROM MOV @R10,0(R11) MOV @R10,0(R11) Length: One or two words Operation: Move the contents of the source address (contents of R10) to the destination address[...]
-
Página 49
Addressing Modes 3-15 RISC 16-Bit CPU 3.3.6 Indirect Autoincrement Mode The indirect autoincrement mode is described in T able 3 − 9. T able 3 − 9. Indirect Autoincrement Mode Description Assembler Code Content of ROM MOV @R10+,0(R11) MOV @R10+,0(R11) Length: One or two words Operation: Move the contents of the source address (contents of R10) [...]
-
Página 50
Addressing Modes 3-16 RISC 16-Bit CPU 3.3.7 Immediate Mode The immediate mode is described in T able 3 − 10. T able 3 − 10. Immediate Mode Description Assembler Code Content of ROM MOV #45h,TONI MOV @PC+,X(PC) 45 X = TONI − PC Length: T wo or three words It is one word less if a constant of CG1 or CG2 can be used. Operation: Move the immediat[...]
-
Página 51
Instruction Set 3-17 RISC 16-Bit CPU 3.4 Instruction Set The complete MSP430 instruction set consists of 27 core instructions and 24 emulated instructions. The core instructions are instructions that have unique op-codes decoded by the CPU. The emulated instructions are instructions that make code easier to write and read, but do not have op-codes [...]
-
Página 52
Instruction Set 3-18 RISC 16-Bit CPU 3.4.1 Double-Operand (Format I) Instructions Figure 3 − 9 illustrates the double-operand instruction format. Figure 3 − 9. Double Operand Instruction Format B/W D-Reg 15 0 Op-code Ad S-Reg 87 14 13 12 1 1 10 9 6 5 4 3 2 1 As T able 3 − 1 1 lists and describes the double operand instructions. T able 3 − 1[...]
-
Página 53
Instruction Set 3-19 RISC 16-Bit CPU 3.4.2 Single-Operand (Format II) Instructions Figure 3 − 10 illustrates the single-operand instruction format. Figure 3 − 10. Single Operand Instruction Format B/W D/S-Reg 15 0 Op-code 87 14 13 12 1 1 10 9 6 5 4 3 2 1 Ad T able 3 − 12 lists and describes the single operand instructions. T able 3 − 12. Si[...]
-
Página 54
Instruction Set 3-20 RISC 16-Bit CPU 3.4.3 Jumps Figure 3 − 1 1 shows the conditional-jump instruction format. Figure 3 − 1 1. Jump Instruction Format C 10-Bit PC Offset 15 0 Op-code 87 14 13 12 1 1 10 9 6 5 4 3 2 1 T able 3 − 13 lists and describes the jump instructions. T able 3 − 13. Jump Instructions Mnemonic S-Reg, D-Reg Operation JEQ/[...]
-
Página 55
Instruction Set 3-21 RISC 16−Bit CPU ADC[.W] Add carry to destination ADC.B Add carry to destination Syntax ADC dst or ADC.W dst ADC.B dst Operation dst + C −> dst Emulation ADDC #0,dst ADDC.B #0,dst Description The carry bit (C) is added to the destination operand. The previous contents of the destination are lost. Status Bits N: Set if res[...]
-
Página 56
Instruction Set 3-22 RISC 16 − Bit CPU ADD[.W] Add source to destination ADD.B Add source to destination Syntax ADD src,dst or ADD.W src,dst ADD.B src,dst Operation src + dst − > dst Description The source operand is added to the destination operand. The source operand is not affected. The previous contents of the destination are lost. Statu[...]
-
Página 57
Instruction Set 3-23 RISC 16 − Bit CPU ADDC[.W] Add source and carry to destination ADDC.B Add source and carry to destination Syntax ADDC src,dst or ADDC.W src,dst ADDC.B src,dst Operation src + dst + C − > dst Description Th e source operand and the carry bit (C) are added to the destination operand. The source operand is not affected. The[...]
-
Página 58
Instruction Set 3-24 RISC 16 − Bit CPU AND[.W] Source AND destination AND.B Source AND destination Syntax AND src,dst or AND.W src,dst AND.B src,dst Operation src .AND. dst − > dst Description The source operand and the destination operand are logically ANDed. The result is placed into the destination. Status Bits N: Set if result MSB is set[...]
-
Página 59
Instruction Set 3-25 RISC 16 − Bit CPU BIC[.W] Clear bits in destination BIC.B Clear bits in destination Syntax BIC src,dst or BIC.W src,dst BIC.B src,dst Operation .NOT .src .AND. dst − > dst Description The inverted source operand and the destination operand are logically ANDed. The result is placed into the destination. The source operand[...]
-
Página 60
Instruction Set 3-26 RISC 16 − Bit CPU BIS[.W] Set bits in destination BIS.B Set bits in destination Syntax BIS src,dst or BIS.W src,dst BIS.B src,dst Operation src .OR. dst − > dst Description The source operand and the destination operand are logically ORed. The result is placed into the destination. The source operand is not affected. Sta[...]
-
Página 61
Instruction Set 3-27 RISC 16 − Bit CPU BIT[.W] T est bits in destination BIT .B T est bits in destination Syntax BIT src,dst or BIT .W src,dst Operation src .AND. dst Description The source and destination operands are logically ANDed. The result affects only the status bits. The source and destination operands are not affected. Status Bits N: Se[...]
-
Página 62
Instruction Set 3-28 RISC 16 − Bit CPU * BR, BRANCH Branch to .......... destination Syntax BR dst Operation dst − > PC Emulation MOV dst,PC Description An unconditional branch is taken to an address anywhere in the 64K address space. All source addressing modes can be used. The branch instruction is a word instruction. Status Bits Status bi[...]
-
Página 63
Instruction Set 3-29 RISC 16 − Bit CPU CALL Subroutine Syntax CALL dst Operation dst − > t mp dst is evaluated and stored SP − 2 − > SP PC − > @SP PC updated to TOS tmp − > P C dst saved to PC Description A subroutine call is made to an address anywhere in the 64K address space. All addressing modes can be used. The return a[...]
-
Página 64
Instruction Set 3-30 RISC 16 − Bit CPU * CLR[.W] Clear destination * CLR.B Clear destination Syntax CLR dst or CLR.W dst CLR.B dst Operation 0 − > dst Emulation MOV #0,dst MOV .B #0,dst Description The destination operand is cleared. Status Bits Status bits are not affected. Example RAM word TONI is cleared. CLR TONI ; 0 − > T ONI Examp[...]
-
Página 65
Instruction Set 3-31 RISC 16 − Bit CPU * CLRC Clear carry bit Syntax CLRC Operation 0 − > C Emulation BIC #1,SR Description The carry bit (C) is cleared. The clear carry instruction is a word instruction. Status Bits N: Not affected Z: Not affected C: Cleared V : Not affected Mode Bits OSCOFF , CPUOFF , and GIE are not affected. Example The [...]
-
Página 66
Instruction Set 3-32 RISC 16 − Bit CPU * CLRN Clear negative bit Syntax CLRN Operation 0 → N or (.NOT .src .AND. dst − > dst) Emulation BIC #4,SR Description The constant 04h is inverted (0FFFBh) and is logically ANDed with the destination operand. The result is placed into the destination. The clear negative bit instruction is a word inst[...]
-
Página 67
Instruction Set 3-33 RISC 16 − Bit CPU * CLRZ Clear zero bit Syntax CLRZ Operation 0 → Z or (.NOT .src .AND. dst − > dst) Emulation BIC #2,SR Description The constant 02h is inverted (0FFFDh) and logically ANDed with the destination operand. The result is placed into the destination. The clear zero bit instruction is a word instruction. St[...]
-
Página 68
Instruction Set 3-34 RISC 16 − Bit CPU CMP[.W] Compare source and destination CMP .B Compare source and destination Syntax CMP src,dst or CMP .W src,dst CMP .B src,dst Operation dst + .NOT .src + 1 or (dst − src) Description The source operand is subtracted from the destination operand. This is accomplished b y adding the 1s complement of the s[...]
-
Página 69
Instruction Set 3-35 RISC 16 − Bit CPU * DADC[.W] Add carry decimally to destination * DADC.B Add carry decimally to destination Syntax DADC dst or DADC.W src,dst DADC.B dst Operation dst + C − > dst (decimally) Emulation DADD #0,dst DADD.B #0,dst Description The carry bit (C) is added decimally to the destination. Status Bits N: Set if MSB [...]
-
Página 70
Instruction Set 3-36 RISC 16 − Bit CPU DADD[.W] Source and carry added decimally to destination DADD.B Source and carry added decimally to destination Syntax DADD src,dst or DADD.W src,dst DADD.B src,dst Operation src + dst + C − > dst (decimally) Description The source operand and the destination operand are treated as four binary coded dec[...]
-
Página 71
Instruction Set 3-37 RISC 16 − Bit CPU * DEC[.W] Decrement destination * DEC.B Decrement destination Syntax DEC dst or DEC.W dst DEC.B dst Operation dst − 1 − > dst Emulation SUB #1,dst Emulation SUB.B #1,dst Description The destination operand is decremented by one. The original contents are lost. Status Bits N: Set if result is negative,[...]
-
Página 72
Instruction Set 3-38 RISC 16 − Bit CPU * DECD[.W] Double-decrement destination * DECD.B Double-decrement destination Syntax DECD dst or DECD.W dst DECD.B dst Operation dst − 2 − > dst Emulation SUB #2,dst Emulation SUB.B #2,dst Description Th e destination operand is decremented by two. The original contents are lost. Status Bits N: Set if[...]
-
Página 73
Instruction Set 3-39 RISC 16 − Bit CPU * DINT Disable (general) interrupts Syntax DINT Operation 0 → GIE or (0FFF7h .AND. SR → SR / .NOT .src .AND. dst − > dst) Emulation BIC #8,SR Description All interrupts are disabled. Th e constant 08h is inverted and logically ANDed with the status register (SR). The result is placed into the SR. St[...]
-
Página 74
Instruction Set 3-40 RISC 16 − Bit CPU * EINT Enable (general) interrupts Syntax EINT Operation 1 → GIE or (0008h .OR. SR − > SR / .src .OR. dst − > dst) Emulation BIS #8,SR Description All interrupts are enabled. The constant #08h and the status register SR are logically ORed. The result is placed into the SR. Status Bits Status bits[...]
-
Página 75
Instruction Set 3-41 RISC 16 − Bit CPU * INC[.W ] Increment destination * INC.B Increment destination Syntax INC dst or INC.W dst INC.B dst Operation dst + 1 − > dst Emulation ADD #1,dst Description Th e destination operand is incremented by one. The original contents are lost. Status Bits N: Set if result is negative, reset if positive Z: S[...]
-
Página 76
Instruction Set 3-42 RISC 16 − Bit CPU * INCD[.W] Double-increment destination * INCD.B Double-increment destination Syntax INCD dst or INCD.W dst INCD.B dst Operation dst + 2 − > dst Emulation ADD #2,dst Emulation ADD.B #2,dst Example The destination operand is incremented by two. The original contents are lost. Status Bits N: Set if result[...]
-
Página 77
Instruction Set 3-43 RISC 16 − Bit CPU * INV[.W] Invert destination * INV .B Invert destination Syntax INV dst INV .B dst Operation .NOT .dst − > dst Emulation XOR #0FFFFh,dst Emulation XOR.B #0FFh,dst Description The destination operand is inverted. The original contents are lost. Status Bits N: Set if result is negative, reset if positive [...]
-
Página 78
Instruction Set 3-44 RISC 16 − Bit CPU JC Jump if carry set JHS Jump if higher or same Syntax JC label JHS label Operation If C = 1: PC + 2 × offset − > PC If C = 0: execute following instruction Description The status register carry bit (C) is tested. If it is set, the 10-bit signed offset contained i n the instruction LSBs is added to the[...]
-
Página 79
Instruction Set 3-45 RISC 16 − Bit CPU JEQ, JZ Jump if equal, jump if zero Syntax JEQ label, JZ label Operation If Z = 1: PC + 2 × offset − > PC If Z = 0: execute following instruction Description The status register zero bit (Z) is tested. If it is set, the 10-bit signed of fset contained in the instruction LSBs is added to the program cou[...]
-
Página 80
Instruction Set 3-46 RISC 16 − Bit CPU JGE Jump if greater or equal Syntax JGE label Operation If (N .XOR. V) = 0 then jump to label: PC + 2 × offset − > PC If (N .XOR. V) = 1 then execute the following instruction Description The status register negative bit (N) and overflow bit (V) are tested. If both N an d V are set or reset, the 10-bit[...]
-
Página 81
Instruction Set 3-47 RISC 16 − Bit CPU JL Jump if less Syntax JL label Operation If (N .XOR. V) = 1 then jump to label: PC + 2 × offset − > PC If (N .XOR. V) = 0 then execute following instruction Description The status register negative bit (N) and overflow bit (V) are tested. If only one is set, the 10-bit signed offset contained in the i[...]
-
Página 82
Instruction Set 3-48 RISC 16 − Bit CPU JMP Jump unconditionally Syntax JMP label Operation PC + 2 × offset − > PC Description The 10-bit signed offset contained in the instruction LSBs is added to the program counter . Status Bits Status bits are not affected. Hint : This one-word instruction replaces the BRANCH instruction in the range of [...]
-
Página 83
Instruction Set 3-49 RISC 16 − Bit CPU JN Jump if negative Syntax JN label Operation if N = 1: PC + 2 × offset − > PC if N = 0: execute following instruction Description Th e negative bit (N) of the status register is tested. If it is set, the 10-bit signed offset contained in the instruction LSBs is added to the program counter . If N is r[...]
-
Página 84
Instruction Set 3-50 RISC 16 − Bit CPU JNC Jump if carry not set JLO Jump if lower Syntax JNC label JLO label Operation if C = 0: PC + 2 × offset − > PC if C = 1: execute following instruction Description The status register carry bit (C) is tested. If it is reset, the 10-bit signed offset contained in the instruction LSBs is added to the p[...]
-
Página 85
Instruction Set 3-51 RISC 16 − Bit CPU JNE Jump if not equal JNZ Jump if not zero Syntax JNE label JNZ label Operation If Z = 0: PC + 2 × offset − > PC If Z = 1: execute following instruction Description The status register zero bit (Z) is tested. If it is reset, the 10-bit signed offset contained in the instruction LSBs is added to the pro[...]
-
Página 86
Instruction Set 3-52 RISC 16 − Bit CPU MOV[.W] Move source to destination MOV .B Move source to destination Syntax MOV src,dst or MOV .W src,dst MOV .B src,dst Operation src − > dst Description The source operand is moved to the destination. The source operand is not affected. The previous contents of the destination are lost. Status Bits St[...]
-
Página 87
Instruction Set 3-53 RISC 16 − Bit CPU * 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. The NOP instruction is mainly used for two[...]
-
Página 88
Instruction Set 3-54 RISC 16 − Bit CPU * POP[.W] Pop word from stack to destination * POP .B Pop byte from stack to destination Syntax POP dst POP .B dst Operation @SP − > temp SP + 2 − > SP temp − > dst Emulation MOV @SP+,dst or MOV .W @SP+,dst Emulation MOV .B @SP+,dst Description The stack location pointed to by the stack pointe[...]
-
Página 89
Instruction Set 3-55 RISC 16 − Bit CPU PUSH[.W] Push word onto stack PUSH.B Push byte onto stack Syntax PUSH src or PUSH.W src PUSH.B src Operation SP − 2 → SP src → @SP Description The stack pointer is decremented by two, then the source operand is moved to the RAM word addressed by the stack pointer (TOS). Status Bits Status bits are not [...]
-
Página 90
Instruction Set 3-56 RISC 16 − Bit CPU * RET Return from subroutine Syntax RET Operation @SP → PC SP + 2 → SP Emulation MOV @SP+,PC Description The return address pushed onto the stack by a CALL instruction is moved to th e program counter . The program continues at the code address following the subroutine call. Status Bits Status bits are n[...]
-
Página 91
Instruction Set 3-57 RISC 16 − Bit CPU RETI Return from interrupt Syntax RETI Operation TOS → SR SP + 2 → SP TOS → PC SP + 2 → SP Description The status register is restored to the value at the beginning of the interrupt service routine by replacing the present SR contents with the TOS contents. The stack pointer (SP) is incremented by tw[...]
-
Página 92
Instruction Set 3-58 RISC 16 − Bit CPU * RLA[.W] Rotate left arithmetically * RLA.B Rotate left arithmetically Syntax RLA dst or RLA.W dst RLA.B dst Operation C < − MSB < − MSB − 1 .... LSB+1 < − LSB < − 0 Emulation ADD dst,dst ADD.B dst,dst Description The destination operand is shifted left one position as shown in Figure [...]
-
Página 93
Instruction Set 3-59 RISC 16 − Bit CPU * RLC[.W] Rotate left through carry * RLC.B Rotate left through carry Syntax RLC dst or RLC.W dst RLC.B dst Operation C < − MSB < − MSB − 1 .... LSB+1 < − LSB < − C Emulation ADDC dst,dst Description The destination operand is shifted left one position as shown in Figure 3 − 15. The c[...]
-
Página 94
Instruction Set 3-60 RISC 16 − Bit CPU RRA[.W] Rotate right arithmetically RRA.B Rotate right arithmetically Syntax RRA dst or RRA.W dst RRA.B dst Operation MSB − > MSB, MSB − > MSB − 1, ... LSB+1 − > LSB, LSB − > C Description The destination operand is shifted right one position as shown in Figure 3 − 16. The MSB is shif[...]
-
Página 95
Instruction Set 3-61 RISC 16 − Bit CPU RRC[.W] Rotate right through carry RRC.B Rotate right through carry Syntax RRC dst or RRC.W dst RRC dst Operation C − > MSB − > MSB − 1 .... LSB+1 − > LSB − > C Description The destination operand is shifted right one position as shown in Figure 3 − 17. Th e carry bit (C) is shifted i[...]
-
Página 96
Instruction Set 3-62 RISC 16 − Bit CPU * SBC[.W] Subtract source and borrow/.NOT . carry from destination * SBC.B Subtract source and borrow/.NOT . carry from destination Syntax SBC dst or SBC.W dst SBC.B dst Operation dst + 0FFFFh + C − > dst dst + 0FFh + C − > dst Emulation SUBC #0,dst SUBC.B #0,dst Description The carry bit (C) is ad[...]
-
Página 97
Instruction Set 3-63 RISC 16 − Bit CPU * SETC Set carry bit Syntax SETC Operation 1 − > C Emulation BIS #1,SR Description The carry bit (C) is set. Status Bits N: Not affected Z: Not affected C: Set V : Not affected Mode Bits OSCOFF , CPUOFF , and GIE are not affected. Example Emulation of the decimal subtraction: Subtract R5 from R6 decimal[...]
-
Página 98
Instruction Set 3-64 RISC 16 − Bit CPU * SETN Set negative bit Syntax SETN Operation 1 − > N Emulation BIS #4,SR Description The negative bit (N) is set. Status Bits N: Set Z: Not affected C: Not affected V: Not affected Mode Bits OSCOFF , CPUOFF , and GIE are not affected.[...]
-
Página 99
Instruction Set 3-65 RISC 16 − Bit CPU * SETZ Set zero bit Syntax SETZ Operation 1 − > Z Emulation BIS #2,SR Description The zero bit (Z) is set. Status Bits N: Not affected Z: Set C: Not affected V : Not affected Mode Bits OSCOFF , CPUOFF , and GIE are not affected.[...]
-
Página 100
Instruction Set 3-66 RISC 16 − Bit CPU SUB[.W] Subtract source from destination SUB.B Subtract source from destination Syntax SUB src,dst or SUB.W src,dst SUB.B src,dst Operation dst + .NOT .src + 1 − > dst or [(dst − src − > dst)] Description The source operand is subtracted from the destination operand by adding the source operand ?[...]
-
Página 101
Instruction Set 3-67 RISC 16 − Bit CPU SUBC[.W]SBB[.W] Subtract source and borrow/.NOT . carry from destination SUBC.B,SBB.B Subtract source and borrow/.NOT . carry from destination Syntax SUBC src,dst or SUBC.W src,dst or SBB src,dst or SBB.W src,dst SUBC.B src,dst or SBB.B src,dst Operation dst + .NOT .src + C − > dst or (dst − src − 1[...]
-
Página 102
Instruction Set 3-68 RISC 16 − Bit CPU SWPB Swap bytes Syntax SWPB dst Operation Bits 15 to 8 < − > bits 7 to 0 Description The destination operand high and low bytes are exchanged as shown in Figure 3 − 18. Status Bits Status bits are not affected. Mode Bits OSCOFF , CPUOFF , and GIE are not affected. Figure 3 − 18. Destination Opera[...]
-
Página 103
Instruction Set 3-69 RISC 16 − Bit CPU SXT Extend Sign Syntax SXT dst Operation Bit 7 − > Bit 8 ......... Bit 15 Description Th e sign of the low byte is extended into the high byte as shown in Figure 3 − 19. Status Bits N: Set if result is negative, reset if positive Z: Set if result is zero, reset otherwise C: Set if result is not zero, [...]
-
Página 104
Instruction Set 3-70 RISC 16 − Bit CPU * TST[.W] T est destination * TST .B T est destination Syntax TST dst or TST .W dst TST .B dst Operation dst + 0FFFFh + 1 dst + 0FFh + 1 Emulation CMP #0,dst CMP .B #0,dst Description Th e destination operand is compared with zero. The status bits are set accord- ing to the result. The destination is not aff[...]
-
Página 105
Instruction Set 3-71 RISC 16 − Bit CPU XOR[.W] Exclusive OR of source with destination XOR.B Exclusive OR of source with destination Syntax XOR src,dst or XOR.W src,dst XOR.B src,dst Operation src .XOR. dst − > dst Description Th e source and destination operands are exclusive ORed. The result is placed into the destination. The source opera[...]
-
Página 106
Instruction Set 3-72 RISC 16 − Bit CPU 3.4.4 Instruction Cycles and Lengths The number of CPU clock cycles required for an instruction depends on the instruction format and the addressing modes used - not the instruction itself. The number of clock cycles refers to the MCLK. Interrupt and Reset Cycles T able 3 − 14 lists the CPU cycles for inte[...]
-
Página 107
Instruction Set 3-73 RISC 16 − Bit CPU Format-I (Double Operand) Instruction Cycles and Lengths T able 3 − 16 lists the length and CPU cycles for all addressing modes of format-I instructions. T able 3 − 16. Format I Instruction Cycles and Lengths Addressing Mode No. of Length of Src Dst Cycles Instruction Example Rn Rm 1 1 MOV R5,R8 PC 2 1 B[...]
-
Página 108
Instruction Set 3-74 RISC 16 − Bit CPU 3.4.5 Instruction Set Description The instruction map is shown in Figure 3 − 20 and the complete instruction set is summarized in T able 3 − 17. Figure 3 − 20. Core Instruction Map 0xxx 4xxx 8xxx Cxxx 1xxx 14xx 18xx 1Cxx 20xx 24xx 28xx 2Cxx 30xx 34xx 38xx 3Cxx 4xxx 5xxx 6xxx 7xxx 8xxx 9xxx Axxx Bxxx Cx[...]
-
Página 109
Instruction Set 3-75 RISC 16 − Bit CPU T able 3 − 17. MSP430 Instruction Set Mnemonic Description V N Z C ADC(.B) † dst Add C to destination dst + C → dst * * * * ADD(.B) src,dst Add source to destination src + dst → d s t **** ADDC(.B) src,dst Add source and C to destination src + dst + C → d s t **** AND(.B) src,dst AND source and des[...]
-
Página 110
4-1 FLL+ Clock Module The FLL+ clock module provides the clocks for MSP430x4xx devices. This chapter discusses the FLL+ clock module. The FLL+ clock module is implemented in all MSP430x4xx devices. T opic Page 4.1 FLL+ Clock Module Introduction 4-2 . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]
-
Página 111
4-2 FLL+ Clock Module 4.1 FLL+ Clock Module Introduction Th e frequency-locked loop (FLL+) clock module supports low system cost and ultralow-power consumption. Using three internal clock signals, the user can select the best balance of performance and low power consumption. The FLL+ features digital frequency-locked loop (FLL) hardware. The FLL op[...]
-
Página 112
4-3 FLL+ Clock Module Figure 4−1. MSP430x44x and MSP430x43x Frequency-Locked Loop 10 − bit Frequency Integrator DCO + Modulator DC Generator OSCOFF FNx SCG1 off SCG0 Enable PUC Reset ACLK MCLK XTS_FLL DCOPLUS FLL_DIVx FLLDx ACLK/n CPUOFF XT20FF SELS SELMx 10 M f Crystal SMCLK SMCLKOFF XIN XOUT XT2IN XT2OUT XT2 Oscillator f DCO + − f DCO/D /(N[...]
-
Página 113
4-4 FLL+ Clock Module Figure 4 − 2. MSP430x42x and MSP430x41x Frequency-Locked Loop 10 − bit Frequency Integrator DCO + Modulator DC Generator OSCOFF FNx SCG1 off SCG0 Enable PUC Reset ACLK XTS_FLL DCOPLUS FLL_DIVx FLLDx ACLK/n CPUOFF 10 M f Crystal SMCLK XIN XOUT f DCO + − f DCO/D /(N+1) 0 1 1 0 Divider /1/2/4/8 Divider /1/2/4/8 4 LFXT1 Osci[...]
-
Página 114
FLL+ Clock Module Operation 4-5 FLL+ Clock Module 4.2 FLL+ Clock Module Operation After a PUC, MCLK and SMCLK are sourced from DCOCLK at 32 times the ACLK frequency . When a 32,768-Hz crystal is used for ACLK, MCLK and SMCLK will stabilize to 1.048576 MHz. Status register control bits SCG0, SCG1, OSCOFF , and CPUOFF configure the MSP430 operating m[...]
-
Página 115
FLL+ Clock Module Operation 4-6 FLL+ Clock Module 4.2.2 LFXT1 Oscillator The LFXT1 oscillator supports ultralow-current consumption using a 32,768-Hz watch crystal in LF mode (XTS_FLL = 0). A watch crystal connects to XIN and XOUT without any external components. The LFXT1 oscillator supports high-speed crystals or resonators when in HF mode (XTS_F[...]
-
Página 116
FLL+ Clock Module Operation 4-7 FLL+ Clock Module 4.2.4 Digitally-Controlled Oscillator (DCO) The DCO is an integrated ring oscillator with RC-type characteristics. The DCO frequency is stabilized by the FLL to a multiple of ACLK as defined by N, the lowest 7 bits of the SCFQCTL register . The DCOPLUS bit sets the f DCOCLK frequency to f DCO or f D[...]
-
Página 117
FLL+ Clock Module Operation 4-8 FLL+ Clock Module 4.2.6 DCO Modulator The modulator mixes two adjacent DCO frequencies to produce an intermediate effective frequency and spread the clock energy , reducing electromagnetic interference (EMI) . The modulator mixes the two adjacent frequencies across 32 DCOCLK clock cycles. T he error of the ef fective[...]
-
Página 118
FLL Operation from Low-Power Modes- 4-9 FLL+ Clock Module 4.2.7 Disabling the FLL Hardware and Modulator The FLL is disabled when the status register bit SCG0 = 1. When the FLL is disabled, the DCO runs at the previously selected tap and DCOCLK is not automatically stabilized. Th e DCO modulator is disabled when SCFQ_M = 1. When the DCO modulator i[...]
-
Página 119
Buffered Clock Output 4-10 FLL+ Clock Module 4.2.10 FLL+ Fail-Safe Operation Th e FLL+ module incorporates an oscillator-fault fail-safe feature. This feature detects an oscillator fault for LFXT1, DCO and XT2 as shown in Figure 4 − 4. The available fault conditions are: - Low-frequency oscillator fault (LFOF) for LFXT1 in LF mode - High-frequenc[...]
-
Página 120
FLL+ Clock Module Registers 4-1 1 FLL+ Clock Module 4.3 FLL+ Clock Module Registers The FLL+ registers are listed in T able 4 − 2. T able 4 − 2. FLL+ Registers Register Short Form Register T ype Address Initial State System clock control SCFQCTL Read/write 052h 01Fh with PUC System clock frequency integrator 0 SCFI0 Read/write 050h 040h with PU[...]
-
Página 121
FLL+ Clock Module Registers 4-12 FLL+ Clock Module SCFQCTL, System Clock Control Register 76543 210 SCFQ_M N rw − 0 rw − 0 rw − 0 rw − 1 rw − 1 rw − 1 rw − 1 rw − 1 SCFQ_M Bit 7 Modulation. This enables or disables modulation 0 Modulation enabled 1 Modulation disabled N Bits 6-0 Multiplier . These bits set the multiplier value for t[...]
-
Página 122
FLL+ Clock Module Registers 4-13 FLL+ Clock Module SCFI1, System Clock Frequency Integrator Register 1 76543 210 DCOx MODx (MSBs) rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 DCOx Bits 7-3 These bits select the DCO tap and are modified automatically by the FLL+. MODx Bit 2 Most significant modulator bits. Bit 2 is the mod[...]
-
Página 123
FLL+ Clock Module Registers 4-14 FLL+ Clock Module FLL_CTL0, FLL+ Control Register 0 76543 210 DCOPLUS XTS_FLL XCAPxPF XT2OF † XT1OF LFOF DCOF rw − 0 rw − 0 rw − 0 rw − 0 r0 r0 r − (1) r − 1 † Not present in MSP430x41x, MSP430x42x devices DCOPLUS Bit 7 DCO output pre-divider . This bit selects if the DCO output is pre-divided before[...]
-
Página 124
FLL+ Clock Module Registers 4-15 FLL+ Clock Module FLL_CTL1, FLL+ Control Register 1 76543 210 Unused SMCLK OFF † XT2OFF † SELMx † SELS † FLL_DIVx r0 r0 rw − (1) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) † Not present in MSP430x41x, MSP430x42x devices. Unused Bit 7 SMCLKOFF Bit 6 SMCLK of f. This bit turns of f SMCLK. Not p[...]
-
Página 125
FLL+ Clock Module Registers 4-16 FLL+ Clock Module IE1, Interrupt Enable Register 1 76543 210 OFIE rw − 0 Bits 7-2 These bits may be used by other modules. See device-specific datasheet. OFIE Bit 1 Oscillator fault interrupt enable. This bit enables the OFIFG interrupt. Because other bits in IE1 may be used for other modules, it is recommended to[...]
-
Página 126
5-1 Flash Memory Controller This chapter describes the operation of the MSP430 flash memory controller . T opic Page 5.1 Flash Memory Introduction 5-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Flash Memory Segmentation 5-3 . . . . . . . . . . . . . .[...]
-
Página 127
Flash Memory Introduction 5-2 Flash Memory Controller 5.1 Flash Memory Introduction The MSP430 flash memory is bit-, byte-, and word-addressable and programmable. The flash memory module has an integrated controller that controls programming and erase operations. The controller has three registers, a timing generator , and a voltage generator to su[...]
-
Página 128
Flash Memory Segmentation 5-3 Flash Memory Controller 5.2 Flash Memory Segmentation MSP430 flash memory is partitioned into segments. Single bits, bytes, or words can be written to flash memory , but the segment is the smallest size of flash memory that can be erased. The flash memory is partitioned into main and information memory sections. There [...]
-
Página 129
Flash Memory Operation 5-4 Flash Memory Controller 5.3 Flash Memory Operation The default mode of the flash memory is read mode. In read mode, the flash memory is not being erased or written, the flash timing generator and voltage generator are of f, and the memory operates identically to ROM. MSP430 flash memory is in-system programmable (ISP) wit[...]
-
Página 130
Flash Memory Operation 5-5 Flash Memory Controller 5.3.2 Erasing Flash Memory Th e erased level of a flash memory bit is 1. Each bit can be programmed from 1 to 0 individually but to reprogram from 0 to 1 requires an erase cycle. The smallest amount of flash that can be erased is a segment. There are three erase modes selected with the ERASE and ME[...]
-
Página 131
Flash Memory Operation 5-6 Flash Memory Controller Initiating an Erase from Within Flash Memory An y erase cycle can be initiated from within flash memory or from RAM. When a flash segment erase operation is initiated from within flash memory , all timing is controlled by the flash controller , and the CPU is held while the erase cycle completes. A[...]
-
Página 132
Flash Memory Operation 5-7 Flash Memory Controller Initiating an Erase from RAM Any erase cycle may be initiated from RAM. In this case, the CPU is not held and can continue to execute code from RAM. The BUSY bit must be polled to determine the end of the erase cycle before the CPU can access any flash address again. If a flash access occurs while [...]
-
Página 133
Flash Memory Operation 5-8 Flash Memory Controller 5.3.3 Writing Flash Memory The write modes, selected by the WR T and BLKWRT bits, are listed in T able 5 − 1. Interrupts are automatically disabled during a flash write and re-enabled after the write. Any interrupt that occurred during the write will have its associated flag set, and will generat[...]
-
Página 134
Flash Memory Operation 5-9 Flash Memory Controller In byte/word mode, the internally-generated programming voltage is applied to the complete 64-byte block, each time a byte or word is written, for 32 of the 35 f FTG cycles. With each byte or word write, the amount of time the block is subjected to the programming voltage accumulates. The cumulativ[...]
-
Página 135
Flash Memory Operation 5-10 Flash Memory Controller Initiating a Byte/Word W rite from RAM The flow to initiate a byte/word write from RAM is shown in Figure 5 − 9. Figure 5 − 9. Initiating a Byte/Word Write from RAM yes BUSY = 1 yes BUSY = 1 Disable watchdog Setup flash controller and set WRT=1 Write byte or word Set WRT=0, LOCK = 1 re-enable [...]
-
Página 136
Flash Memory Operation 5-1 1 Flash Memory Controller Block Write The block write can be used to accelerate the flash write process when many sequential bytes or words need to be programmed. The flash programming voltage remains on for the duration of writing the 64-byte block. The cumulative programming time t CPT must not be exceeded for any block[...]
-
Página 137
Flash Memory Operation 5-12 Flash Memory Controller Block W rite Flow and Example A block write flow is shown in Figure 5 − 8 and the following example. Figure 5 − 1 1. Block Write Flow yes BUSY = 1 Disable watchdog Setup flash controller Set BLKWRT=WRT=1 Write byte or word no Block Border? yes W AIT=0? yes BUSY = 1 Set BLKWRT=0 yes Another Blo[...]
-
Página 138
Flash Memory Operation 5-13 Flash Memory Controller ; Write one block starting at 0F000h. ; Must be executed from RAM, Assumes Flash is already erased. ; 514 kHz < SMCLK < 952 kHz ; Assumes ACCVIE = NMIIE = OFIE = 0. MOV #32,R5 ; Use as write counter MOV #0F000h,R6 ; Write pointer MOV #WDTPW+WDTHOLD,&WDTCTL ; Disable WDT L1 BIT #BUSY,&[...]
-
Página 139
Flash Memory Operation 5-14 Flash Memory Controller 5.3.4 Flash Memory Access During Write or Erase When any write or any erase operation is initiated from RAM and while BUSY=1, the CPU may not read or write to or from any flash location. Otherwise, an access violation occurs, ACCVIFG is set, and the result is unpredictable. Also if a write to flas[...]
-
Página 140
Flash Memory Operation 5-15 Flash Memory Controller 5.3.5 Stopping a W rite or Erase Cycle Any write or erase operation can be stopped before its normal completion by setting the emergency exit bit EMEX. Setting the EMEX bit stops the active operation immediately and stops the flash controller . All flash operations cease, the flash returns to read[...]
-
Página 141
Flash Memory Operation 5-16 Flash Memory Controller Programming Flash Memory via JT AG MSP430 devices can be programmed via the JT AG port. The JT AG interface requires four signals (5 signals on 20- and 28-pin devices), ground and optionally V CC and RST /NMI. The JT AG port is protected with a fuse. Blowing the fuse completely disables the JT AG [...]
-
Página 142
Flash Memory Registers 5-17 Flash Memory Controller 5.4 Flash Memory Registers The flash memory registers are listed in T able 5 − 4. T able 5 − 4. Flash Memory Registers Register Short Form Register T ype Address Initial State Flash memory control register 1 FCTL1 Read/write 0128h 09600h with PUC Flash memory control register 2 FCTL2 Read/writ[...]
-
Página 143
Flash Memory Registers 5-18 Flash Memory Controller FCTL1, Flash Memory Control Register 15 14 13 12 1 1 10 9 8 FRKEY , Read as 096h FWKEY , Must be written as 0A5h 76543 210 BLKWRT WRT Reserved Reserved Reserved MERAS ERASE Reserved rw − 0 rw − 0 r0 r0 r0 rw − 0 rw − 0 r0 FRKEY/ FWKEY Bits 15-8 FCTLx password. Always read as 096h. Must be [...]
-
Página 144
Flash Memory Registers 5-19 Flash Memory Controller FCTL2, Flash Memory Control Register 15 14 13 12 1 1 10 9 8 FWKEYx, Read as 096h Must be written as 0A5h 76543 210 FSSELx FNx rw − 0 rw − 1 rw-0 rw-0 rw-0 rw − 0 rw-1 rw − 0 FWKEYx Bits 15-8 FCTLx password. Always read as 096h. Must be written as 0A5h or a PUC will be generated. FSSELx Bit[...]
-
Página 145
Flash Memory Registers 5-20 Flash Memory Controller FCTL3, Flash Memory Control Register FCTL3 15 14 13 12 1 1 10 9 8 FWKEYx, Read as 096h Must be written as 0A5h 76543 210 Reserved Reserved EMEX LOCK W AIT ACCVIFG KEYV BUSY r0 r0 rw-0 rw-1 r-1 rw − 0 rw-(0) r(w) − 0 FWKEYx Bits 15-8 FCTLx password. Always read as 096h. Must be written as 0A5h [...]
-
Página 146
Flash Memory Registers 5-21 Flash Memory Controller IE1, Interrupt Enable Register 1 76543 210 ACCVIE rw − 0 Bits 7-6, 4-0 These bits may be used by other modules. See device-specific datasheet. ACCVIE Bit 5 Flash memory access violation interrupt enable. This bit enables the ACCVIFG interrupt. Because other bits in IE1 may be used for other modu[...]
-
Página 147
6-1 Supply V oltage Supervisor This chapter describes the operation of the SVS. The SVS is implemented in all MSP430x4x devices. T opic Page 6.1 SVS Introduction 6−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 SVS Operation 6[...]
-
Página 148
SVS Introduction 6-2 Supply V oltage Supervisor 6.1 SVS Introduction The supply voltage supervisor (SVS) is used to monitor the A V CC supply voltage or an external voltage. The SVS can be configured to set a flag or generate a POR reset when the supply voltage or external voltage drops below a user-selected threshold. The SVS features include: - A[...]
-
Página 149
SVS Introduction 6-3 Supply V oltage Supervisor Figure 6−1. SVS Block Diagram + − 1.25V Brownout Reset VCC Set SVSFG t Reset ~ 50us Reset SVSCTL Bits 0001 0010 001 1 1111 1 101 1 100 G D S SVSOUT G D S VLD SVSON PORON SVSOP SVSFG ~ 50us SVS_POR SVSIN AV CC AV CC[...]
-
Página 150
SVS Operation 6-4 Supply V oltage Supervisor 6.2 SVS Operation The SVS detects if the A V CC voltage drops below a selectable level. It can be configured t o provide a POR or set a flag, when a low-voltage condition occurs. The SVS is disabled after a brownout reset to conserve current consumption. 6.2.1 Configuring the SVS The VLDx bits are used t[...]
-
Página 151
SVS Operation 6-5 Supply V oltage Supervisor 6.2.3 Changing the VLDx Bits When the VLDx bits are changed, two settling delays are implemented to allows the SVS circuitry to settle. During each delay , the SVS will not set SVSFG. The delays, t d(SVSon) and t settle, are shown in Figure 6 − 2. The t d(SVSon) delay takes affect when VLDx is changed [...]
-
Página 152
SVS Operation 6-6 Supply V oltage Supervisor 6.2.4 SVS Operating Range Each SVS level has hysteresis to reduce sensitivity to small supply voltage changes when A V CC is close to the threshold. The SVS operation and SVS/Brownout interoperation are shown in Figure 6 − 3 . Figure 6 − 3. Operating Levels for SVS and Brownout/Reset Circuit V CC(sta[...]
-
Página 153
SVS Registers 6-7 Supply V oltage Supervisor 6.3 SVS Registers The SVS registers are listed in T able 6 − 1. T able 6 − 1. SVS Registers Register Short Form Register T ype Address Initial State SVS Control Register SVSCTL Read/write 056h Reset with BOR SVSCTL, SVS Control Register 76543 210 VLDx PORON SVSON SVSOP SVSFG rw − 0 † rw − 0 †[...]
-
Página 154
7-1 Hardware Multiplier Hardware Multiplier This chapter describes the hardware multiplier . The hardware multiplier is implemented in MSP430x44x devices. T opic Page 7.1 Hardware Multiplier Introduction 7-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.2 Hardware Multiplier Operation 7-3 . . . . . . . . . . . . . . . . . . . . . [...]
-
Página 155
Hardware Multiplier Introduction 7-2 Hardware Multiplier 7.1 Hardware Multiplier Introduction The hardware multiplier is a peripheral and is not part of the MSP430 CPU. This means, its activities do not interfere with the CPU activities. The multiplier registers are peripheral registers that are loaded and read with CPU instructions. The hardware m[...]
-
Página 156
Hardware Multiplier Operation 7-3 Hardware Multiplier 7.2 Hardware Multiplier Operation The hardware multiplier supports unsigned multiply , signed multiply , unsigned multiply accumulate, and signed multiply accumulate operations. The type o f operation is selected by the address the first operand is written to. The hardware multiplier has two 16-[...]
-
Página 157
Hardware Multiplier Operation 7-4 Hardware Multiplier 7.2.2 Result Registers Th e result low register RESLO holds the lower 16-bits of the calculation result. The result high register RESHI contents depend on the multiply operation an d are listed in T able 7 − 2. T able 7 − 2. RESHI Contents Mode RESHI Contents MPY Upper 16-bits of the result [...]
-
Página 158
Hardware Multiplier Operation 7-5 Hardware Multiplier 7.2.3 Software Examples Examples for all multiplier modes follow . All 8x8 modes use the absolute address for the registers because the assembler will not allow .B access to word registers when using the labels from the standard definitions file. ; 16x16 Unsigned Multiply MOV #01234h,&MPY ; [...]
-
Página 159
Hardware Multiplier Operation 7-6 Hardware Multiplier 7.2.4 Indirect Addressing of RESLO When using indirect or indirect autoincrement addressing mode to access the result registers, At least one instruction is needed between loading the second operand and accessing one of the result registers: ; Access multiplier results with indirect addressing M[...]
-
Página 160
Hardware Multiplier Registers 7-7 Hardware Multiplier 7.3 Hardware Multiplier Registers The hardware multiplier registers are listed in T able 7 − 4. T able 7 − 4. Hardware Multiplier Registers Register Short Form Register T ype Address Initial State Operand one - multiply MPY Read/write 0130h Unchanged Operand one - signed multiply MPYS Read/w[...]
-
Página 161
8-1 The DMA controller module transfers data from one address to another without CPU intervention. This chapter describes the operation of the DMA controller. The DMA controller is implemented in MSP430FG43x and implements only one DMA channel. T opic Page 8.1 DMA Introduction 8-2 . . . . . . . . . . . . . .[...]
-
Página 162
8-2 8.1 DMA Introduction The direct memory access (DMA) controller transfers data from one address to another , without CPU intervention, across the entire address range. For example, the DMA controller can move data from the ADC12 conversion memory to RAM. MSP430FG43x devices implement only one DMA channel. Therefore some features described in thi[...]
-
Página 163
8-3 Figure 8−1. DMA Controller Block Diagram DMA Priority And Control ENNMI DT DMA Channel 2 DMASRSBYTE DMA2SZ DMA2DA DMA2SA DMADSTBYTE DMASRCINCRx DMADSTINCRx 2 2 3 DMADTx DMAEN DT DMA Channel 1 DMASRSBYTE DMA1SZ DMA1DA DMA1SA DMADSTBYTE DMASRCINCRx DMADSTINCRx 2 2 3 DMADTx DMAEN DT DMA Channel 0 DMASRSBYTE DMA0SZ DMA0DA DMA0SA DMADSTBYTE DMASRC[...]
-
Página 164
8-4 8.2 DMA Operation The DMA controller is configured with user software. The setup and operation of the DMA is discussed in the following sections. 8.2.1 DMA Addressing Modes The DMA controller has four addressing modes. The addressing mode for each DMA channel is independently configurable. For example, channel 0 ma y transfer between two fixed [...]
-
Página 165
8-5 8.2.2 DMA T ransfer Modes The DMA controller has six transfer modes selected by the DMADTx bits as listed in T able 8 − 1. Each channel is individually configurable for its transfer mode. For example, channel 0 may be configured in single transfer mode, while channel 1 is configured for burst-block transfer mode, and channel 2 operates in rep[...]
-
Página 166
8-6 Single T ransfer In single transfer mode, each byte/word transfer requires a separate trigger . The single transfer state diagram is shown in Figure 8 − 3. The DMAxSZ register is used to define the number of transfers to be made. The DMADSTINCRx and DMASRCINCRx bits select if the destination address and the source address are incremented or d[...]
-
Página 167
8-7 Figure 8 − 3. DMA Single T ransfer State Diagram Reset Wait for Trigger Idle Hold CPU, Transfer one word/byte [+Trigger AND DMALEVEL = 0 ] OR [Trigger=1 AND DMALEVEL=1] DMAABORT=0 DMAABORT = 1 2 x MCLK DMAEN = 0 Modify T_SourceAdd Modify T_DestAdd Decrement DMAxSZ [ENNMI = 1 AND NMI event] OR [DMALEVEL = 1 AND Trigger = 0] [ DMADTx = 0 AND DM[...]
-
Página 168
8-8 Block T ransfers In block transfer mode, a transfer of a complete block of data occurs after one trigger . When DMADTx = 1, the DMAEN bit is cleared after the completion of the block transfer and must be set again before another block transfer can be triggered. After a block transfer has been triggered, further trigger signals occurring during [...]
-
Página 169
8-9 Figure 8 − 4. DMA Block T ransfer State Diagram Reset Wait for Trigger Idle Hold CPU, Transfer one word/byte [+Trigger AND DMALEVEL = 0 ] OR [Trigger=1 AND DMALEVEL=1] DMAABORT=0 DMAABORT = 1 2 x MCLK DMAEN = 0 Modify T_SourceAdd Modify T_DestAdd Decrement DMAxSZ DMAxSZ > 0 [ENNMI = 1 AND NMI event] OR [DMALEVEL = 1 AND Trigger = 0] [DMADT[...]
-
Página 170
8-10 Burst-Block T ransfers In burst-block mode, transfers are block transfers with CPU activity interleaved. The CPU executes 2 MCLK cycles after every four byte/word transfers of the block resulting in 20% CPU execution capacity . After the burst-block, CPU execution resumes at 100% capacity and the DMAEN bit is cleared. DMAEN must be set again b[...]
-
Página 171
8-1 1 Figure 8 − 5. DMA Burst-Block T ransfer State Diagram 2 x MCLK Reset Wait for Trigger Idle Hold CPU, Transfer one word/byte Burst State (release CPU for 2xMCLK) [+Trigger AND DMALEVEL = 0 ] OR [Trigger=1 AND DMALEVEL=1] DMAABORT=0 DMAABORT = 1 2 x MCLK DMAEN = 0 Modify T_SourceAdd Modify T_DestAdd Decrement DMAxSZ [DMADTx = {6, 7} AND DMAxS[...]
-
Página 172
8-12 8.2.3 Initiating DMA T ransfers Each DMA channel is independently configured for its trigger source with the DMAxTSELx bits as described in T able 8 − 2.The DMAxTSELx bits should be modified only when the DMACTLx DMAEN bit is 0. Otherwise, unpredictable DMA triggers may occur . When selecting the trigger , the trigger must not have already o[...]
-
Página 173
8-13 T able 8 − 2. DMA T rigger Operation DMAxTSELx Operation 0000 A transfer is triggered when the DMAREQ bit is set. The DMAREQ bit is automatically reset when the transfer starts 0001 A transfer is triggered when the T ACCR2 CCIFG flag is set. The T ACCR2 CCIFG flag is automatically reset when the transfer starts. If the T ACCR2 CCIE bit is se[...]
-
Página 174
8-14 8.2.4 Stopping DMA T ransfers There are two ways to stop DMA transfers in progress: - A single, block, or burst-block transfer may be stopped with an NMI interrupt, if the ENNMI bit is set in register DMACTL1. - A burst-block transfer may be stopped by clearing the DMAEN bit. 8.2.5 DMA Channel Priorities The default DMA channel priorities are [...]
-
Página 175
8-15 8.2.6 DMA T ransfer Cycle T ime The DMA controller requires one or two MCLK clock cycles to synchronize before each single transfer or complete block or burst-block transfer . Each byte/word transfer requires two MCLK cycles after synchronization, and one cycle of wait time after the transfer . Because the DMA controller uses MCLK, the DMA cyc[...]
-
Página 176
8-16 8.2.7 Using DMA with System Interrupts DMA transfers are not interruptible by system interrupts. System interrupts remain pending until the completion of the transfer . NMI interrupts can interrupt the DMA controller if the ENNMI bit is set. System interrupt service routines are interrupted by DMA transfers. If an interrupt service routine or [...]
-
Página 177
8-17 8.2.9 Using the I 2 C Module with the DMA Controller The I 2 C module provides two trigger sources for the DMA controller . The I 2 C module can trigger a transfer when new I 2 C data is received and the when the transmit data is needed. The TXDMAEN and RXDMAEN bits enable or disable the use of the DMA controller with the I 2 C module. When RX[...]
-
Página 178
8-18 8.3 DMA Registers The DMA registers are listed in T able 8 − 4. T able 8 − 4. DMA Registers Register Short Form Register T ype Address Initial State DMA control 0 DMACTL0 Read/write 0122h Reset with POR DMA control 1 DMACTL1 Read/write 0124h Reset with POR DMA channel 0 control DMA0CTL Read/write 01E0h Reset with POR DMA channel 0 source a[...]
-
Página 179
8-19 DMACTL0, DMA Control Register 0 15 14 13 12 1 1 10 9 8 Reserved DMA2TSELx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 DMA1TSELx DMA0TSELx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) Reserved Bits 15 − 12 Reserved DMA2 TSELx Bits 11 − 8 DMA tri[...]
-
Página 180
8-20 DMACTL1, DMA Control Register 1 15 14 13 12 1 1 10 9 8 0 0000000 r0 r0 r0 r0 r0 r0 r0 r0 76543 210 00000 DMA ONFETCH ROUND ROBIN ENNMI r0 r0 r0 r0 r0 rw − (0) rw − (0) rw − (0) Reserved Bits 15 − 3 Reserved. Read only . Always read as 0. DMA ONFETCH Bit 2 DMA on fetch 0 The DMA transfer occurs immediately 1 The DMA transfer occurs on n[...]
-
Página 181
8-21 DMAxCTL, DMA Channel x Control Register 15 14 13 12 1 1 10 9 8 Reserved DMADTx DMADSTINCRx DMASRCINCRx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 DMA DSTBYTE DMA SRCBYTE DMALEVEL DMAEN DMAIFG DMAIE DMA ABORT DMAREQ rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0[...]
-
Página 182
8-22 DMA SRCBYTE Bit 6 DMA source byte. This bit selects the source as a byte or word. 0 Word 1 Byte DMA LEVEL Bit 5 DMA level. This bit selects between edge-sensitive and level-sensitive triggers. 0 Edge sensitive (rising edge) 1 Level sensitive (high level) DMAEN Bit 4 DMA enable 0 Disabled 1 Enabled DMAIFG Bit 3 DMA interrupt flag 0 No interrupt[...]
-
Página 183
8-23 DMAxDA, DMA Destination Address Register 15 14 13 12 1 1 10 9 8 DMAxDAx rw rw rw rw rw rw rw rw 76543 210 DMAxDAx rw rw rw rw rw rw rw rw DMAxDAx Bits 15 − 0 DMA destination address. The destination address register points to the destination address for single transfers or the first address for block transfers. The DMAxDA register remains un[...]
-
Página 184
9-1 Digital I/O Digital I/O This chapter describes the operation of the digital I/O ports. Ports P1-P6 are implemented in all MSP430x4xx devices. T opic Page 9.1 Digital I/O Introduction 9-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Digital I/O Operation 9-3 . . . . . . . . . . . . . . . . . . . . . . . . .[...]
-
Página 185
Digital I/O Introduction 9-2 Digital I/O 9.1 Digital I/O Introduction MSP430 devices have up to 6 digital I/O ports implemented, P1 - P6. Each port has eight I/O pins. Every I/O pin is individually configurable for input or output direction, and each I/O line can be individually read or written to. Ports P1 and P2 have interrupt capability . Each i[...]
-
Página 186
Digital I/O Operation 9-3 Digital I/O 9.2 Digital I/O Operation Th e digital I/O is configured with user software. The setup and operation of the digital I/O is discussed in the following sections. 9.2.1 Input Register PxIN Each bit in each PxIN register reflects the value of the input signal at the corresponding I/O pin when the pin is configured [...]
-
Página 187
Digital I/O Operation 9-4 Digital I/O 9.2.4 Function Select Registers PxSEL Port pins are often multiplexed with other peripheral module functions. See the device-specific data sheet to determine pin functions. Each PxSEL bit is used to select the pin function − I/O port or peripheral module function. Bit = 0: I/O Function is selected for the pin[...]
-
Página 188
Digital I/O Operation 9-5 Digital I/O 9.2.5 P1 and P2 Interrupts Each pin in ports P1 and P2 have interrupt capability , configured with the PxIFG, PxIE, and PxIES registers. All P1 pins source a single interrupt vector , and all P2 pins source a different single interrupt vector . The PxIFG register can be tested to determine the source of a P1 or[...]
-
Página 189
Digital I/O Operation 9-6 Digital I/O Interrupt Edge Select Registers P1IES, P2IES Each PxIES bit selects the interrupt edge for the corresponding I/O pin. Bit = 0: The PxIFGx flag is set with a low-to-high transition Bit = 1: The PxIFGx flag is set with a high-to-low transition Note: Writing to PxIESx Writing to P1IES, or P2IES can result in setti[...]
-
Página 190
Digital I/O Registers 9-7 Digital I/O 9.3 Digital I/O Registers Seven registers are used to configure P1 and P2. Four registers are used to configure ports P3 - P6. The digital I/O registers are listed in T able 9 − 1. T able 9−1. Digital I/O Registers Port Register Short Form Address Register T ype Initial State P1 Input P1IN 020h Read only ?[...]
-
Página 191
10-1 Watchdog Timer , Watchdog Timer+ The watchdog timer is a 16-bit timer that can be used as a watchdog or as an interval timer . This chapter describes the watchdog timer . The watchdog timer is implemented in all MSP430x4xx devices, except those with th[...]
-
Página 192
Watchdog Timer Introduction 10-2 Watchdog Timer , Watchdog Timer+ 10.1 W atchdog Timer Introduction The primary function of the watchdog timer (WDT) module is to perform a controlled system restart after a software problem occurs. If the selected time interval expires, a system reset is generated. If the watchdog function is not needed in an applic[...]
-
Página 193
Watchdog Timer Introduction 10-3 Watchdog Timer , Watchdog Timer+ Figure 10−1. Watchdog T imer Block Diagram WDTQn Y 1 2 3 4 Q6 Q9 Q13 Q15 16 − bit Counter CLK A B 1 1 AE N PUC SMCLK ACLK Clear Password Compare 0 0 0 0 1 1 1 1 WDTCNTCL WDTTMSEL WDTNMI WDTNMIES WDTIS1 WDTSSEL WDTIS0 WDTHOLD EQU EQU Write Enable Low Byte R / W MDB LSB MSB WDTCTL [...]
-
Página 194
Watchdog Timer Operation 10-4 Watchdog Timer , Watchdog Timer+ 10.2 W atchdog Timer Operation Th e WDT module can be configured as either a watchdog or interval timer with the WDTCTL register . The WDTCTL register also contains control bits to configure the RST /NMI pin. WDTCTL is a 16-bit, password-protected, read/write register . Any read or writ[...]
-
Página 195
Watchdog Timer Operation 10-5 Watchdog Timer , Watchdog Timer+ 10.2.4 Watchdog T imer Interrupts The WDT uses two bits in the SFRs for interrupt control. - The WDT interrupt flag, WDTIFG, located in IFG1.0 - The WDT interrupt enable, WDTIE, located in IE1.0 When using the WDT in the watchdog mode, the WDTIFG flag sources a reset vector interrupt. T[...]
-
Página 196
Watchdog Timer Operation 10-6 Watchdog Timer , Watchdog Timer+ 10.2.6 Operation in Low-Power Modes The MSP430 devices have several low-power modes. Different clock signals are available in different low-power modes. The requirements of the user ’ s application and the type of clocking used determine how the WDT should be configured. For example, [...]
-
Página 197
Watchdog Timer Registers 10-7 Watchdog Timer , Watchdog Timer+ 10.3 W atchdog Timer Registers The watchdog timer module registers are listed in T able 10 − 1. T able 10 − 1. Watchdog Timer Registers Register Short Form Register T ype Address Initial State W atchdog timer control register WDTCTL Read/write 0120h 06900h with PUC SFR interrupt ena[...]
-
Página 198
Watchdog Timer Registers 10-8 Watchdog Timer , Watchdog Timer+ WDTCTL, W atchdog Timer Register 15 14 13 12 1 1 10 9 8 Read as 069h WDTPW , must be written as 05Ah 76543 210 WDTHOLD WDTNMIES WDTNMI WDTTMSEL WDTCNTCL WDTSSEL WDTISx rw − 0 rw − 0 rw − 0 rw − 0 r0(w) rw − 0 rw − 0 rw − 0 WDTPW Bits 15-8 W atchdog timer password. Always r[...]
-
Página 199
Watchdog Timer Registers 10-9 Watchdog Timer , Watchdog Timer+ IE1, Interrupt Enable Register 1 76543 210 NMIIE WDTIE rw − 0 rw − 0 Bits 7-5 These bits may be used by other modules. See device-specific datasheet. NMIIE Bit 4 NMI interrupt enable. This bit enables the NMI interrupt. Because other bits in IE1 may be used for other modules, it is [...]
-
Página 200
Watchdog Timer Registers 10-10 Watchdog Timer , Watchdog Timer+ IFG1, Interrupt Flag Register 1 76543 210 NMIIFG WDTIFG rw − (0) rw − (0) Bits 7-5 These bits may be used by other modules. See device-specific datasheet. NMIIFG Bit 4 NMI interrupt flag. NMIIFG must be reset by software. Because other bits in IFG1 may be used for other modules, it[...]
-
Página 201
1 1-1 Basic Timer1 The Basic Timer1 module is two independent, cascadable 8-bit timers. This chapter describes the Basic T imer1. Basic Timer1 is implemented in all MSP430x4xx devices. T opic Page 1 1.1 Basic Timer1 Introduction 1 1−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 B[...]
-
Página 202
Basic Timer1 Introduction 1 1-2 Basic Timer1 1 1.1 Basic Timer1 Introduction The Basic T imer1 supplies LCD timing and low frequency time intervals. The Basic T imer1 is two independent 8-bit timers that can also be cascaded to form one 16-bit timer function. Some uses for the Basic T imer1 include: - Real-time clock (RTC) function - Software time [...]
-
Página 203
Basic Timer1 Introduction 1 1-3 Basic Timer1 Figure 1 1−1. Basic Timer1 Block Diagram BTCNT2 Set_BTIFG BTCNT1 EN1 CLK1 Q4 Q5 Q6 Q7 BTDIV BTHOLD ACLK EN2 CLK2 Q4 Q5 Q6 Q7 Q3 Q2 Q1 Q0 BTSSEL SMCLK BTIPx BTFRFQx ACLK:256 f LCD 00 01 10 11 11 10 01 00 111 11 0 101 100 001 01 1 010 000[...]
-
Página 204
Basic Timer1 Introduction 1 1-4 Basic Timer1 1 1.2 Basic Timer1 Operation The Basic T imer1 module can be configured as two 8-bit timers or one 16-bit timer with the BTCTL register . The BTCTL register is an 8-bit, read/write register . Any read or write access must use byte instructions. The Basic T imer1 controls the LCD frame frequency with BTCN[...]
-
Página 205
Basic Timer1 Introduction 1 1-5 Basic Timer1 1 1.2.4 Basic Timer1 Operation: Signal f LCD Th e LCD controller (but not the LCDA controller) uses the f LCD signal from the BTCNT1 t o generate the timing for common and segment lines. ACLK sources BTCNT1 and is assumed to be 32768 Hz for generating f LCD . The f LCD frequency is selected with the BTFR[...]
-
Página 206
Basic Timer1 Introduction 1 1-6 Basic Timer1 1 1.3 Basic Timer1 Registers The watchdog timer module registers are listed in T able 1 1 − 1. T able 1 1 − 1. Basic Timer1 Registers Register Short Form Register T ype Address Initial State Basic T imer1 Control BTCTL Read/write 040h Unchanged Basic T imer1 Counter 1 BTCNT1 Read/write 046h Unchanged[...]
-
Página 207
Basic Timer1 Introduction 1 1-7 Basic Timer1 BTCTL, Basic Timer1 Control Register 76543 210 BTSSEL BTHOLD BTDIV BTFRFQx BTIPx rw rw rw rw rw rw rw rw BTSSEL Bit 7 BTCNT2 clock select. This bit, together with the BTDIV bit, selects the clock source for BTCNT2. See the description for BTDIV . BTHOLD Bit 6 Basic T imer1 Hold. 0 BTCNT1 and BTCNT2 are o[...]
-
Página 208
Basic Timer1 Introduction 1 1-8 Basic Timer1 BTCNT1, Basic Timer1 Counter 1 76543 210 BTCNT1x rw rw rw rw rw rw rw rw BTCNT1x Bits 7 − 0 BTCNT1 register . The BTCNT1 register is the count of BTCNT1. BTCNT2, Basic Timer1 Counter 2 76543 210 BTCNT2x rw rw rw rw rw rw rw rw BTCNT2x Bits 7 − 0 BTCNT2 register . The BTCNT2 register is the count of B[...]
-
Página 209
Basic Timer1 Introduction 1 1-9 Basic Timer1 IE2, Interrupt Enable Register 2 76543 210 BTIE rw − 0 BTIE Bit 7 Basic T imer1 interrupt enable. This bit enables the BTIFG interrupt Because other bits in IE2 may be used for other modules, it is recommended to set or clear this bit using BIS.B or BIC.B instructions, rather than MOV.B or CLR.B instru[...]
-
Página 210
12-1 Timer_A T imer_A T imer_A is a 16-bit timer/counter with multiple capture/compare registers. This chapter describes T imer_A. T imer_A3 (three capture/compare registers) is implemented in all MSP430x4xx devices. Timer1_A5 (five capture/compare registers) is also implemented on MSP430x415, MSP430x417, and MSP430xW42x devices. T opic Page 12.1 T[...]
-
Página 211
Timer_A Introduction 12-2 Timer_A 12.1 Timer_A Introduction T imer_A is a 1 6 - bit timer/counter with three or five capture/compare registers. T imer_A can support multiple capture/compares, PWM outputs, and interval timing. Timer_A also has extensive interrupt capabilities. Interrupts may be generated from the counter on overflow conditions and f[...]
-
Página 212
Timer_A Introduction 12-3 Timer_A Figure 12−1. Timer_A Block Diagram CCR4 Compararator 2 CCI 15 0 CCISx OUTMODx Capture Mode CMx Sync SCS COV logic Output Unit4 D Set Q EQU0 OUT OUT2 Signal Reset GND VCC CCI4A CCI4B EQU4 Divider 1/2/4/8 Count Mode 16 − bit Timer TA R RC Set T AIFG 15 0 T ASSELx MCx IDx 00 01 10 11 Clear Timer Clock EQU0 Timer C[...]
-
Página 213
Timer_A Operation 12-4 Timer_A 12.2 Timer_A Operation The Timer_A module is configured with user software. The setup and operation of T imer_A is discussed in the following sections. 12.2.1 16-Bit Timer Counter The 16-bit timer/counter register , T AR, increments or decrements (depending on mode of operation) with each rising edge of the clock sign[...]
-
Página 214
Timer_A Operation 12-5 Timer_A 12.2.2 Starting the Timer The timer may be started, or restarted in the following ways: - The timer counts when MCx > 0 and the clock source is active. - When the timer mode is either up or up/down, the timer may be stopped by writing 0 to T ACCR0. The timer may then be restarted by writing a nonzero value to T ACC[...]
-
Página 215
Timer_A Operation 12-6 Timer_A Up Mode Th e 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 T ACCR0, which defines the period, as shown in Figure 12 − 2. The number of timer counts in the period is T ACCR0+1. When the timer value equals T ACCR0 the timer res[...]
-
Página 216
Timer_A Operation 12-7 Timer_A Continuous Mode In the continuous mode, the timer repeatedly counts up to 0FFFFh and restarts from zero as shown in Figure 12 − 4. The capture/compare register T ACCR0 works the same way as the other capture/compare registers. Figure 12 − 4. Continuous Mode 0h 0FFFFh The T AIFG interrupt flag is set when the timer[...]
-
Página 217
Timer_A Operation 12-8 Timer_A Use of the Continuous Mode Th e continuous mode can be used to generate independent time intervals and output frequencies. Each time an interval is completed, an interrupt is generated. The next time interval is added to the T ACCRx register in the interrupt service routine. Figure 12 − 6 shows two separate time int[...]
-
Página 218
Timer_A Operation 12-9 Timer_A Up/Down Mode The up/down mode is used if the timer period must be dif ferent from 0FFFFh counts, and if symmetrical pulse generation is needed. The timer repeatedly counts up to the value of compare register T ACCR0 and back down to zero, as shown in Figure 12 − 7. The period is twice the value in T ACCR0. Figure 12[...]
-
Página 219
Timer_A Operation 12-10 Timer_A Changing the Period Register T ACCR0 When changing T ACCR0 while the timer is running, and counting in the down direction, the timer continues its descent until it reaches zero. The new period takes affect after the counter counts down to zero. When the timer is counting in the up direction, and the new period is gre[...]
-
Página 220
Timer_A Operation 12-1 1 Timer_A 12.2.4 Capture/Compare Blocks Three or five identical capture/compare blocks, T ACCRx, are present in T imer_A. Any of the blocks may be used to capture the timer data, or to generate time intervals. Capture Mode Th e capture mode is selected when CAP = 1. Capture mode is used to record time events. It can be used f[...]
-
Página 221
Timer_A Operation 12-12 Timer_A Figure 12 − 1 1. Capture Cycle Second Capture T aken COV = 1 Capture T aken No Capture T aken Read T aken Capture Clear Bit COV in Register T ACCTLx Idle Idle Capture Capture Read and No Capture Capture Capture Read Capture Capture Initiated by Software Captures can be initiated by software. The CMx bits can be set[...]
-
Página 222
Timer_A Operation 12-13 Timer_A 12.2.5 Output Unit Each capture/compare block contains an output unit. The output unit is used to generate output signals such as PWM signals. Each output unit has eight operating modes that generate signals based on the EQU0 and EQUx signals. Output Modes The output modes are defined by the OUTMODx bits and are desc[...]
-
Página 223
Timer_A Operation 12-14 Timer_A Output Example — Timer in Up Mode The OUTx signal is changed when the timer counts up to the T ACCRx value, and rolls from T ACCR0 to zero, depending on the output mode. An example is shown in Figure 12 − 12 using T ACCR0 and T ACCR1. Figure 12 − 12. Output Example — Timer in Up Mode 0h 0FFFFh EQU0 T AIFG Out[...]
-
Página 224
Timer_A Operation 12-15 Timer_A Output Example — Timer in Continuous Mode The OUTx signal is changed when the timer reaches the T ACCRx and T ACCR0 values, depending on the output mode. An example is shown in Figure 12 − 13 using T ACCR0 and T ACCR1. Figure 12 − 13. Output Example — Timer in Continuous Mode 0h 0FFFFh T AIFG Output Mode 1: S[...]
-
Página 225
Timer_A Operation 12-16 Timer_A Output Example — Timer in Up/Down Mode The OUTx signal changes when the timer equals T ACCRx in either count direction and when the timer equals T ACCR0, depending on the output mode. An example is shown in Figure 12 − 14 using T ACCR0 and T ACCR2. Figure 12 − 14. Output Example — Timer in Up/Down Mode 0h 0FF[...]
-
Página 226
Timer_A Operation 12-17 Timer_A 12.2.6 Timer_A Interrupts T wo interrupt vectors are associated with the 16-bit Timer_A module: - T ACCR0 interrupt vector for T ACCR0 CCIFG - T AIV interrupt vector for all other CCIFG flags and T AIFG In capture mode any CCIFG flag is set when a timer value is captured in the associated T ACCRx register . In compar[...]
-
Página 227
Timer_A Operation 12-18 Timer_A T AIV Software Example Th e following software example shows the recommended use of T AIV and the handling overhead. The T AIV value is added to the PC to automatically jump to the appropriate routine. The numbers at the right margin show the necessary CPU cycles for each instruction. The software overhead for dif fe[...]
-
Página 228
Timer_A Registers 12-19 Timer_A 12.3 Timer_A Registers The T imer_A registers are listed in T able 12 − 3 and T able 12 − 4. T able 12 − 3. Timer_A3 Registers Register Short Form Register T ype Address Initial State T imer_A control T imer0_A3 Control T ACTL/ T A0CTL Read/write 0160h Reset with POR T imer_A counter T imer0_A3 counter T AR/ T [...]
-
Página 229
Timer_A Registers 12-20 Timer_A T ACTL, T imer_A Control Register 15 14 13 12 1 1 10 9 8 Unused T ASSELx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 IDx MCx Unused T ACLR T AIE T AIFG rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) w − (0) rw − (0) rw − (0) Unused Bits 15-10 Unused [...]
-
Página 230
Timer_A Registers 12-21 Timer_A T AR, Timer_A Register 15 14 13 12 1 1 10 9 8 T ARx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 T ARx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) T ARx Bits 15-0 T imer_A register . The T AR register is the count of Time[...]
-
Página 231
Timer_A Registers 12-22 Timer_A T ACCTLx, Capture/Compare Control Register 15 14 13 12 1 1 10 9 8 CMx CCISx SCS SCCI Unused CAP rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) r − (0) r − (0) rw − (0) 76543 210 OUTMODx CCIE CCI OUT COV CCIFG rw − (0) rw − (0) rw − (0) rw − (0) r rw − (0) rw − (0) rw − (0) CMx Bit 15-14 Ca[...]
-
Página 232
Timer_A Registers 12-23 Timer_A CCIE Bit 4 Capture/compare interrupt enable. This bit enables the interrupt request of the corresponding CCIFG flag. 0 Interrupt disabled 1 Interrupt enabled CCI Bit 3 Capture/compare input. The selected input signal can be read by this bit. OUT Bit 2 Output. For output mode 0, this bit directly controls the state of[...]
-
Página 233
13-1 Timer_B T imer_B T imer_B is a 16-bit timer/counter with multiple capture/compare registers. This chapter describes T imer_B. T imer_B3 (three capture/compare registers) is implemented in MSP430x43x devices. T imer_B7 (seven capture/compare registers) is implemented in MSP430x44x. T opic Page 13.1 Timer_B Introduction 13-2 . . . . . . . . . . [...]
-
Página 234
Timer_B Introduction 13-2 Timer_B 13.1 Timer_B Introduction T imer_B is a 16-bit timer/counter with three or seven capture/compare registers. T imer_B can support multiple capture/compares, PWM outputs, a n d interval timing. T imer_B also has extensive interrupt capabilities. Interrupts may be generated from the counter on overflow conditions and [...]
-
Página 235
Timer_B Introduction 13-3 Timer_B Figure 13−1. Timer_B Block Diagram CCR6 Compararator 6 CCI 15 0 OUTMODx Capture Mode CMx Sync COV logic Output Unit6 D Set Q EQU0 OUT OUT6 Signal Reset POR EQU6 Divider 1/2/4/8 Count Mode 16 − bit Timer TBR Set TBIFG 15 0 MCx IDx Clear TBCLR Timer Clock CCR0 EQU0 Timer Clock Timer Clock VCC TBR=0 UP/DOWN EQU0 C[...]
-
Página 236
Timer_B Operation 13-4 Timer_B 13.2 Timer_B Operation The Timer_B module is configured with user software. The setup and operation of T imer_B is discussed in the following sections. 13.2.1 16-Bit Timer Counter The 16-bit timer/counter register , TBR, increments or decrements (depending on mode of operation) with each rising edge of the clock signa[...]
-
Página 237
Timer_B Operation 13-5 Timer_B 13.2.2 Starting the Timer The timer may be started or restarted in the following ways: - The timer counts when MCx > 0 and the clock source is active. - When the timer mode is either up or up/down, the timer may be stopped by loading 0 to TBCL0. The timer may then be restarted by loading a nonzero value to TBCL0. I[...]
-
Página 238
Timer_B Operation 13-6 Timer_B Up Mode T h e up mode is used if the timer period must be dif ferent from TBR (max) counts. The timer repeatedly counts up to the value of compare latch TBCL0, which defines the period, as shown in Figure 13 − 2. The number of timer counts in the period is TBCL0+1. When the timer value equals TBCL0 the timer restart[...]
-
Página 239
Timer_B Operation 13-7 Timer_B Continuous Mode In continuous mode the timer repeatedly counts up to TBR (max) and restarts from zero as shown in Figure 13 − 4. The compare latch TBCL0 works the same way as the other capture/compare registers. Figure 13 − 4. Continuous Mode 0h TBR (max) The TBIFG interrupt flag is set when the timer counts from [...]
-
Página 240
Timer_B Operation 13-8 Timer_B Use of the Continuous Mode Th e continuous mode can be used to generate independent time intervals and output frequencies. Each time an interval is completed, an interrupt is generated. The next time interval is added to the TBCLx latch in the interrupt service routine. Figure 13 − 6 shows two separate time interval[...]
-
Página 241
Timer_B Operation 13-9 Timer_B Up/Down Mode Th e up/down mode is used if the timer period must be different from TBR (max) counts, and if symmetrical pulse generation is needed. The timer repeatedly counts up to the value of compare latch TBCL0, and back down to zero, as shown in Figure 13 − 7. The period is twice the value in TBCL0. Note: TBCL0 [...]
-
Página 242
Timer_B Operation 13-10 Timer_B Changing the V alue of Period Register TBCL0 When changing TBCL0 while the timer is running, and counting in the down direction, and when the TBCL0 load mode is immediate , the timer continues its descent until it reaches zero. The new period takes effect after the counter counts down to zero. If the timer is countin[...]
-
Página 243
Timer_B Operation 13-1 1 Timer_B 13.2.4 Capture/Compare Blocks Three or seven identical capture/compare blocks, TBCCRx, are present in T imer_B. Any of the blocks may be used to capture the timer data or to generate time intervals. Capture Mode Th e capture mode is selected when CAP = 1. Capture mode is used to record time events. It can be used fo[...]
-
Página 244
Timer_B Operation 13-12 Timer_B Figure 13 − 1 1. Capture Cycle Second Capture T aken COV = 1 Capture T aken No Capture T aken Read T aken Capture Clear Bit COV in Register TBCCTLx Idle Idle Capture Capture Read and No Capture Capture Capture Read Capture Capture Initiated by Software Captures can be initiated by software. The CMx bits can be set [...]
-
Página 245
Timer_B Operation 13-13 Timer_B Compare Latch TBCLx The TBCCRx compare latch, TBCLx, holds the data for the comparison to the timer value in compare mode. TBCLx is buf fered by TBCCRx. The buffered compare latch gives the user control over when a compare period updates. The user cannot directly access TBCLx. Compare data is written to each TBCCRx a[...]
-
Página 246
Timer_B Operation 13-14 Timer_B 13.2.5 Output Unit Each capture/compare block contains an output unit. The output unit is used to generate output signals such as PWM signals. Each output unit has eight operating modes that generate signals based on the EQU0 and EQUx signals. The TBOUTH pin function can be used to put all T imer_B outputs into a hig[...]
-
Página 247
Timer_B Operation 13-15 Timer_B Output Example—Timer in Up Mode Th e OUTx signal is changed when the timer counts up to the TBCLx value, and rolls from TBCL0 to zero, depending on the output mode. An example is shown in Figure 13 − 12 using TBCL0 and TBCL1. Figure 13 − 12. Output Example — Timer in Up Mode 0h TBR (max) EQU0 TBIFG Output Mod[...]
-
Página 248
Timer_B Operation 13-16 Timer_B Output Example — Timer in Continuous Mode The OUTx signal is changed when the timer reaches the TBCLx and TBCL0 values, depending on the output mode, An example is shown in Figure 13 − 13 using TBCL0 and TBCL1. Figure 13 − 13. Output Example — Timer in Continuous Mode 0h TBR (max) TBIFG Output Mode 1: Set Out[...]
-
Página 249
Timer_B Operation 13-17 Timer_B Output Example − Timer in Up/Down Mode The OUTx signal changes when the timer equals TBCLx in either count direction and when the timer equals TBCL0, depending on the output mode. An example is shown in Figure 13 − 14 using TBCL0 and TBCL3. Figure 13 − 14. Output Example — Timer in Up/Down Mode 0h TBR (max) T[...]
-
Página 250
Timer_B Operation 13-18 Timer_B 13.2.6 Timer_B Interrupts T wo interrupt vectors are associated with the 16-bit Timer_B module: - TBCCR0 interrupt vector for TBCCR0 CCIFG - TBIV interrupt vector for all other CCIFG flags and TBIFG In capture mode, any CCIFG flag is set when a timer value is captured in the associated TBCCRx register . In compare mo[...]
-
Página 251
Timer_B Operation 13-19 Timer_B TBIV , Interrupt Handler Examples Th e following software example shows the recommended use of TBIV and the handling overhead. The TBIV value is added to the PC to automatically jump to the appropriate routine. The numbers at the right margin show the necessary CPU clock cycles for each instruction. The software over[...]
-
Página 252
Timer_B Registers 13-20 Timer_B 13.3 Timer_B Registers The T imer_B registers are listed in T able 13 − 5. T able 13 − 5. Timer_B Registers Register Short Form Register T ype Address Initial State T imer_B control TBCTL Read/write 0180h Reset with POR T imer_B counter TBR Read/write 0190h Reset with POR T imer_B capture/compare control 0 TBCCTL[...]
-
Página 253
Timer_B Registers 13-21 Timer_B Timer_B Control Register TBCTL 15 14 13 12 1 1 10 9 8 Unused TBCLGRPx CNTLx Unused TBSSELx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 IDx MCx Unused TBCLR TBIE TBIFG rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) w − (0) rw − (0) rw − (0) Unused Bit[...]
-
Página 254
Timer_B Registers 13-22 Timer_B Unused Bit 3 Unused TBCLR Bit 2 T imer_B clear . Setting this bit resets TBR, the TBCLK divider , and the count direction. The TBCLR bit is automatically reset and is always read as zero. TBIE Bit 1 T imer_B interrupt enable. This bit enables the TBIFG interrupt request. 0 Interrupt disabled 1 Interrupt enabled TBIFG[...]
-
Página 255
Timer_B Registers 13-23 Timer_B TBCCTLx, Capture/Compare Control Register 15 14 13 12 1 1 10 9 8 CMx CCISx SCS CLLDx CAP rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) r − (0) rw − (0) 76543 210 OUTMODx CCIE CCI OUT COV CCIFG rw − (0) rw − (0) rw − (0) rw − (0) r rw − (0) rw − (0) rw − (0) CMx Bit 15-14 Capture [...]
-
Página 256
Timer_B Registers 13-24 Timer_B CCIE Bit 4 Capture/compare interrupt enable. This bit enables the interrupt request of the corresponding CCIFG flag. 0 Interrupt disabled 1 Interrupt enabled CCI Bit 3 Capture/compare input. The selected input signal can be read by this bit. OUT Bit 2 Output. For output mode 0, this bit directly controls the state of[...]
-
Página 257
Timer_B Registers 13-25 Timer_B TBIV , T imer_B Interrupt V ector Register 15 14 13 12 1 1 10 9 8 0 0000000 r0 r0 r0 r0 r0 r0 r0 r0 76543 210 0 0 0 0 TBIVx 0 r0 r0 r0 r0 r − (0) r − (0) r − (0) r0 TBIVx Bits 15-0 T imer_B interrupt vector value TBIV Contents Interrupt Source Interrupt Flag Interrupt Priority 00h No interrupt pending − 02h C[...]
-
Página 258
14-1 USART Peripheral Interface, UAR T Mode The universal synchronous/asynchronous receive/transmit (USAR T) peripheral interface supports two serial modes with one hardware module. This chapter discusses the operation of the asynchronous UART [...]
-
Página 259
USART Introduction: UAR T Mode 14-2 USART Peripheral Interface, UAR T Mode 14.1 USART Introduction: UART Mode In asynchronous mode, the USART connects the MSP430 to an external system via two external pins, URXD and UTXD. UAR T mode is selected when the SYNC bit is cleared. UART mode features include: - 7- or 8-bit data with odd, even, or non-parit[...]
-
Página 260
USART Introduction: UAR T Mode 14-3 USART Peripheral Interface, UAR T Mode Figure 14−1. USAR T Block Diagram: UART Mode Receiver Shift Register Transmit Shift Register Receiver Buffer UxRXBUF Transmit Buf fer UxTXBUF LISTEN MM UCLK Clock Phase and Polarity Receive Status SYNC CKPH CKPL SSEL1 SSEL0 UCLKI ACLK SMCLK SMCLK 00 01 10 11 OE PE BRK TXWA[...]
-
Página 261
USART Operation: UAR T Mode 14-4 USART Peripheral Interface, UAR T Mode 14.2 USART Operation: UART Mode In UAR T mode, the USART transmits and receives characters at a bit rate asynchronous to another device. T iming for each character is based on the selected baud rate of the USART . The transmit and receive functions use the same baud rate freque[...]
-
Página 262
USART Operation: UAR T Mode 14-5 USART Peripheral Interface, UAR T Mode 14.2.3 Asynchronous Communication Formats When two devices communicate asynchronously , the idle-line format is used for the protocol. When three or more devices communicate, the USAR T supports the idle-line and address-bit multiprocessor communication formats. Idle-Line Multi[...]
-
Página 263
USART Operation: UAR T Mode 14-6 USART Peripheral Interface, UAR T Mode The URXWIE bit is used to control data reception in the idle-line multiprocessor format. When the URXWIE bit is set, all non-address characters are assembled but not transferred into the UxRXBUF , and interrupts are not generated. When an address character is received, the rece[...]
-
Página 264
USART Operation: UAR T Mode 14-7 USART Peripheral Interface, UAR T Mode Address - Bit Multiprocessor Format When MM = 1, the address-bit multiprocessor format is selected. Each processed character contains an extra bit used as an address indicator shown in Figure 14 − 4. The first character in a block of characters carries a set address bit which[...]
-
Página 265
USART Operation: UAR T Mode 14-8 USART Peripheral Interface, UAR T Mode Automatic Error Detection Glitch suppression prevents the USART from being accidentally started. Any low-level on URXDx shorter than the deglitch time t τ (approximately 300 ns) will be ignored. See the device-specific datasheet for parameters. When a low period on URXDx excee[...]
-
Página 266
USART Operation: UAR T Mode 14-9 USART Peripheral Interface, UAR T Mode 14.2.4 USART Receive Enable Th e receive enable bit, URXEx, enables or disables data reception on URXDx as shown in Figure 14 − 5. Disabling the USART receiver stops the receive operation following completion of any character currently being received or immediately if no rece[...]
-
Página 267
USART Operation: UAR T Mode 14-10 USART Peripheral Interface, UAR T Mode 14.2.5 USART T ransmit Enable When UTXEx is set, the UAR T transmitter is enabled. T ransmission is initiated by writing data to UxTXBUF . The data is then moved to the transmit shift register on the next BITCLK after the TX shift register is empty , and transmission begins. T[...]
-
Página 268
USART Operation: UAR T Mode 14-1 1 USART Peripheral Interface, UAR T Mode 14.2.6 UART Baud Rate Generation The USART baud rate generator is capable of producing standard baud rates from non-standard source frequencies. The baud rate generator uses one prescaler/divider and a modulator as shown in Figure 14 − 7. This combination supports fractiona[...]
-
Página 269
USART Operation: UAR T Mode 14-12 USART Peripheral Interface, UAR T Mode Baud Rate Bit Timing Th e first stage of the baud rate generator is the 16-bit counter and comparator . At the beginning of each bit transmitted or received, the counter is loaded with INT(N/2) where N is the value stored in the combination of UxBR0 and UxBR1. The counter relo[...]
-
Página 270
USART Operation: UAR T Mode 14-13 USART Peripheral Interface, UART Mode T ransmit Bit Timing The timing for each character is the sum of the individual bit timings. By modulating each bit, the cumulative bit error is reduced. The individual bit error can be calculated by: Error [%] + NJ baud rate BRCLK ƪ ( j ) 1 ) UxBR ) S j i + 0 m i ƫ * ( j ) 1[...]
-
Página 271
USART Operation: UAR T Mode 14-14 USART Peripheral Interface, UAR T Mode Receive Bit Timing Receive timing consists of two error sources. The first is the bit-to-bit timing error . The second is the error between a start edge occurring and the start edge being accepted by the USART . Figure 14 − 9 shows the asynchronous timing errors between data[...]
-
Página 272
USART Operation: UAR T Mode 14-15 USART Peripheral Interface, UART Mode For example, the receive errors for the following conditions are calculated: Baud rate = 2400 BRCLK = 32,768 Hz (ACLK) UxBR = 13, since the ideal division factor is 13.65 UxMCTL = 6B:m7 = 0, m6 = 1, m5 = 1, m4 = 0, m3 = 1, m2 = 0, m1 = 1 and m0 = 1 The LSB of UxMCTL is used fir[...]
-
Página 273
USART Operation: UAR T Mode 14-16 USART Peripheral Interface, UAR T Mode T ypical Baud Rates and Errors Standard baud rate frequency data for UxBRx and UxMCTL are listed in T able 14 − 2 for a 32,768-Hz watch crystal (ACLK) and a typical 1,048,576-Hz SMCLK. Th e receive error is the accumulated time versus the ideal scanning time in the middle of[...]
-
Página 274
USART Operation: UAR T Mode 14-17 USART Peripheral Interface, UART Mode 14.2.7 USART Interrupts The USART has one interrupt vector for transmission and one interrupt vector for reception. USART T ransmit Interrupt Operation The UTXIFGx interrupt flag is set by the transmitter to indicate that UxTXBUF is ready to accept another character . An interr[...]
-
Página 275
USART Operation: UAR T Mode 14-18 USART Peripheral Interface, UAR T Mode USART Receive Interrupt Operation Th e URXIFGx interrupt flag is set each time a character is received and loaded into UxRXBUF . An interrupt request is generated if URXIEx and GIE are also set. URXIFGx and URXIEx are reset by a system reset PUC signal or when SWRST = 1 . URXI[...]
-
Página 276
USART Operation: UAR T Mode 14-19 USART Peripheral Interface, UART Mode Receive-Start Edge Detect Operation The URXSE bit enables the receive start-edge detection feature. The recommended usage of the receive-start edge feature is when BRCLK is sourced by the DCO and when the DCO is off because of low-power mode operation. The ultra-fast turn-on of[...]
-
Página 277
USART Operation: UAR T Mode 14-20 USART Peripheral Interface, UAR T Mode Receive-Start Edge Detect Conditions When URXSE = 1, glitch suppression prevents the USART from being accidentally started. Any low-level on URXDx shorter than the deglitch time t τ (approximately 300 ns) will be ignored by the USART and no interrupt request will be generated[...]
-
Página 278
USART Registers: UAR T Mode 14-21 USART Peripheral Interface, UART Mode 14.3 USART Registers: UART Mode T able 14 − 3 lists the registers for all devices implementing a USART module. T able 14 − 4 applies only to devices with a second USART module, USAR T1. T able 14 − 3. USAR T0 Control and Status Registers Register Short Form Register T ype[...]
-
Página 279
USART Registers: UAR T Mode 14-22 USART Peripheral Interface, UAR T Mode UxCTL, USART Control Register 76543 210 PENA PEV SPB CHAR LISTEN SYNC MM SWRST rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 1 PENA Bit 7 Parity enable 0 Parity disabled. 1 Parity enabled. Parity bit is generated (UTXDx) and expected (URXDx). In address[...]
-
Página 280
USART Registers: UAR T Mode 14-23 USART Peripheral Interface, UART Mode UxTCTL, USART T ransmit Control Register 76543 210 Unused CKPL SSELx URXSE TXW AKE Unused TXEPT rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 1 Unused Bit 7 Unused CKPL Bit 6 Clock polarity select 0 UCLKI = UCLK 1 UCLKI = inverted UCLK SSELx Bits 5-4 Sou[...]
-
Página 281
USART Registers: UAR T Mode 14-24 USART Peripheral Interface, UAR T Mode UxRCTL, USART Receive Control Register 76543 210 FE PE OE BRK URXEIE URXWIE RXW AKE RXERR rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 FE Bit 7 Framing error flag 0 No error 1 Character received with low stop bit PE Bit 6 Parity error flag. When PENA[...]
-
Página 282
USART Registers: UAR T Mode 14-25 USART Peripheral Interface, UART Mode UxBR0, USART Baud Rate Control Register 0 76543 210 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 rw rw rw rw rw rw rw rw UxBR1, USART Baud Rate Control Register 1 76543 210 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 rw rw rw rw rw rw rw rw UxBRx The valid baud-rate control range is 3 ≤ UxBR &l[...]
-
Página 283
USART Registers: UAR T Mode 14-26 USART Peripheral Interface, UAR T Mode UxRXBUF , USART Receive Buffer Register 76543 210 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 rrrrrrrr UxRXBUFx Bits 7 − 0 The receive-data buffer is user accessible and contains the last received character from the receive shift register . Reading UxRXBUF resets the receive-error bits,[...]
-
Página 284
USART Registers: UAR T Mode 14-27 USART Peripheral Interface, UART Mode ME1, Module Enable Register 1 76543 210 UTXE0 URXE0 rw − 0 rw − 0 UTXE0 Bit 7 USART0 transmit enable. This bit enables the transmitter for USART0. 0 Module not enabled 1 Module enabled URXE0 Bit 6 USAR T0 receive enable. This bit enables the receiver for USART0. 0 Module no[...]
-
Página 285
USART Registers: UAR T Mode 14-28 USART Peripheral Interface, UAR T Mode IE1, Interrupt Enable Register 1 76543 210 UTXIE0 URXIE0 rw − 0 rw − 0 UTXIE0 Bit 7 USART0 transmit interrupt enable. This bit enables the UTXIFG0 interrupt. 0 Interrupt not enabled 1 Interrupt enabled URXIE0 Bit 6 USAR T0 receive interrupt enable. This bit enables the URX[...]
-
Página 286
USART Registers: UAR T Mode 14-29 USART Peripheral Interface, UART Mode IFG1, Interrupt Flag Register 1 76543 210 UTXIFG0 URXIFG0 rw − 1 rw − 0 UTXIFG0 † Bit 7 USART0 transmit interrupt flag. UTXIFG0 is set when U0TXBUF is empty . 0 No interrupt pending 1 Interrupt pending URXIFG0 † Bit 6 USAR T0 receive interrupt flag. URXIFG0 is set when [...]
-
Página 287
15-1 USART Peripheral Interface, SPI Mode USART Peripheral Interface, SPI Mode The universal synchronous/asynchronous receive/transmit (USAR T) peripheral interface supports two serial modes with one hardware module. This chapter discusses the operation of the synchronous peripheral interface or SPI mode. USAR T0 is implemented on the MSP430x42x an[...]
-
Página 288
USART Introduction: SPI Mode 15-2 USART Peripheral Interface, SPI Mode 15.1 USART Introduction: SPI Mode In synchronous mode, the USART connects the MSP430 to an external system via three or four pins: SIMO, SOMI, UCLK, and STE. SPI mode is selected when the SYNC bit is set and the I2C bit is cleared. SPI mode features include: - 7- or 8-bit data l[...]
-
Página 289
USART Introduction: SPI Mode 15-3 USART Peripheral Interface, SPI Mode Figure 15−1. USAR T Block Diagram: SPI Mode Receiver Shift Register Transmit Shift Register Receiver Buffer UxRXBUF Transmit Buf fer UxTXBUF LISTEN MM UCLK Clock Phase and Polarity Receive Status SYNC CKPH CKPL SSEL1 SSEL0 UCLKI ACLK SMCLK SMCLK 00 01 10 11 OE PE BRK TXWAKE UC[...]
-
Página 290
USART Operation: SPI Mode 15-4 USART Peripheral Interface, SPI Mode 15.2 USART Operation: SPI Mode In SPI mode, serial data is transmitted and received by multiple devices using a shared clock provided by the master . An additional pin, STE, is provided as to enable a device to receive and transmit data and is controlled by the master . Three or fo[...]
-
Página 291
USART Operation: SPI Mode 15-5 USART Peripheral Interface, SPI Mode 15.2.2 Master Mode Figure 15 − 2. USART Master and External Slave Receive Buffer UxRXBUF Receive Shift Register MSB LSB Transmit Buf fer UxTXBUF Transmit Shift Register MSB LSB SPI Receive Buffer Data Shift Register (DSR) MSB LSB SOMI SOMI SIMO SIMO MASTER SLA VE Px.x STE STE SS [...]
-
Página 292
USART Operation: SPI Mode 15-6 USART Peripheral Interface, SPI Mode 15.2.3 Slave Mode Figure 15 − 3. USART Slave and External Master Receive Buffer UxRXBUF Receive Shift Register LSB MSB Transmit Buf fer UxTXBUF Transmit Shift Register LSB MSB SPI Receive Buffer Data Shift Register DSR LSB MSB SOMI SOMI SIMO SIMO MASTER SLA VE Px.x STE STE SS Por[...]
-
Página 293
USART Operation: SPI Mode 15-7 USART Peripheral Interface, SPI Mode 15.2.4 SPI Enable The SPI transmit/receive enable bit USPIEx enables or disables the USART in SPI mode. When USPIEx = 0, the USART stops operation after the current transfer completes, or immediately if no operation is active. A PUC or set SWRST bit disables the USAR T immediately [...]
-
Página 294
USART Operation: SPI Mode 15-8 USART Peripheral Interface, SPI Mode Receive Enable The SPI receive enable state diagrams are shown in Figure 15 − 6 and Figure 15 − 7. When USPIEx = 0, UCLK is disabled from shifting data into the RX shift register . Figure 15 − 6. SPI Master Receive-Enable State Diagram Idle State (Receiver Enabled) Receive Di[...]
-
Página 295
USART Operation: SPI Mode 15-9 USART Peripheral Interface, SPI Mode 15.2.5 Serial Clock Control UCLK is provided by the master on the SPI bus. When MM = 1, BITCLK is provided by the USAR T baud rate generator on the UCLK pin as shown in Figure 15 − 8. When MM = 0, the USART clock is provided on the UCLK pin by the master and, the baud rate genera[...]
-
Página 296
USART Operation: SPI Mode 15-10 USART Peripheral Interface, SPI Mode Serial Clock Polarity and Phase The polarity and phase of UCLK are independently configured via the CKPL and CKPH control bits of the USART . T iming for each case is shown in Figure 15 − 9. Figure 15 − 9. USART SPI T iming CKPH CKPL Cycle# UCLK UCLK UCLK UCLK SIMO/ SOMI SIMO/[...]
-
Página 297
USART Operation: SPI Mode 15-1 1 USART Peripheral Interface, SPI Mode 15.2.6 SPI Interrupts The USART has one interrupt vector for transmission and one interrupt vector for reception. SPI T ransmit Interrupt Operation The UTXIFGx interrupt flag is set by the transmitter to indicate that UxTXBUF is ready to accept another character . An interrupt re[...]
-
Página 298
USART Operation: SPI Mode 15-12 USART Peripheral Interface, SPI Mode SPI Receive Interrupt Operation Th e URXIFGx interrupt flag is set each time a character is received and loaded into UxRXBUF as shown in Figure 15 − 1 1 and Figure 15 − 12. An interrupt request is generated if URXIEx and GIE are also set. URXIFGx and URXIEx are reset by a syst[...]
-
Página 299
USART Registers: SPI Mode 15-13 USART Peripheral Interface, SPI Mode 15.3 USART Registers: SPI Mode T able 15 − 1 lists the registers for all devices implementing a USART module. T able 15 − 2 applies only to devices with a second USART module, USAR T1. T able 15 − 1. USAR T0 Control and Status Registers Register Short Form Register T ype Add[...]
-
Página 300
USART Registers: SPI Mode 15-14 USART Peripheral Interface, SPI Mode UxCTL, USART Control Register 76543 210 Unused Unused I2C † CHAR LISTEN SYNC MM SWRST rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 1 Unused Bits 7 − 6 Unused I2C † Bit 5 I2C mode enable. This bit selects I2C or SPI operation when SYNC = 1. 0 SPI mode[...]
-
Página 301
USART Registers: SPI Mode 15-15 USART Peripheral Interface, SPI Mode UxTCTL, USART T ransmit Control Register 76543 210 CKPH CKPL SSELx Unused Unused STC TXEPT rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 1 CKPH Bit 7 Clock phase select. Controls the phase of UCLK. 0 Normal UCLK clocking scheme 1 UCLK is delayed by one half[...]
-
Página 302
USART Registers: SPI Mode 15-16 USART Peripheral Interface, SPI Mode UxRCTL, USART Receive Control Register 76543 210 FE Unused OE Unused Unused Unused Unused Unused rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 FE Bit 7 Framing error flag. This bit indicates a bus conflict when MM = 1 and STC = 0. FE is unused in slave mo[...]
-
Página 303
USART Registers: SPI Mode 15-17 USART Peripheral Interface, SPI Mode UxBR0, USART Baud Rate Control Register 0 76543 210 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 rw rw rw rw rw rw rw rw UxBR1, USART Baud Rate Control Register 1 76543 210 2 15 2 14 2 13 2 12 2 11 2 10 2 9 2 8 rw rw rw rw rw rw rw rw UxBRx The baud-rate generator uses the content of {UxBR1+Ux[...]
-
Página 304
USART Registers: SPI Mode 15-18 USART Peripheral Interface, SPI Mode UxRXBUF , USART Receive Buffer Register 76543 210 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 rrrrrrrr UxRXBUFx Bits 7 − 0 The receive-data buffer is user accessible and contains the last received character from the receive shift register . Reading UxRXBUF resets the OE bit and URXIFGx flag[...]
-
Página 305
USART Registers: SPI Mode 15-19 USART Peripheral Interface, SPI Mode ME1, Module Enable Register 1 76543 210 USPIE0 rw − 0 Bit 7 This bit may be used by other modules. See device-specific datasheet. USPIE0 Bit 6 USAR T0 SPI enable. This bit enables the SPI mode for USART0. 0 Module not enabled 1 Module enabled Bits 5-0 These bits may be used by o[...]
-
Página 306
USART Registers: SPI Mode 15-20 USART Peripheral Interface, SPI Mode IE1, Interrupt Enable Register 1 76543 210 UTXIE0 URXIE0 rw − 0 rw − 0 UTXIE0 Bit 7 USART0 transmit interrupt enable. This bit enables the UTXIFG0 interrupt. 0 Interrupt not enabled 1 Interrupt enabled URXIE0 Bit 6 USAR T0 receive interrupt enable. This bit enables the URXIFG0[...]
-
Página 307
USART Registers: SPI Mode 15-21 USART Peripheral Interface, SPI Mode IFG1, Interrupt Flag Register 1 76543 210 UTXIFG0 URXIFG0 rw − 1 rw − 0 UTXIFG0 Bit 7 USART0 transmit interrupt flag. UTXIFG0 is set when U0TXBUF is empty . 0 No interrupt pending 1 Interrupt pending URXIFG0 Bit 6 USAR T0 receive interrupt flag. URXIFG0 is set when U0RXBUF has[...]
-
Página 308
16-1 OA OA The OA is a general purpose operational amplifier . This chapter describes the OA. Three OA modules are implemented in the MSP430FG43x devices. T opic Page 16.1 OA Introduction 16-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16.2 OA Operation 16-4 . . . . . . . . . . . . . . . . . . . . . [...]
-
Página 309
OA Introduction 16-2 OA 16.1 OA Introduction The OA op amps support front-end analog signal conditioning prior to analog- to-digital conversion. Features of the OA include: - Single supply , low-current operation - Rail-to-rail output - Software selectable Rail-to-Rail input - Programmable settling time vs. power consumption - Software selectable c[...]
-
Página 310
OA Introduction 16-3 OA Figure 16−1. OA Block Diagram OAPMx OAPx 0 1 1 OAFBRx A12 ext. (OA0) A13 ext. (OA1) A14 ext. (OA2) OAADC0 4R 4R 2R 2R R R R R OAxOUT R BOTT OM R TOP OAx + − OAFCx={2 − 7} OAFBRx > 0 OAADC1 OAFCx=0 OAFCx=1 R BOTT OM OAxT AP OAFCx=6 OAxI0 OA0I1 Int. DAC12_0OUT 00 01 10 11 0 1 OANx=3 00 01 10 11 OAFCx 3 NA 000 001 100 [...]
-
Página 311
OA 16-4 OA 16.2 OA Operation The OA module is configured with user software. The setup and operation of the OA is discussed in the following sections. 16.2.1 OA Amplifier The OA is a configurable, low-current, rail-to-rail operational amplifier . It can be configured as an inverting amplifier , or a non-inverting amplifier , or can be combined with[...]
-
Página 312
OA 16-5 OA 16.2.4 OA Configurations T h e OA can be configured for different amplifier functions with the OAFCx bits. as listed in T able 16 − 1. T able 16 − 1. OA Mode Select OAFCx OA Mode 000 General-purpose opamp 001 Unity gain buffer 010 Reserved 01 1 Comparator 100 Non-inverting PGA amplifier 101 Reserved 1 10 Inverting PGA amplifier 111 D[...]
-
Página 313
OA 16-6 OA Non-Inverting PGA Mode In this mode the output of the OAx is connected to R TOP and R BOTTOM is connected t o A V SS . The OAxT AP signal is connected to the inverting input of th e OAx providing a non-inverting amplifier configuration with a programmable gain of [1+OAxT AP ratio]. The OAxT AP ratio is selected by the OAFBRx bits. If the[...]
-
Página 314
OA 16-7 OA Figure 16 − 2 shows an example of a two-opamp differential amplifier using OA 0 and OA1. The control register settings and are shown in T able 16 − 2. The gain for the amplifier is selected by the OAFBRx bits for OA1 and is shown in T able 16 − 3. The OAx interconnections are shown in Figure 16 − 3. T able 16 − 2. T wo-Opamp Di[...]
-
Página 315
OA 16-8 OA Figure 16 − 3. T wo Opamp Differential Amplifier OAx Interconnections OAPx 00 01 10 11 OAPMx 0 1 1 OAFBRx A13 ext. OAADC0 4R 4R 2R 2R R R R R OA1 + − OAADC1 0 1 00 01 10 11 000 001 100 01 1 010 111 11 0 101 000 001 100 01 1 010 111 11 0 101 3 00 01 10 11 A3 int./ext., OA1O A13 int. 0 1 OAADC1 OAPMx OAPx OA0OUT OA0 + − 00 01 10 11 0[...]
-
Página 316
OA 16-9 OA Figure 16 − 4 shows an example of a three-opamp differential amplifier using OA0, OA1 and OA2. The control register settings are shown in T able 16 − 4. Th e gain for the amplifier is selected by the OAFBRx bits of OA0 and OA2. The OAFBRx settings for both OA0 and OA2 must be equal. The gain settings are shown in T able 16 − 5. The[...]
-
Página 317
OA 16-10 OA Figure 16 − 5. Three Opamp Differential Amplifier OAx Interconnections OAPMx OAPx OAFBRx 4R 4R 2R 2R R R R R OA0OUT OA0R BOTTOM OA0 + − OA0T AP 00 01 10 11 0 1 00 01 10 11 000 001 100 01 1 010 111 11 0 101 000 001 100 01 1 010 111 11 0 101 3 OAPMx 0 1 1 OAFBRx A14 ext. OAADC0 4R 4R 2R 2R R R R R OA2 + − OAADC1 0 1 00 01 10 11 000 [...]
-
Página 318
OA Registers 16-1 1 OA 16.3 OA Registers The OA registers are listed in T able 16 − 6. T able 16 − 6. Register Short Form Register T ype Address Initial State OA0 Control Register 0 OA0CTL0 Read/write 0C0h Reset with POR OA0 Control Register 1 OA0CTL1 Read/write 0C1h Reset with POR OA1 Control Register 0 OA1CTL0 Read/write 0C2h Reset with POR O[...]
-
Página 319
OA Registers 16-12 OA OAxCTL0, Opamp Control Register 0 76543 210 OANx OAPx OAPMx OAADC1 OAADC0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 OANx Bits 7-6 Inverting input select. These bits select the input signal for the OA inverting input. 00 OAxI0 01 OAxI1 10 DAC0 internal 1 1 DAC1 internal OAPx Bits 5-4 Non-inverting [...]
-
Página 320
OA Registers 16-13 OA OAxCTL1, Opamp Control Register 1 76543 210 OAFBRx OAFCx Reserved OARRIP rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 OAFBRx Bits 7-5 OAx feedback resistor select 000 T ap 0 001 T ap 1 010 T ap 2 01 1 T ap 3 100 T ap 4 101 T ap 5 1 10 T ap 6 111 Ta p 7 OAFCx Bits 4-2 OAx function control. This bit se[...]
-
Página 321
17-1 Comparator_A Comparator_A Comparator_A is an analog voltage comparator . This chapter describes Comparator_A. Comparator_A is implemented in all MSP430x4xx devices. T opic Page 17.1 Comparator_A Introduction 17-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17.2 Comparator_A Operation 17-4 . . . . . . . . . . . . . . .[...]
-
Página 322
Comparator_A Introduction 17-2 Comparator_A 17.1 Comparator_A Introduction The comparator_A module supports precision slope analog-to-digital conversions, supply voltage supervision, and monitoring of external analog signals. Features of Comparator_A include: - Inverting and non-inverting terminal input multiplexer - Software selectable RC-filter f[...]
-
Página 323
Comparator_A Introduction 17-3 Comparator_A Figure 17−1. Comparator_A Block Diagram CAOUT + − CAEX 0.5x 0.25x Set_CAIFG CA1 CCI1B + − 0V G D S P2CA0 P2CA1 CAF CARSEL CAON CAREFx 10 00 01 10 11 00 01 10 11 1 0 1 0 1 0 1 0 1 0 0V 10 V CAREF CA0 0 1 0 1 V CC V CC V CC T au ~ 2.0 m s[...]
-
Página 324
Comparator_A Operation 17-4 Comparator_A 17.2 Comparator_A Operation The comparator_A module is configured with user software. The setup and operation of comparator_A is discussed in the following sections. 17.2.1 Comparator The comparator compares the analog voltages at the + and – input terminals. If the + terminal is more positive than the –[...]
-
Página 325
Comparator_A Operation 17-5 Comparator_A 17.2.3 Output Filter The output of the comparator can be used with or without internal filtering. When control bit CAF is set, the output is filtered with an on-chip RC-filter . Any comparator output oscillates if the voltage difference across the input terminals i s small. Internal and external parasitic ef[...]
-
Página 326
Comparator_A Operation 17-6 Comparator_A 17.2.5 Comparator_A, Port Disable Register CAPD Th e comparator input and output functions are multiplexed with the associated I/O port pins, which are digital CMOS gates. When analog signals are applied to digital CMOS gates, parasitic current can flow from V CC to GND. This parasitic current occurs if the [...]
-
Página 327
Comparator_A Operation 17-7 Comparator_A 17.2.7 Comparator_A Used to Measure Resistive Elements The Comparator_A can be optimized to precisely measure resistive elements using single slope analog-to-digital conversion. For example, temperature can be converted into digital data using a thermistor , by comparing the thermistor ’ s capacitor discha[...]
-
Página 328
Comparator_A Operation 17-8 Comparator_A The thermistor measurement is based on a ratiometric conversion principle. The ratio of two capacitor discharge times is calculated as shown in Figure 17 − 6. Figure 17 − 6. Timing for T emperature Measurement Systems V C V CC 0.25 × V CC Phase I: Charge Phase II: Discharge Phase III: Charge t ref Phase[...]
-
Página 329
Comparator_A Registers 17-9 Comparator_A 17.3 Comparator_A Registers The Comparator_A registers are listed in T able 17 − 1. T able 17 − 1. Comparator_A Registers Register Short Form Register T ype Address Initial State Comparator_A control register 1 CACTL1 Read/write 059h Reset with POR Comparator_A control register 2 CACTL2 Read/write 05Ah R[...]
-
Página 330
Comparator_A Registers 17-10 Comparator_A CACTL1, Comparator_A Control Register 1 76543 210 CAEX CARSEL CAREFx CAON CAIES CAIE CAIFG rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) CAEX Bit 7 Comparator_A exchange. This bit exchanges the comparator inputs and inverts the comparator output. CARSEL Bit 6 Compar[...]
-
Página 331
Comparator_A Registers 17-1 1 Comparator_A CACTL2, Comparator_A Control Register 2 76543 210 Unused P2CA1 P2CA0 CAF CAOUT rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) r − (0) Unused Bits 7-4 Unused. P2CA1 Bit 3 Pin to CA1. This bit selects the CA1 pin function. 0 The pin is not connected to CA1 1 The pin is connect[...]
-
Página 332
18-1 LCD Controller LCD Controller The LCD controller drives static, 2-mux, 3-mux, or 4-mux LCDs. This chapter describes LCD controller . The LCD controller is implemented on all MSP430x4xx devices, except the MSP430x42x0 devices. T opic Page 18.1 LCD Controller Introduction 18−2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]
-
Página 333
LCD Controller Introduction 18-2 LCD Controller 18.1 LCD Controller Introduction The LCD controller directly drives LCD displays by creating the ac segment and common voltage signals automatically . The MSP430 LCD controller can support static, 2-mux, 3-mux, and 4-mux LCDs. The LCD controller features are: - Display memory - Automatic signal genera[...]
-
Página 334
LCD Controller Introduction 18-3 LCD Controller Figure 18−1. LCD Controller Block Diagram Display Memory 20x 8 − bits Segment Output Control Mux Analog V oltage Multiplexer Timing Generator R23 R13 R03 COM0 COM2 COM1 R33 COM3 S0 S1 Common Output Control S39 S38 SEG0 SEG1 SEG38 SEG39 Mux Mux Mux LCDP2 LCDP1 LCDP0 LCDMX1 LCDMX0 LCDSON LCDON f LCD[...]
-
Página 335
LCD Controller Operation 18-4 LCD Controller 18.2 LCD Controller Operation The LCD controller is configured with user software. The setup and operation of LCD controller is discussed in the following sections. 18.2.1 LCD Memory Th e LCD memory map is shown in Figure 18 − 2. Each memory bit corresponds to one LCD segment, or is not used, depending[...]
-
Página 336
LCD Controller Operation 18-5 LCD Controller 18.2.4 LCD V oltage Generation The voltages required for the LCD signals are supplied externally to pins R33, R23, R13, and R03. Using an equally weighted resistor divider ladder between these pins establishes the analog voltages as shown in T able 18 − 1. The resistor value R is typically 680 k W. V a[...]
-
Página 337
LCD Controller Operation 18-6 LCD Controller 18.2.6 Static Mode In static mode, each MSP430 segment pin drives one LCD segment and one common line, COM0, is used. Figure 18 − 3 shows some example static waveforms. Figure 18 − 3. Example Static Waveforms f frame COM0 SP1 SP2 Resulting V oltage for Segment a (COM0 − SP1) Segment Is On. COM0 SP1[...]
-
Página 338
LCD Controller Operation 18-7 LCD Controller Figure 18 − 4 shows an example static LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 18 − 4. Static LCD Example A B G 0 3 Sn+1 Sn P[...]
-
Página 339
LCD Controller Operation 18-8 LCD Controller Static Mode Software Example ; Al l eight segments of a digit are often located in four ; display memory bytes with the static display method. ; a EQU 001h b EQU 010h c EQU 002h d EQU 020h e EQU 004h f EQU 040h g EQU 008h h EQU 080h ; The register content of Rx should be displayed. : The Table represents[...]
-
Página 340
LCD Controller Operation 18-9 LCD Controller 18.2.7 2-Mux Mode In 2-mux mode, each MSP430 segment pin drives two LCD segments and two common lines, COM0 and COM1, are used. Figure 18 − 5 shows some example 2-mux waveforms. Figure 18 − 5. Example 2- Mux Waveforms COM1 COM0 COM0 COM1 SP1 SP2 SP1 SP2 SP3 SP4 V1 V3 V5 V1 V5 V1 V5 V1 V3 0 V − V3 ?[...]
-
Página 341
LCD Controller Operation 18-10 LCD Controller Figure 18 − 6 shows an example 2-mux LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application completely depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 18 − 6. 2 − Mux LCD Example 28 d [...]
-
Página 342
LCD Controller Operation 18-1 1 LCD Controller 2-Mux Mode Software Example ; Al l eight segments of a digit are often located in two ; display memory bytes with the 2mux display rate ; a EQU 002h b EQU 020h c EQU 008h d EQU 004h e EQU 040h f EQU 001h g EQU 080h h EQU 010h ; The register content of Rx should be displayed. ; The Table represents the [...]
-
Página 343
LCD Controller Operation 18-12 LCD Controller 18.2.8 3-Mux Mode In 3-mux mode, each MSP430 segment pin drives three LCD segments and three common lines, COM0, COM1 and COM2 are used. Figure 18 − 7 shows some example 3-mux waveforms. Figure 18 − 7. Example 3- Mux Waveforms COM0 COM1 COM2 COM0 COM2 SP1 SP2 SP3 SP3 SP2 SP1 f frame V1 V 2 V4 V5 V1 [...]
-
Página 344
LCD Controller Operation 18-13 LCD Controller Figure 18 − 8 shows an example 3-mux LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 18 − 8. 3-Mux LCD Example 28 e h d A B G 0 3 A[...]
-
Página 345
LCD Controller Operation 18-14 LCD Controller 3-Mux Mode Software Example ; Th e 3mux rate can support nine segments for each ; digit. The nine segments of a digit are located in ; 1 1/2 display memory bytes. ; a EQU 0040h b EQU 0400h c EQU 0200h d EQU 0010h e EQU 0001h f EQU 0002h g EQU 0020h h EQU 0100h Y EQU 0004h ; The LSDigit of register Rx sh[...]
-
Página 346
LCD Controller Operation 18-15 LCD Controller 18.2.9 4-Mux Mode In 4-mux mode, each MSP430 segment pin drives four LCD segments and all four common lines, COM0, COM1, COM2, and COM3 are used. Figure 18 − 9 shows some example 4-mux waveforms. Figure 18 − 9. Example 4- Mux Waveforms f frame V1 V2 V4 V5 V1 0 V − V1 V1 0 V − V1 COM0 COM1 COM2 C[...]
-
Página 347
LCD Controller Operation 18-16 LCD Controller Figure 18 − 10 shows an example 4-mux LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 18 − 10. 4-Mux LCD Example ed 26 28 A B G 0 3[...]
-
Página 348
LCD Controller Operation 18-17 LCD Controller 4-Mux Mode Software Example ; Th e 4mux rate supports eight segments for each digit. ; All eight segments of a digit can often be located in ; one display memory byte a EQU 080h b EQU 040h c EQU 020h d EQU 001h e EQU 002h f EQU 008h g EQU 004h h EQU 010h ; ; The LSDigit of register Rx should be displaye[...]
-
Página 349
LCD Controller Operation 18-18 LCD Controller 18.3 LCD Controller Registers The LCD Controller registers are listed in T able 18 − 2. T able 18 − 2. LCD Controller Registers Register Short Form Register T ype Address Initial State LCD control register LCDCTL Read/write 090h Reset with PUC LCD memory 1 LCDM1 Read/write 091h Unchanged LCD memory [...]
-
Página 350
LCD Controller Operation 18-19 LCD Controller LCDCTL, LCD Control Register 76543 210 LCDPx LCDMXx LCDSON Unused LCDON rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 LCDPx Bits 7-5 LCD Port Select. These bits select the pin function to be port I/O or LCD function for groups of segments pins. These bits ONL Y affect pins with[...]
-
Página 351
19-1 LCD_A Controller LCD_A Controller The LCD_A controller drives static, 2-mux, 3-mux, or 4-mux LCDs. This chapter describes the LCD_A controller . The LCD_A controller is implemented on the MSP430x42x0 and MSP430F46xx devices. T opic Page 19.1 LCD Controller Introduction 19 − 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [...]
-
Página 352
LCD_A Controller Introduction 19-2 LCD_A Controller 19.1 LCD_A Controller Introduction Th e LCD_A controller directly drives LCD displays by creating the ac segment and common voltage signals automatically . The MSP430 LCD controller can support static, 2-mux, 3-mux, and 4-mux LCDs. The LCD controller features are: - Display memory - Automatic sign[...]
-
Página 353
LCD_A Controller Introduction 19-3 LCD_A Controller Figure 19−1. LCD_A Controller Block Diagram VLCDREFx Display Memory 20x 8 − bits Segment Output Control Mux Analog V oltage Multiplexer Timing Generator COM0 COM2 COM1 COM3 S0 S1 Common Output Control S39 S38 SEG0 SEG1 SEG38 SEG39 Mux Mux Mux LCDSx LCDMXx LCDSON LCDON f LCD OSCOFF (from SR) V1[...]
-
Página 354
LCD_A Controller Operation 19-4 LCD_A Controller 19.2 LCD_A Controller Operation The LCD_A controller is configured with user software. The setup and operation of the LCD_A controller is discussed in the following sections. 19.2.1 LCD Memory Th e LCD memory map is shown in Figure 19 − 2. Each memory bit corresponds to one LCD segment, or is not u[...]
-
Página 355
LCD_A Controller Operation 19-5 LCD_A Controller 19.2.3 LCD_A V oltage And Bias Generation The LCD_A module allows selectable sources for the peak output waveform voltage, V 1 , as well as the fractional LCD biasing voltages V2 − V5. V LCD may be sourced from A V CC , an internal charge pump, or externally . All internal voltage generation is dis[...]
-
Página 356
LCD_A Controller Operation 19-6 LCD_A Controller T o source the bias voltages V2 − V4 externally , REXT is set. This also disables the internal bias generation. T ypically an equally weighted resistor divider is used with resistors ranging from 100 k to 1 M When using an external resistor divider , the V LCD voltage may be sourced from[...]
-
Página 357
LCD_A Controller Operation 19-7 LCD_A Controller Th e internal bias generator supports 1/2 bias LCDs when LCD2B = 1, and 1/3 bias LCDs when LCD2B = 0 in 2-mux, 3-mux, and 4-mux modes. In static mode the internal divider is disabled. Some devices share the LCDCAP , R33, and R23 functions. In this case, the charge pump cannot be used together with an[...]
-
Página 358
LCD_A Controller Operation 19-8 LCD_A Controller 19.2.4 LCD Timing Generation Th e LCD_A controller uses the f LCD signal from the integrated ACLK prescaler to generate the timing for common and segment lines. ACLK is assumed to be 32768 Hz for generating f LCD . The f LCD frequency is selected with the LCDFREQx bits. The proper f LCD frequency dep[...]
-
Página 359
LCD_A Controller Operation 19-9 LCD_A Controller 19.2.6 Static Mode In static mode, each MSP430 segment pin drives one LCD segment and one common line, COM0, is used. Figure 19 − 4 shows some example static waveforms. Figure 19 − 4. Example Static Waveforms f frame COM0 SP1 SP2 Resulting V oltage for Segment a (COM0 − SP1) Segment Is On. COM0[...]
-
Página 360
LCD_A Controller Operation 19-10 LCD_A Controller Figure 19 − 5 shows an example static LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 19 − 5. Static LCD Example A B G 0 3 Sn+1[...]
-
Página 361
LCD_A Controller Operation 19-1 1 LCD_A Controller Static Mode Software Example ; Al l eight segments of a digit are often located in four ; display memory bytes with the static display method. ; a EQU 001h b EQU 010h c EQU 002h d EQU 020h e EQU 004h f EQU 040h g EQU 008h h EQU 080h ; The register content of Rx should be displayed. : The Table repr[...]
-
Página 362
LCD_A Controller Operation 19-12 LCD_A Controller 19.2.7 2-Mux Mode In 2-mux mode, each MSP430 segment pin drives two LCD segments and two common lines, COM0 and COM1, are used. Figure 19 − 6 shows some example 2-mux, 1/2 bias waveforms. Figure 19 − 6. Example 2- Mux Waveforms COM1 COM0 COM0 COM1 SP1 SP2 SP1 SP2 SP3 SP4 V1 V3 V5 V1 V5 V1 V5 V1 [...]
-
Página 363
LCD_A Controller Operation 19-13 LCD_A Controller Figure 19 − 7 shows an example 2-mux LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application completely depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 19 − 7. 2 − Mux LCD Example 2[...]
-
Página 364
LCD_A Controller Operation 19-14 LCD_A Controller 2-Mux Mode Software Example ; Al l eight segments of a digit are often located in two ; display memory bytes with the 2mux display rate ; a EQU 002h b EQU 020h c EQU 008h d EQU 004h e EQU 040h f EQU 001h g EQU 080h h EQU 010h ; The register content of Rx should be displayed. ; The Table represents t[...]
-
Página 365
LCD_A Controller Operation 19-15 LCD_A Controller 19.2.8 3-Mux Mode In 3-mux mode, each MSP430 segment pin drives three LCD segments and three common lines, COM0, COM1 and COM2 are used. Figure 19 − 8 shows some example 3-mux, 1/3 bias waveforms. Figure 19 − 8. Example 3- Mux Waveforms COM0 COM1 COM2 COM0 COM2 SP1 SP2 SP3 SP3 SP2 SP1 f frame V1[...]
-
Página 366
LCD_A Controller Operation 19-16 LCD_A Controller Figure 19 − 9 shows an example 3-mux LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 19 − 9. 3-Mux LCD Example 28 e h d A B G 0[...]
-
Página 367
LCD_A Controller Operation 19-17 LCD_A Controller 3-Mux Mode Software Example ; Th e 3mux rate can support nine segments for each ; digit. The nine segments of a digit are located in ; 1 1/2 display memory bytes. ; a EQU 0040h b EQU 0400h c EQU 0200h d EQU 0010h e EQU 0001h f EQU 0002h g EQU 0020h h EQU 0100h Y EQU 0004h ; The LSDigit of register R[...]
-
Página 368
LCD_A Controller Operation 19-18 LCD_A Controller 19.2.9 4-Mux Mode In 3-mux mode, each MSP430 segment pin drives four LCD segments and all four common lines, COM0, COM1, COM2, and COM3 are used. Figure 19 − 10 shows some example 4-mux, 1/3 bias waveforms. Figure 19 − 10. Example 4- Mux Waveforms f frame V1 V2 V4 V5 V1 0 V − V1 V1 0 V − V1 [...]
-
Página 369
LCD_A Controller Operation 19-19 LCD_A Controller Figure 19 − 1 1 shows an example 4-mux LCD, pin-out, LCD-to-MSP430 connections, and the resulting segment mapping. This is only an example. Segment mapping in a user ’ s application depends on the LCD pin-out and on the MSP430-to-LCD connections. Figure 19 − 1 1. 4-Mux LCD Example ed 26 28 A B[...]
-
Página 370
LCD_A Controller Operation 19-20 LCD_A Controller 4-Mux Mode Software Example ; Th e 4mux rate supports eight segments for each digit. ; All eight segments of a digit can often be located in ; one display memory byte a EQU 080h b EQU 040h c EQU 020h d EQU 001h e EQU 002h f EQU 008h g EQU 004h h EQU 010h ; ; The LSDigit of register Rx should be disp[...]
-
Página 371
LCD_A Controller Operation 19-21 LCD_A Controller 19.3 LCD Controller Registers The LCD Controller registers are listed in T able 19 − 2. T able 19 − 2. LCD Controller Registers Register Short Form Register T ype Address Initial State LCD_A control register LCDACTL Read/write 090h Reset with PUC LCD memory 1 LCDM1 Read/write 091h Unchanged LCD [...]
-
Página 372
LCD_A Controller Operation 19-22 LCD_A Controller LCDACTL, LCD_A Control Register 76543 210 LCDFREQx LCDMXx LCDSON Unused LCDON rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 LCDFREQx Bits 7-5 LCD Frequency Select. These bits select the ACLK divider for the LCD frequency . 000 Divide by 32 001 Divide by 64 010 Divide by 96 [...]
-
Página 373
LCD_A Controller Operation 19-23 LCD_A Controller LCDAPCTL0, LCD_A Port Control Register 0 76543 210 LCDS28 LCDS24 LCDS20 LCDS16 LCDS12 LCDS8 LCDS4 LCDS0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 LCDS28 Bit 7 LCD Segment 28 to 31 Enable. This bit only affects pins with multiplexed functions. Dedicated LCD pins are alwa[...]
-
Página 374
LCD_A Controller Operation 19-24 LCD_A Controller LCDAPCTL1, LCD_A Port Control Register 1 76543 210 Unused LCDS36 LCDS32 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 Unused Bits 7 − 2 Unused LCDS36 Bit 1 LCD Segment 36 to 39 Enable. This bit only affects pins with multiplexed functions. Dedicated LCD pins are always LC[...]
-
Página 375
LCD_A Controller Operation 19-25 LCD_A Controller LCDA VCTL0, LCD_A V oltage Control Register 0 76543 210 Unused R03EXT REXT VLCDEXT LCDCPEN VLCDREFx LCD2B rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 Unused Bit 7 Unused R03EXT Bit 6 V5 voltage select. This bit selects the external connection for the lowest LCD voltage. R[...]
-
Página 376
LCD_A Controller Operation 19-26 LCD_A Controller LCDA VCTL1, LCD_A V oltage Control Register 1 76543 210 Unused VLCDx Unused rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 Unused Bits 7 − 5 Unused VLCDx Bits 4 − 1 Charge pump voltage select. LCDCPEN must be 1 for the charge pump to be enabled. A V CC is used for V LCD [...]
-
Página 377
20-1 ADC12 ADC12 The ADC12 module is a high-performance 12-bit analog-to-digital converter . This chapter describes the ADC12. The ADC12 is implemented in the MSP430x43x and MSP430x44x devices. T opic Page 20.1 ADC12 Introduction 20-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20.2 ADC12 Operation 20-4 . . .[...]
-
Página 378
ADC12 Introduction 20-2 ADC12 20.1 ADC12 Introduction The ADC12 module supports fast, 12-bit analog-to-digital conversions. The module implements a 12-bit SAR core, sample select control, reference generator and a 16 word conversion-and-control buf fer . The conversion-and-control b u f fer allows up to 16 independent ADC samples to be converted an[...]
-
Página 379
ADC12 Introduction 20-3 ADC12 Figure 20−1. ADC12 Block Diagram Sample and Hold Ve REF+ 12 − bit SAR V R − − 16 x 12 Memory Buffer − − 16 x 8 Memory Control − V R+ V REF+ Ve REF − V REF − / ADC12SC TA 1 TB1 TB0 Divider /1 .. /8 ADC12DIVx ADC12CLK ENC MSC SHP SHT0x SAMPCON SHI S/H Convert Sync Sample Timer /4 .. /1024 INCHx 4 A0 A1 [...]
-
Página 380
ADC12 Operation 20-4 ADC12 20.2 ADC12 Operation Th e ADC12 module is configured with user software. The setup and operation of the ADC12 is discussed in the following sections. 20.2.1 12-Bit ADC Core The ADC core converts an analog input to its 12-bit digital representation and stores the result in conversion memory . The core uses two programmable[...]
-
Página 381
ADC12 Operation 20-5 ADC12 20.2.2 ADC12 Inputs and Multiplexer Th e eight external and four internal analog signals are selected as the channel for conversion by the analog input multiplexer . The input multiplexer is a break-before-make type to reduce input-to-input noise injection resulting from channel switching as shown in Figure 20 − 2. The [...]
-
Página 382
ADC12 Operation 20-6 ADC12 20.2.3 V oltage Reference Generator The ADC12 module contains a built-in voltage reference with two selectable voltage levels, 1.5 V and 2.5 V . Either of these reference voltages may be used internally and externally on pin V REF+ . Setting REFON=1 enables the internal reference. When REF2_5V = 1, the internal reference [...]
-
Página 383
ADC12 Operation 20-7 ADC12 20.2.5 Sample and Conversion Timing An analog-to-digital conversion is initiated with a rising edge of the sample input signal SHI. The source for SHI is selected with the SHSx bits and includes the following: - The ADC12SC bit - The T imer_A Output Unit 1 - The T imer_B Output Unit 0 - The T imer_B Output Unit 1 The pola[...]
-
Página 384
ADC12 Operation 20-8 ADC12 Pulse Sample Mode The pulse sample mode is selected when SHP = 1. The SHI signal is used to trigger the sampling timer . The SHT0x and SHT1x bits in ADC12CTL0 control the interval of the sampling timer that defines the SAMPCON sample period t sample . The sampling timer keeps SAMPCON high after synchronization with AD12CL[...]
-
Página 385
ADC12 Operation 20-9 ADC12 Sample Timing Considerations When SAMPCON = 0 all Ax inputs are high impedance. When SAMPCON = 1, the selected Ax input can be modeled as an RC low-pass filter during the sampling time t sample , as shown below in Figure 20 − 5. An internal MUX-on input resistance R I (max. 2 k Ω ) in series with capacitor C I (max. 4[...]
-
Página 386
ADC12 Operation 20-10 ADC12 20.2.6 Conversion Memory There are 16 ADC12MEMx conversion memory registers to store conversion results. Each ADC12MEMx is configured with an associated ADC12MCTLx control register . The SREFx bits define the voltage reference and the INCHx bits select the input channel. The EOS bit defines the end of sequence when a seq[...]
-
Página 387
ADC12 Operation 20-1 1 ADC12 Single-Channel Single-Conversion Mode A single channel is sampled and converted once. The ADC result is written to the ADC12MEMx defined by the CST ART ADDx bits. Figure 20 − 6 shows the flow of the Single-Channel, Single-Conversion mode. When ADC12SC triggers a conversion, successive conversions can be triggered by t[...]
-
Página 388
ADC12 Operation 20-12 ADC12 Sequence-of-Channels Mode A sequence of channels is sampled and converted once. The ADC results are written t o the conversion memories starting with the ADCMEMx defined by the CST ART ADDx bits. The sequence stops after the measurement of the channel with a set EOS bit. Figure 20 − 7 shows the sequence-of-channels mod[...]
-
Página 389
ADC12 Operation 20-13 ADC12 Repeat-Single-Channel Mode A single channel is sampled and converted continuously . The ADC results are written t o the ADC12MEMx defined by the CST ART ADDx bits. It is necessary to read the result after the completed conversion because only one ADC12MEMx memory is used and is overwritten by the next conversion. Figure [...]
-
Página 390
ADC12 Operation 20-14 ADC12 Repeat-Sequence-of-Channels Mode A sequence of channels is sampled and converted repeatedly . The ADC results are written to the conversion memories starting with the ADC12MEMx defined b y the CST ART ADDx bits. The sequence ends after the measurement of the channel with a set EOS bit and the next trigger signal re-start[...]
-
Página 391
ADC12 Operation 20-15 ADC12 Using the Multiple Sample and Convert (MSC) Bit T o configure the converter to perform successive conversions automatically an d as quickly as possible, a multiple sample and convert function is available. When MSC = 1, CONSEQx > 0, and the sample timer is used, the first rising edge of the SHI signal triggers the fir[...]
-
Página 392
ADC12 Operation 20-16 ADC12 20.2.8 Using the Integrated T emperature Sensor T o use the on-chip temperature sensor , the user selects the analog input channel INCHx = 1010. Any other configuration is done as if an external channel was selected, including reference selection, conversion-memory selection, etc. The typical temperature sensor transfer [...]
-
Página 393
ADC12 Operation 20-17 ADC12 20.2.9 ADC12 Grounding and Noise Considerations As with any high-resolution ADC, appropriate printed-circuit-board layout and grounding techniques should be followed to eliminate ground loops, unwanted parasitic ef fects, and noise. Ground loops are formed when return current from the A/D flows through paths that are com[...]
-
Página 394
ADC12 Operation 20-18 ADC12 20.2.10 ADC12 Interrupts The ADC12 has 18 interrupt sources: - ADC12IFG0-ADC12IFG15 - ADC12OV , ADC12MEMx overflow - ADC12T OV , ADC12 conversion time overflow Th e ADC12IFGx bits are set when their corresponding ADC12MEMx memory register is loaded with a conversion result. An interrupt request is generated if the corres[...]
-
Página 395
ADC12 Operation 20-19 ADC12 ADC12 Interrupt Handling Software Example The following software example shows the recommended use of ADC12IV and the handling overhead. The ADC12IV value is added to the PC to automatically jump to the appropriate routine. The numbers at the right margin show the necessary CPU cycles for each instruction. The software o[...]
-
Página 396
ADC12 Registers 20-20 ADC12 20.3 ADC12 Registers The ADC12 registers are listed in T able 20 − 2 . T able 20 − 2. ADC12 Registers Register Short Form Register T ype Address Initial State ADC12 control register 0 ADC12CTL0 Read/write 01A0h Reset with POR ADC12 control register 1 ADC12CTL1 Read/write 01A2h Reset with POR ADC12 interrupt flag regi[...]
-
Página 397
ADC12 Registers 20-21 ADC12 ADC12CTL0, ADC12 Control Register 0 15 14 13 12 1 1 10 9 8 SHT1x SHT0x rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 MSC REF2_5V REFON ADC12ON ADC12OVIE ADC12 TOVIE ENC ADC12SC rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) Modif[...]
-
Página 398
ADC12 Registers 20-22 ADC12 MSC Bit 7 Multiple sample and conversion. V alid only for sequence or repeated modes. 0 The sampling timer requires a rising edge of the SHI signal to trigger each sample-and-conversion. 1 The first rising edge of the SHI signal triggers the sampling timer , but further sample-and-conversions are performed automatically [...]
-
Página 399
ADC12 Registers 20-23 ADC12 ADC12CTL1, ADC12 Control Register 1 15 14 13 12 1 1 10 9 8 CST ART ADDx SHSx SHP ISSH rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 ADC12DIVx ADC12SSELx CONSEQx ADC12 BUSY rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) r − (0) Modifiable [...]
-
Página 400
ADC12 Registers 20-24 ADC12 ADC12 SSELx Bits 4-3 ADC12 clock source select 00 ADC12OSC 01 ACLK 10 MCLK 1 1 SMCLK CONSEQx Bits 2-1 Conversion sequence mode select 00 Single-channel, single-conversion 01 Sequence-of-channels 10 Repeat-single-channel 1 1 Repeat-sequence-of-channels ADC12 BUSY Bit 0 ADC12 busy . This bit indicates an active sample or c[...]
-
Página 401
ADC12 Registers 20-25 ADC12 ADC12MCTLx, ADC12 Conversion Memory Control Registers 76543 210 EOS SREFx INCHx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) Modifiable only when ENC = 0 EOS Bit 7 End of sequence. Indicates the last conversion in a sequence. 0 Not end of sequence 1 End of sequence SREFx Bits 6-[...]
-
Página 402
ADC12 Registers 20-26 ADC12 ADC12IE, ADC12 Interrupt Enable Register 15 14 13 12 1 1 10 9 8 ADC12IE15 ADC12IE14 ADC12IE13 ADC12IE12 ADC12IE1 1 ADC12IE10 ADC12IE9 ADC12IE8 rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 ADC12IE7 ADC12IE6 ADC12IE5 ADC12IE4 ADC12IE3 ADC12IE2 ADC12IE1 ADC12IE0 rw − (0[...]
-
Página 403
ADC12 Registers 20-27 ADC12 ADC12IV , ADC12 Interrupt V ector Register 15 14 13 12 1 1 10 9 8 0 0000000 r0 r0 r0 r0 r0 r0 r0 r0 76543 210 0 0 ADC12IVx 0 r0 r0 r − (0) r − (0) r − (0) r − (0) r − (0) r0 ADC12IVx Bits 15-0 ADC12 interrupt vector value ADC12IV Contents Interrupt Source Interrupt Flag Interrupt Priority 000h No interrupt pend[...]
-
Página 404
21-1 SD16 SD16 The SD16 module is a multichannel 16-bit, sigma-delta analog-to-digital converter . This chapter describes the SD16. The SD16 module is implemented in the MSP430FE42x and MSP430F42x devices. T opic Page 21.1 SD16 Introduction 21-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 SD16 Operatio[...]
-
Página 405
SD16 Introduction 21-2 SD16 21.1 SD16 Introduction The SD16 module consists of up to three independent sigma-delta analog-to-digital converters and an internal voltage reference. Each channel has up to 8 fully dif ferential multiplexed inputs including a built-in temperature sensor . The converters are based on second-order oversampling sigma-delta[...]
-
Página 406
SD16 Introduction 21-3 SD16 Figure 21−1. SD16 Block Diagram Channel 0 Channel 1 15 0 SD16 Control Block SD16DIVx f M ACLK T ACLK SD16SSELx 00 01 10 11 00 01 10 11 MCLK SMCLK AV CC V REF Divider 1/2/4/8 000 SD16INCHx + − 001 + − 010 + − 01 1 + − 100 + − 101 + − 11 0 + − 111 + − PGA 1..32 2 nd Order Σ∆ Modulator SD16GAINx SD16DF [...]
-
Página 407
SD16 Operation 21-4 SD16 21.2 SD16 Operation The SD16 module is configured with user software. The setup and operation of the SD16 is discussed in the following sections. 21.2.1 ADC Core The analog-to-digital conversion is performed by a 1-bit, second-order sigma-delta modulator . A single-bit comparator within the modulator quantizes the input sig[...]
-
Página 408
SD16 Operation 21-5 SD16 21.2.5 Channel Selection Each SD16 channel can convert up to 8 dif ferential pair inputs multiplexed into the PGA. Up to six input pairs (A0-A5) are available externally on the device. Se e the device-specific data sheet for analog input pin information. An internal temperature sensor is available to each channel using the [...]
-
Página 409
SD16 Operation 21-6 SD16 21.2.6 Digital Filter The digital filter processes the 1-bit data stream from the modulator using a SINC 3 comb filter . The transfer function is described in the z-Domain by: H ( z ) + ǒ 1 OSR 1 * z * OSR 1 * z * 1 Ǔ 3 and in the frequency domain by: H ǒ f Ǔ + ȧ ȱ Ȳ sinc ǒ OSR p f f M Ǔ sinc ǒ p f f M Ǔ ȧ ȳ ȴ[...]
-
Página 410
SD16 Operation 21-7 SD16 Figure 21 − 3 shows the digital filter step response and conversion points. For step changes at the input after start of conversion a settling time must be allowed before a valid conversion result is available. The SD16INTDL Yx bits can provide sufficient filter settling time for a full-scale change at the ADC input. I f [...]
-
Página 411
SD16 Operation 21-8 SD16 Digital Filter Output The number of bits output by each digital filter is dependent on the oversampling ratio and ranges from 16 to 24 bits. Figure 21 − 4 shows the digital filter output bits and their relation to SD16MEMx for each OSR. For example, for OSR = 256 and LSBACC = 1, the SD16MEMx register contains bits 23 − [...]
-
Página 412
SD16 Operation 21-9 SD16 21.2.7 Conversion Memory Registers: SD16MEMx One SD16MEMx register is associated with each SD16 channel. Conversion results for each channel are moved to the corresponding SD16MEMx register with each decimation step of the digital filter . The SD16IFG bit for a given channel is set when new data is written to SD16MEMx. SD16[...]
-
Página 413
SD16 Operation 21-10 SD16 21.2.8 Conversion Modes The SD16 module can be configured for four modes of operation, listed in T able 21 − 2. The SD16SNGL and SD16GRP bits for each channel selects the conversion mode. T able 21 − 2. Conversion Mode Summary SD16SNGL SD16GRP { Mode Operation 1 0 Single channel, Single conversion A single channel is c[...]
-
Página 414
SD16 Operation 21-1 1 SD16 Figure 21 − 6. Single Channel Operation Channel 0 SD16SNGL = 1 SD16GRP = 0 Time Conversion SD16SC Channel 1 SD16SNGL = 1 SD16GRP = 0 Conversion Channel 2 SD16SNGL = 0 SD16GRP = 0 Conversion SD16SC SD16SC Conversion Conversion Conversion Set by SW Auto − clear Set by SW Auto − clear Set by SW Auto − clear Set by SW[...]
-
Página 415
SD16 Operation 21-12 SD16 Group of Channels, Continuous Conversion When SD16SNGL = 0 for a channel in a group, continuous conversion mode is selected. Continuous conversion of that channel will occur synchronously when the master channel SD16SC bit is set. SD16SC bits for all grouped channels will be automatically set and cleared with the master ch[...]
-
Página 416
SD16 Operation 21-13 SD16 21.2.9 Conversion Operation Using Preload When multiple channels are grouped the SD16PREx registers can be used to delay the conversion time frame for each channel. Using SD16PREx, the decimation time of the digital filter is increased by the specified number of f M clock cycles and can range from 0 to 255. Figure 21 − 8[...]
-
Página 417
SD16 Operation 21-14 SD16 Figure 21 − 9. Start of Conversion using Preload Delayed Conversion 40 SD16OSRx = 32 Start of Conversion Time Conversion 32 Conversion 32 f M cycles: 1 st Sample Ch1 SD16PRE0 = 8 SD16PRE1 = 0 Conversion 32 Conversion 32 Conversion 32 Conversion 1 st Sample Ch0 When channels are grouped, care must be taken when a channel [...]
-
Página 418
SD16 Operation 21-15 SD16 21.2.10 Using the Integrated T emperature Sensor T o use the on-chip temperature sensor , the user selects the analog input channel SD16INCHx = 1 10. Any other configuration is done as if an external channel was selected, including SD16INTDL Yx and SD16GAINx settings. The typical temperature sensor transfer function is sho[...]
-
Página 419
SD16 Operation 21-16 SD16 21.2.1 1 Interrupt Handling The SD16 has 2 interrupt sources for each ADC channel: - SD16IFG - SD16OVIFG The SD16IFG bits are set when their corresponding SD16MEMx memory register is written with a conversion result. An interrupt request is generated if the corresponding SD16IE bit and the GIE bit are set. The SD16 overflo[...]
-
Página 420
SD16 Operation 21-17 SD16 SD16 Interrupt Handling Software Example The following software example shows the recommended use of SD16IV and the handling overhead. The SD16IV value is added to the PC to automatically jump to the appropriate routine. The numbers at the right margin show the necessary CPU cycles for each instruction. The software overhe[...]
-
Página 421
SD16 Registers 21-18 SD16 21.3 SD16 Registers The SD16 registers are listed in T able 21 − 3: T able 21 − 3. SD16 Registers Register Short Form Register T ype Address Initial State SD16 Control SD16CTL Read/write 0100h Reset with PUC SD16 Interrupt V ector SD16IV Read/write 01 10h Reset with PUC SD16 Channel 0 Control SD16CCTL0 Read/write 0102h[...]
-
Página 422
SD16 Registers 21-19 SD16 SD16CTL, SD16 Control Register 15 14 13 12 1 1 10 9 8 Reserved SD16LP r0 r0 r0 r0 r0 r0 r0 rw − 0 76543 210 SD16DIVx SD16SSELx SD16 VMIDON SD16 REFON SD16OVIE Reserved rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 r0 Reserved Bits 15-9 Reserved SD16LP Bit 8 Low power mode. This bit selects a reduced spee[...]
-
Página 423
SD16 Registers 21-20 SD16 SD16CCTLx, SD16 Channel x Control Register 15 14 13 12 1 1 10 9 8 Reserved SD16SNGL SD16OSRx r0 r0 r0 r0 r0 rw − 0 rw − 0 rw − 0 76543 210 SD16 LSBTOG SD16 LSBACC SD16 OVIFG SD16DF SD16IE SD16IFG SD16SC SD16GRP rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 r(w) − 0 Reserved Bits 15-1 1 Reserved SD1[...]
-
Página 424
SD16 Registers 21-21 SD16 SD16IFG Bit 2 SD16 interrupt flag. SD16IFG is set when new conversion results are available. SD16IFG is automatically reset when the corresponding SD16MEMx register is read, or may be cleared with software. 0 No interrupt pending 1 Interrupt pending SD16SC Bit 1 SD16 start conversion 0 No conversion start 1 Start conversio[...]
-
Página 425
SD16 Registers 21-22 SD16 SD16MEMx, SD16 Channel x Conversion Memory Register 15 14 13 12 1 1 10 9 8 Conversion Results rrrrrrrr 76543 210 Conversion Results rrrrrrrr Conversion Result Bits 15-0 Conversion Results. The SD16MEMx register holds the upper or lower 16-bits of the digital filter output, depending on the SD16LSBACC bit. SD16PREx, SD16 Ch[...]
-
Página 426
SD16 Registers 21-23 SD16 SD16IV , SD16 Interrupt V ector Register 15 14 13 12 1 1 10 9 8 0 0000000 r0 r0 r0 r0 r0 r0 r0 r0 76543 210 0 0 0 SD16IVx 0 r0 r0 r0 r − 0 r − 0 r − 0 r − 0 r0 SD16IVx Bits 15-0 SD16 interrupt vector value SD16IV Contents Interrupt Source Interrupt Flag Interrupt Priority 000h No interrupt pending − 002h SD16MEMx[...]
-
Página 427
22-1 SD16_A SD16_A The SD16_A module is a single-converter 16-bit, sigma-delta analog-to-digital conversion module with high impedance input buffer . This chapter describes the SD16_A. The SD16_A module is implemented in the MSP430F42x0 devices. T opic Page 22.1 SD16_A Introduction 22-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . [...]
-
Página 428
SD16_A Introduction 22-2 SD16_A 22.1 SD16_A Introduction The SD16_A module consists of one sigma-delta analog-to-digital converter with an high impedance input buffer and an internal voltage reference. It has up to 8 fully differential multiplexed inputs including a built-in temperature sensor . The converter is based on a second-order oversampling[...]
-
Página 429
SD16_A Introduction 22-3 SD16_A Figure 22−1. SD16_A Block Diagram 15 0 SD16DIVx ACLK T ACLK SD16SSELx 00 01 10 11 00 01 10 11 MCLK SMCLK AV CC V REF Divider 1/2/4/8 A0 000 SD16INCHx + − 001 + − 010 + − 01 1 + − 100 + − 101 + − 11 0 + − 111 + − A1 A2 A3 A4 A5 A6 2 nd Order Σ∆ Modulator SD16GAINx SD16DF SD16LP SD16SC SD16OSRx SD1[...]
-
Página 430
SD16_A Operation 22-4 SD16_A 22.2 SD16_A Operation The SD16_A module is configured with user software. The setup and operation of the SD16_A is discussed in the following sections. 22.2.1 ADC Core The analog-to-digital conversion is performed by a 1-bit, second-order sigma-delta modulator . A single-bit comparator within the modulator quantizes the[...]
-
Página 431
SD16_A Operation 22-5 SD16_A 22.2.5 Channel Selection The SD16_A can convert up to 8 differential pair inputs multiplexed into the PGA. Up to five input pairs (A0-A4) are available externally on the device. A resistive divider to measure the supply voltage is available using the A5 multiplexer input. An internal temperature sensor is available usin[...]
-
Página 432
SD16_A Operation 22-6 SD16_A 22.2.7 Digital Filter The digital filter processes the 1-bit data stream from the modulator using a SINC 3 comb filter . The transfer function is described in the z-Domain by: H ( z ) + ǒ 1 OSR 1 * z * OSR 1 * z * 1 Ǔ 3 and in the frequency domain by: H ǒ f Ǔ + ȧ ȱ Ȳ sinc ǒ OSR p f f M Ǔ sinc ǒ p f f M Ǔ ȧ ?[...]
-
Página 433
SD16_A Operation 22-7 SD16_A Figure 22 − 3 shows the digital filter step response and conversion points. For step changes at the input after start of conversion a settling time must be allowed before a valid conversion result is available. The SD16INTDL Yx bits can provide sufficient filter settling time for a full-scale change at the ADC input. [...]
-
Página 434
SD16_A Operation 22-8 SD16_A Digital Filter Output Th e number of bits output by the digital filter is dependent on the oversampling ratio and ranges from 15 to 30 bits. Figure 22 − 4 shows the digital filter output and their relation to SD16MEM0 for each OSR, LSBACC, and SD16UNI setting. For example, for OSR = 1024, LSBACC = 1, and SD16UNI = 1, [...]
-
Página 435
SD16_A Operation 22-9 SD16_A 0 4 8 12 16 20 24 1 53 2 6 97 23 22 21 19 18 17 15 14 13 1 1 10 28 27 26 25 29 0 4 8 12 16 20 24 1 53 2 6 97 23 22 21 19 18 17 15 14 13 1 1 10 28 27 26 25 29 OSR=32, LSBACC=x, SD16UNI=1 OSR=32, LSBACC=x, SD16UNI=0 0 4 8 12 16 20 24 1 53 2 6 97 23 22 21 19 18 17 15 14 13 1 1 10 28 27 26 25 29 OSR=64, LSBACC=0, SD16UNI=0 [...]
-
Página 436
SD16_A Operation 22-10 SD16_A 22.2.8 Conversion Memory Register: SD16MEM0 The SD16MEM0 register is associated with the SD16_A channel. Conversion results are moved to the SD16MEM0 register with each decimation step of the digital filter . The SD16IFG bit is set when new data is written to SD16MEM0. SD16IFG is automatically cleared when SD16MEM0 is [...]
-
Página 437
SD16_A Operation 22-1 1 SD16_A 22.2.9 Conversion Modes The SD16_A module can be configured for two modes of operation, listed in T able 22 − 3. The SD16SNGL bit selects the conversion mode. T able 22 − 3. Conversion Mode Summary SD16SNGL Mode Operation 1 Single conversion The channel is converted once. 0 Continuous conversion The channel is con[...]
-
Página 438
SD16_A Operation 22-12 SD16_A 22.2.10 Using the Integrated T emperature Sensor T o use the on-chip temperature sensor , the user selects the analog input channel SD16INCHx = 1 10. Any other configuration is done as if an external channel was selected, including SD16INTDL Yx and SD16GAINx settings. The typical temperature sensor transfer function is[...]
-
Página 439
SD16_A Operation 22-13 SD16_A 22.2.1 1 Interrupt Handling The SD16_A has 2 interrupt sources for its ADC channel: - SD16IFG - SD16OVIFG The SD16IFG bit is set when the SD16MEM0 memory register is written with a conversion result. An interrupt request is generated if the corresponding SD16IE bit and the GIE bit are set. The SD16_A overflow condition[...]
-
Página 440
SD16_A Registers 22-14 SD16_A 22.3 SD16_A Registers The SD16_A registers are listed in T able 22 − 4: T able 22 − 4. SD16_A Registers Register Short Form Register T ype Address Initial State SD16_A Control SD16CTL Read/write 0100h Reset with PUC SD16_A Interrupt V ector SD16IV Read/write 01 10h Reset with PUC SD16_A Channel 0 Control SD16CCTL0 [...]
-
Página 441
SD16_A Registers 22-15 SD16_A SD16CTL, SD16_A Control Register 15 14 13 12 1 1 10 9 8 Reserved SD16XDIV SD16LP r0 r0 r0 r0 rw − 0 rw − 0 rw − 0 rw − 0 76543 210 SD16DIVx SD16SSELx SD16 VMIDON SD16 REFON SD16OVIE Reserved rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 r0 Reserved Bits 15-12 Reserved SD16XDIV Bits 1 1-9 SD16_A[...]
-
Página 442
SD16_A Registers 22-16 SD16_A SD16CCTL0, SD16_A Control Register 0 15 14 13 12 1 1 10 9 8 Reserved SD16BUFx SD16UNI SD16XOSR SD16SNGL SD16OSRx r0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 76543 210 SD16 LSBTOG SD16 LSBACC SD16 OVIFG SD16DF SD16IE SD16IFG SD16SC Reserved rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw ?[...]
-
Página 443
SD16_A Registers 22-17 SD16_A SD16 LSBACC Bit 6 LSB access. This bit allows access to the upper or lower 16-bits of the SD16_A conversion result. 0 SD16MEMx contains the most significant 16-bits of the conversion. 1 SD16MEMx contains the least significant 16-bits of the conversion. SD16OVIFG Bit 5 SD16_A overflow interrupt flag 0 No overflow interr[...]
-
Página 444
SD16_A Registers 22-18 SD16_A SD16INCTL0, SD16_A Input Control Register 76543 210 SD16INTDL Yx SD16GAINx SD16INCHx rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 rw − 0 SD16 INTDL Yx Bits 7-6 Interrupt delay generation after conversion start. These bits select the delay for the first interrupt after conversion start. 00 Fourth sam[...]
-
Página 445
SD16_A Registers 22-19 SD16_A SD16MEM0, SD16_A Conversion Memory Register 15 14 13 12 1 1 10 9 8 Conversion Results r r r r r r r r 76543 210 Conversion Results r r r r r r r r Conversion Result Bits 15-0 Conversion Results. The SD16MEMx register holds the upper or lower 16-bits of the digital filter output, depending on the SD16LSBACC bit. SD16AE,[...]
-
Página 446
SD16_A Registers 22-20 SD16_A SD16IV , SD16_A Interrupt V ector Register 15 14 13 12 1 1 10 9 8 0 0000000 r0 r0 r0 r0 r0 r0 r0 r0 76543 210 0 0 0 SD16IVx 0 r0 r0 r0 r − 0 r − 0 r − 0 r − 0 r0 SD16IVx Bits 15-0 SD16_A interrupt vector value SD16IV Contents Interrupt Source Interrupt Flag Interrupt Priority 000h No interrupt pending − 002h [...]
-
Página 447
23-1 DAC12 DAC12 Th e DAC12 module is a 12-bit, voltage output digital-to-analog converter . This chapter describes the DAC12. T wo DAC12 modules are implemented in the MSP430FG43x devices. Only DAC12_0 is implemented in MSP430x42x0 devices. T opic Page 23.1 DAC12 Introduction 23-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]
-
Página 448
DAC12 Introduction 23-2 DAC12 23.1 DAC12 Introduction The DAC12 module is a 12-bit, voltage output DAC. The DAC12 can be configured i n 8 - o r 12-bit mode and may be used in conjunction with the DMA controller . When multiple DAC12 modules are present, they may be grouped together for synchronous update operation. Features of the DAC12 include: - [...]
-
Página 449
DAC12 Introduction 23-3 DAC12 Figure 23−1. DAC12 Block Diagram DAC12_0 DAC12_0OUT 2.5V or 1.5V reference from ADC12 DAC12SREFx V R − V R+ DAC12_0DA T DAC12_0Latch DAC12_1 DAC12LSELx V R − V R+ DAC12_1DA T DAC12_1Latch TB2 TA 1 DAC12DF DAC12RES AV SS 00 01 10 11 00 01 10 11 00 01 10 11 Ve REF+ V REF+ DAC12DF DAC12RES Latch Bypass DAC12LSELx TB[...]
-
Página 450
DAC12 Introduction 23-4 DAC12 Figure 23 − 2. DAC12 Block Diagram For MSPx42x0 Devices DAC12_0 DAC12_0OUT 1.2V reference from SD16 DAC12SREFx V R − V R+ DAC12_0DA T DAC12_0Latch AV SS 00 01 10 11 V REF DAC12DF DAC12RES DAC12LSELx TB2 TA 1 00 01 10 11 00 01 10 11 Latch Bypass DAC12IR DAC12_0DA T Updated 0 1 ENC 1 0 DAC12GRP x3 /3 DAC12AMPx 3 DAC1[...]
-
Página 451
DAC12 Operation 23-5 DAC12 23.2 DAC12 Operation Th e DAC12 module is configured with user software. The setup and operation of the DAC12 is discussed in the following sections. 23.2.1 DAC12 Core The DAC12 can be configured to operate in 8- or 12-bit mode using the DAC12RES bit. The full-scale output is programmable to be 1x or 3x the selected refer[...]
-
Página 452
DAC12 Operation 23-6 DAC12 23.2.2 DAC12 Reference On MSP430FG43x devices, the reference for the DAC12 is configured to use either a n external reference voltage or the internal 1.5-V/2.5-V reference from the ADC12 module with the DAC12SREFx bits. When DAC12SREFx = {0,1} the V REF+ signal is used as the reference and when DAC12SREFx = {2,3} the Ve R[...]
-
Página 453
DAC12 Operation 23-7 DAC12 23.2.4 DAC12_xDA T Data Format The DAC12 supports both straight binary and 2 ’ s compliment data formats. When using straight binary data format, the full-scale output value is 0FFFh in 12-bit mode (0FFh in 8-bit mode) as shown in Figure 23 − 3. Figure 23 − 3. Output V oltage vs DAC12 Data, 12-Bit, Straight Binary M[...]
-
Página 454
DAC12 Operation 23-8 DAC12 23.2.5 DAC12 Output Amplifier Offset Calibration The offset voltage of the DAC12 output amplifier can be positive or negative. When the of fset is negative, the output amplifier attempts to drive the voltage negative, but cannot do so. The output voltage remains at zero until the DAC12 digital input produces a sufficient [...]
-
Página 455
DAC12 Operation 23-9 DAC12 23.2.6 Grouping Multiple DAC12 Modules Multiple DAC12s can be grouped together with the DAC12GRP bit to synchronize the update of each DAC12 output. Hardware ensures that all DAC12 modules in a group update simultaneously independent of any interrupt or NMI event. On the MSP430FG43x devices, DAC12_0 and DAC12_1 are groupe[...]
-
Página 456
DAC12 Operation 23-10 DAC12 23.2.7 DAC12 Interrupts The DAC12 interrupt vector is shared with the DMA controller . Software must check the DAC12IFG and DMAIFG flags to determine the source of the interrupt. The DAC12IFG bit is set when DAC12LSELx > 0 and DAC12 data is latched from the DAC12_xDA T register into the data latch. When DAC12LSELx = 0[...]
-
Página 457
DAC12 Registers 23-1 1 DAC12 23.3 DAC12 Registers The DAC12 registers are listed in T able 23 − 2. T able 23 − 2. DAC12 Registers Register Short Form Register T ype Address Initial State DAC12_0 control DAC12_0CTL Read/write 01C0h Reset with POR DAC12_0 data DAC12_0DA T Read/write 01C8h Reset with POR DAC12_1 control DAC12_1CTL Read/write 01C2h[...]
-
Página 458
DAC12 Registers 23-12 DAC12 DAC12_xCTL, DAC12 Control Register 15 14 13 12 1 1 10 9 8 DAC12OPS DAC12SREFx DAC12RES DAC12LSELx DAC12 CALON DAC12IR rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 DAC12AMPx DAC12DF DAC12IE DAC12IFG DAC12ENC DAC12 GRP rw − (0) rw − (0) rw − (0) rw − (0) rw − ([...]
-
Página 459
DAC12 Registers 23-13 DAC12 DAC12 CALON Bit 9 DAC12 calibration on. This bit initiates the DAC12 of fset calibration sequence and is automatically reset when the calibration completes. 0 Calibration is not active 1 Initiate calibration/calibration in progress DAC12IR Bit 8 DAC12 input range. This bit sets the reference input and voltage output rang[...]
-
Página 460
DAC12 Registers 23-14 DAC12 DAC12_xDA T , DAC12 Data Register 15 14 13 12 1 1 10 9 8 0 0 0 0 DAC12 Data r(0) r(0) r(0) r(0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 DAC12 Data rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) Unused Bits 15-12 Unused. These bits are always 0 and do not af fect the [...]
-
Página 461
24-1 Scan IF The Scan IF peripheral automatically scans sensors and measures linear or rotational motion. This chapter describes the Scan interface. The Scan IF is implemented in the MSP430FW42x devices. T opic Page 24.1 Scan IF Introduction 24-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]
-
Página 462
Scan IF Introduction 24-2 Scan IF 24.1 Scan IF Introduction The Scan IF module is used to automatically measure linear or rotational motion with the lowest possible power consumption. The Scan IF consists of three blocks: the analog front end (AFE), the processing state machine (PSM), and the timing state machine (TSM). The analog front end stimula[...]
-
Página 463
Scan IF Introduction 24-3 Scan IF Figure 24−1. Scan IF Block Diagram Timing State Machine (TSM) w/ oscillator Processing State Machine (PSM) Analog Input Multiplexer Interrupt Request Rotation Data ACLK SMCLK Analog Front − End (AFE) SIFCH1 SIFCH0 SIFCH2 SIFCH3 SIFCI0 SIFCOM SIFVSS SIFCI SIFCI1 SIFCI2 SIFCI3 Scan I/F T o Timer_A + − DAC 10 Bi[...]
-
Página 464
Scan IF Operation 24-4 Scan IF 24.2 Scan IF Operation The Scan IF is configured with user software. The setup and operation of the Scan IF is discussed in the following sections. 24.2.1 Scan IF Analog Front End The Scan IF analog front end provides sensor excitation and measurement. The analog front end is automatically controlled by the timing sta[...]
-
Página 465
Scan IF Operation 24-5 Scan IF Figure 24 − 2. Scan IF Analog Front End Block Diagram SIFTESTD SIFTESTS1(tsm) + − 1 0 SIFCH0 SIFCH1 SIFCH2 00 01 10 11 SIFCH3 1 0 SIFCI SIFCISEL SIFCAON SIFCAX SIFCACI3 10 11 01 00 SIFTCH0x 2 SIFTCH1x SIF2OUT SIF3OUT SIFTCH0OUT SIF1OUT SIF0OUT SIFTCH1OUT SIFCAINV SIFRSON(tsm) 2 Output Stage SIFCHx(tsm) 2 Sync. 00 [...]
-
Página 466
Scan IF Operation 24-6 Scan IF Excitation Th e excitation circuitry is used to excite the LC sensors or to power the resistor dividers. The excitation circuitry is shown in Figure 24 − 3 for one LC sensor connected. When the SIFTEN bit is set and the SIFSH bit is cleared the excitation circuitry is enabled and the sample-and-hold circuitry is dis[...]
-
Página 467
Scan IF Operation 24-7 Scan IF Figure 24 − 3. Excitation and Sample-And-Hold Circuitry SIFEX(tsm) SIFVSS 1 1 10 SIFCH0 SIFCOM Sample-and-Hold SIFLCEN(tsm) SIFTEN 1 0 Damping Excitation VSS 1 0 Excitation =00 VMID Gen SIFVCC2 1/2 AV CC 1 0 00 01 10 11 00 01 10 11 to Comparator From Channel Select Logic SIFSH[...]
-
Página 468
Scan IF Operation 24-8 Scan IF Sample-And-Hold The sample-and-hold is used to sample the sensor voltage to be measured. The sample-and-hold circuitry is shown in Figure 24 − 3. When SIFSH = 1 and SIFTEN = 0 the sample-and-hold circuitry is enabled and the excitation circuitry and mid-voltage generator are disabled. The sample-and-hold is used for[...]
-
Página 469
Scan IF Operation 24-9 Scan IF Direct Analog And Digital Inputs By setting the SIFCAX bit, external analog or digital signals can be connected directly to the comparator through the SIFCIx inputs. This allows measurement capabilities for optical encoders and other sensors. Comparator Input Selection And Output Bit Selection The SIFCAX and SIFSH bit[...]
-
Página 470
Scan IF Operation 24-10 Scan IF When SIFCAX = 1, the SIFCSEL and SIFCI3 bits select between the SIFCIx channels and the SIFCI input allowing storage of the comparator output for on e input signal into the four output bits SIF0OUT - SIF3OUT . This can be used to observe the envelope function of sensors. The output logic is enabled by the SIFRSON(tsm[...]
-
Página 471
Scan IF Operation 24-1 1 Scan IF Comparator and DAC The analog input signals are converted into digital signals by the comparator and the programmable 10-bit DAC. The comparator compares the selected analog signal to a reference voltage generated by the DAC. If the voltage is above the reference the comparator output will be high. Otherwise it will[...]
-
Página 472
Scan IF Operation 24-12 Scan IF For each input there are two DAC registers to set the reference level as listed in T able 24 − 3. T ogether with the last stored output of the comparator , SIFxOUT , the two levels can be used as an analog hysteresis as shown in Figure 24 − 6. The individual settings for the four inputs can be used to compensate [...]
-
Página 473
Scan IF Operation 24-13 Scan IF Internal Signal Connections to Timer1_A5 The outputs of the analog front end are connected to 3 different capture/compare registers of T imer1_A5. The output stage of the analog front end, shown in Figure 24 − 7. provides two dif ferent modes that are selected by the SIFCS bit and provides the SIFOx signals to T im[...]
-
Página 474
Scan IF Operation 24-14 Scan IF 24.2.2 Scan IF Timing State Machine The TSM is a sequential state machine that cycles through the SIFTSMx registers and controls the analog front end and sensor excitation automatically with no CPU intervention. The states are defined within a 24 x 16-bit memory , SIFTSM0 to SIFTSM23. The SIFEN bit enables the TSM. W[...]
-
Página 475
Scan IF Operation 24-15 Scan IF Figure 24 − 8. Timing State Machine Block Diagram SIFDIV3Bx State Pointer and Control Start Stop SIFTSM0 SIFTSM23 Set_SIFIFG2 SIFTSMx SIFCH0 SIFCH1 SIFLCOFF SIFEX SIFCA SIFCLKON SIFRSON SIFTESTS1 SIFDAC SIFSTOP SIF ACLK SIFREPEAT0 SIFREPEAT1 SIFREPEAT2 SIFREPEAT3 SIFREPEAT4 SIFCHx(tsm) SIFLCOFF(tsm) SIFEX(tsm) SIFC[...]
-
Página 476
Scan IF Operation 24-16 Scan IF TSM Operation The TSM state machine automatically starts and re-starts periodically based on a divided ACLK start signal selected with the SIFDIV2x bits the SIFDIV3Ax and SIFDIV3Bx bits when SIFTSMRP = 0. For example, if SIFDIV3A and SIFDIV3B are configured to 270 ACLK cycles, then the TSM automatically starts every [...]
-
Página 477
Scan IF Operation 24-17 Scan IF TSM State Clock Source Select Th e TSM clock source is individually configurable for each state. The TSM can be clocked from ACLK or a high frequency clock selected with the SIF ACLK bit. When SIF ACLK = 1, ACLK is used for the state, and when SIF ACLK = 0, the high frequency clock is used. The high frequency clock c[...]
-
Página 478
Scan IF Operation 24-18 Scan IF TSM T est Cycles For calibration purposes, to detect sensor drift, or to measure signals other than the sensor signals, a test cycle may be inserted between TSM cycles by setting the SIFTESTD bit. The time between the TSM cycles is not altered by the test cycle insertion as shown in Figure 24 − 9. At the end of the[...]
-
Página 479
Scan IF Operation 24-19 Scan IF TSM Example Figure 24 − 10 shows an example for a TSM sequence. The TSMx register values for the example are shown in T able 24 − 6. ACLK and SIFCLK are not drawn to scale. The TSM sequence starts with SIFTSM0 and ends with a set SIFSTOP bit in SIFTSM9. Only the SIFTSM5 to SIFTSM9 states are shown. T able 24 − [...]
-
Página 480
Scan IF Operation 24-20 Scan IF 24.2.3 Scan IF Processing State Machine The PSM is a programmable state machine used to determine rotation and direction with its state table stored within MSP430 memory (flash, ROM, or RAM). The processing state machine measures rotation and controls interrupt generation based on the inputs from the timing state mac[...]
-
Página 481
Scan IF Operation 24-21 Scan IF Figure 24 − 1 1. Scan IF Processing State Machine Block Diagram Q0 Q3 Q4 Q5 Q6 Q7 S2 S1 SIFQ6EN SIFQ7EN Q7 . . . Q0 Q0 Q1 Q2 Q3 Q4 Q5 Q6 Q7 MSP430 Memory Range State T able SIFCNT1 +1 − 1 SIFCNT1ENM SIFEN SIFCNT1ENP SIFIS1x SIFCNT2 − 1 SIFCNT2EN SIFIS2x Q6 Q7 ∆ 1 ∆ 4 ∆ 64 ∆ 256 SIFPSMV SIF1OUT SIF0OUT S[...]
-
Página 482
Scan IF Operation 24-22 Scan IF The current-state and next-state logic are reset while the Scan IF is disabled. On e of the bytes stored at addresses SIFPSMV to SIFPSMV + 3 will be loaded first depending on the S1 and S2 signals when the Scan IF is enabled. Signals S1 and S2 form a 2-bit offset added to the SIFPSMV contents to determine the first b[...]
-
Página 483
Scan IF Operation 24-23 Scan IF PSM Counters Th e PSM has two 8-bit counters SIFCNT1 and SIFCNT2. SIFCNT1 is updated with Q1 and Q2 and SIFCNT2 is updated with Q2. The counters can be read via the SIFCNT register . If the SIFCNTRST bit is set, each read access will reset the counters, otherwise the counters remain unchanged when read. If a count ev[...]
-
Página 484
Scan IF Operation 24-24 Scan IF Simplest State Machine Figure 24 − 12 shows the simplest state machine that can be realized with the PSM. The following code shows the corresponding state table and the PSM initialization. Figure 24 − 12. Simplest PSM State Diagram S1=1 & S2=0 S1=0 & S2=0 S1=1 & S2=1 S1=0 & S2=0 S1=0 & S2=1 S1[...]
-
Página 485
Scan IF Operation 24-25 Scan IF If the PSM is in state 01 of the simplest state machine and the PSM has loaded the corresponding byte at index 01h of the state table: Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 00000000 For this example, S1 and S2 are set at the end of the next TSM sequence. T o calculate the next state the bits Q5 - Q3 and Q0 of the state 01 table en[...]
-
Página 486
Scan IF Operation 24-26 Scan IF 24.2.4 Scan IF Debug Register The Scan IF peripheral has a SIFDEBUG register for debugging and development. Only the lower two bits should be written when writing to the SIFDEBUG register and only MOV instructions should be used write to SIFDEBUG. After writing the lower two bits, reading the SIFDEBUG contents gives [...]
-
Página 487
Scan IF Operation 24-27 Scan IF 24.2.5 Scan IF Interrupts The Scan IF has one interrupt vector for seven interrupt flags listed in T able 24 − 7. Each interrupt flag has its own interrupt enable bit. When an interrupt is enabled, and the GIE bit is set, the interrupt flag will generate an interrupt. The interrupt flags are not automatically clear[...]
-
Página 488
Scan IF Operation 24-28 Scan IF 24.2.6 Using the Scan IF with LC Sensors Systems with LC sensors use a disk that is partially covered with a damping material to measure rotation. Rotation is measured with LC sensors by exciting the sensors and observing the resulting oscillation. The oscillation is either damped or un-damped by the rotating disk. T[...]
-
Página 489
Scan IF Operation 24-29 Scan IF 24.2.6.1 LC-Sensor Oscillation T est The oscillation test tests if the amplitude of the oscillation after sensor excitation is above a reference level. The DAC is used to set the reference level for the comparator , and the comparator detects if the LC sensor oscillations are above or below the reference level. If th[...]
-
Página 490
Scan IF Operation 24-30 Scan IF 24.2.6.2 LC-Sensor Envelope T est The envelop test measures the decay time of the oscillations after sensor excitation. The oscillation envelope is created by the diodes and RC filters. The DAC is used to set the reference level for the comparator , and the comparator detects if the oscillation envelop is above or be[...]
-
Página 491
Scan IF Operation 24-31 Scan IF Figure 24 − 17. LC Sensor Connections For The Envelope T est Power Supply T erminals SIFCI0 SIFCI SIFCI1 SIFCI2 SIFCI3 470 nF AV CC DV CC DV SS AV SS SIFVSS 470 nF SIFCOM SIFCH1 SIFCH0 SIFCH2 SIFCH3[...]
-
Página 492
Scan IF Operation 24-32 Scan IF 24.2.7 Using the Scan IF With Resistive Sensors Systems with GMRs use magnets on an impeller to measure rotation. The damping material and magnets modify the electrical behavior of the sensor so that rotation and direction can be detected. Rotation i s measured with resistive sensors by connecting the resistor divide[...]
-
Página 493
Scan IF Operation 24-33 Scan IF 24.2.8 Quadrature Decoding The Scan IF can be used to decode quadrature-encoded signals. Signals that are 90 ° out of phase with each other are said to be in quadrature. T o Create the signals, two sensors are positioned depending on the slotting, or coating of the encoder disk. Figure 24 − 19 shows two examples f[...]
-
Página 494
Scan IF Operation 24-34 Scan IF Figure 24 − 20. Quadrature Decoding State Diagram 00 10 11 01 00 10 11 01 Correct State T ransitions Erroneous State Transitions +1 − 1 T o transfer the state encoding into counts it is necessary to decide what fraction o f the rotation should be counted and on what state transitions. In this example only full ro[...]
-
Página 495
Scan IF Registers 24-35 Scan IF 24.3 Scan IF Registers The Scan IF registers are listed in T able 24 − 9. T able 24 − 9. Scan IF Registers Register Short Form Register T ype Address Initial State Scan IF debug register SIFDEBUG Read/write 01B0h Unchanged Scan IF counter 1 and 2 SIFCNT Read/write 01B2h Reset with POR Scan IF PSM vector SIFPSMV R[...]
-
Página 496
Scan IF Registers 24-36 Scan IF SIFDEBUG, Scan IF Debug Register , Write Mode 15 14 13 12 1 1 10 9 8 Reserved wwwwwwww 76543 210 Reserved SIFDEBUGx wwwwwwww Reserved Bits 15-2 Reserved. Must be written as zero. SIFDEBUGx Bits 1-0 SIFDEBUG register mode. W riting these bits selects the read-mode of the SIFDEBUG register . SIFDEBUG must be written wi[...]
-
Página 497
Scan IF Registers 24-37 Scan IF SIFDEBUG, Scan IF Debug Register , Read Mode After 01h Is Written 15 14 13 12 1 1 10 9 8 0 0 0 Index Of TSM Register r r r r r r r r 76543 210 PSM Bits Q7 − Q0 r r r r r r r r Unused Bits 15-13 Unused. After 01h is written to SIFDEBUG, these bits are always read as zero. TSM Index Bits 12-8 When SIFDEBUG is read, a[...]
-
Página 498
Scan IF Registers 24-38 Scan IF SIFDEBUG, Scan IF Debug Register , Read Mode After 03h Is Written 15 14 13 12 1 1 10 9 8 0 Active DAC Register 0 0 DAC Data rrrrrrrr 76543 210 DAC Data rrrrrrrr Unused Bit 15 Unused. After 03h is written to SIFDEBUG, this bit is always read as zero. DAC Register Bits 14-12 When SIFDEBUG is read, after 03h is written [...]
-
Página 499
Scan IF Registers 24-39 Scan IF SIFCNT , Scan IF Counter Register 15 14 13 12 1 1 10 9 8 SIFCNT2x r − (0) r − (0) r − (0) r − (0) r − (0) r − (0) r − (0) r − (0) 76543 210 SIFCNT1x r − (0) r − (0) r − (0) r − (0) r − (0) r − (0) r − (0) r − (0) SIFCNT2x Bits 15-8 SIFCNT2. These bits are the SIFCNT2 counter . SIFCNT2 [...]
-
Página 500
Scan IF Registers 24-40 Scan IF SIFCTL1, Scan IF Control Register 1 15 14 13 12 1 1 10 9 8 SIFIE6 SIFIE5 SIFIE4 SIFIE3 SIFIE2 SIFIE1 SIFIE0 SIFIFG6 rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 SIFIFG5 SIFIFG4 SIFIFG3 SIFIFG2 SIFIFG1 SIFIFG0 SIFTESTD SIFEN rw − (0) rw − (0) rw − (0) rw − ([...]
-
Página 501
Scan IF Registers 24-41 Scan IF SIFIFG0 Bit 2 SIF interrupt flag 0. This bit is set by the SIFxOUT conditions selected by the SIFIFGSETx bits. SIFIFG0 must be reset with software. 0 No interrupt pending 1 Interrupt pending SIFTESTD Bit 1 T est cycle insertion. Setting this bit inserts a test cycle between TSM cycles. SIFTESTD is automatically reset[...]
-
Página 502
Scan IF Registers 24-42 Scan IF SIFCTL2, Scan IF Control Register 2 15 14 13 12 1 1 10 9 8 SIFDACON SIFCAON SIFCAINV SIFCAX SIFCISEL SIFCACI3 SIFVSS SIFVCC2 rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 SIFSH SIFTEN SIFTCH1x SIFTCH0x SIFTCH1 OUT SIFTCH0 OUT rw − (0) rw − (0) rw − (0) rw − [...]
-
Página 503
Scan IF Registers 24-43 Scan IF SIFVCC2 Bit 8 Mid-voltage generator 0A V CC /2 generator is off 1A V CC /2 generator is on if SIFSH = 0 SIFSH Bit 7 Sample-and-hold enable 0 Sample-and-hold is disabled 1 Sample-and-hold is enabled SIFTEN Bit 6 Excitation enable 0 Excitation circuitry is disabled 1 Excitation circuitry is enabled SIFTCH1x Bits 5-4 Th[...]
-
Página 504
Scan IF Registers 24-44 Scan IF SIFCTL3, Scan IF Control Register 3 15 14 13 12 1 1 10 9 8 SIFS2x SIFS1x SIFIS2x SIFIS1x rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 SIFCS SIFIFGSETx SIF3OUT SIF2OUT SIF1OUT SIF0OUT rw − (0) rw − (0) rw − (0) rw − (0) r − (0) r − (0) r − (0) r − (0[...]
-
Página 505
Scan IF Registers 24-45 Scan IF SIFIFGSETx Bits 6-4 SIFIFG0 interrupt flag source. These bits select when the SIFIFG0 flag is set. 000 SIFIFG0 is set when SIF0OUT is set. 001 SIFIFG0 is set when SIF0OUT is reset. 010 SIFIFG0 is set when SIF1OUT is set. 01 1 SIFIFG0 is set when SIF1OUT is reset. 100 SIFIFG0 is set when SIF2OUT is set. 101 SIFIFG0 is[...]
-
Página 506
Scan IF Registers 24-46 Scan IF SIFCTL4, Scan IF Control Register 4 15 14 13 12 1 1 10 9 8 SIFCNTRST SIFCNT2EN SIFCNT1 ENM SIFCNT1 ENP SIFQ7EN SIFQ6EN SIFDIV3Bx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 SIFDIV3Bx SIFDIV3Ax SIFDIV2x SIFDIV1x rw − (0) rw − (0) rw − (0) rw − (0) rw − (0[...]
-
Página 507
Scan IF Registers 24-47 Scan IF SIFDIV3Bx Bits 9-7 TSM start trigger ACLK divider . These bits together with the SIFDIV3Ax bits select the division rate for the TSM start trigger . SIFDIV3Ax Bits 6-4 TSM start trigger ACLK divider . These bits together with the SIFDIV3Bx bits select the division rate for the TSM start trigger . The division rate is[...]
-
Página 508
Scan IF Registers 24-48 Scan IF SIFCTL5, Scan IF Control Register 5 15 14 13 12 1 1 10 9 8 SIFCNT3x rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 SIFTSMRP SIFCLFQx SIFFNOM SIFCLKG ON SIFCLKEN rw − (0) rw − (1) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) SIFCNT3x Bits 15-8[...]
-
Página 509
Scan IF Registers 24-49 Scan IF SIFDACRx, Digital-T o-Analog Converter Registers 15 14 13 12 1 1 10 9 8 0 0 0 0 0 0 DAC Data r0 r0 r0 r0 r0 r0 rw rw 76543 210 DAC Data rw rw rw rw rw rw rw rw Unused Bits 15-10 Unused. These bits are always read as zero, and when written, do not affect the DAC output. DAC Data Bits 9-0 10-bit DAC data[...]
-
Página 510
Scan IF Registers 24-50 Scan IF SIFTSMx, Scan IF Timing State Machine Registers 15 14 13 12 1 1 10 9 8 SIFREPEA Tx SIF ACLK SIFST OP SIFDAC rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) 76543 210 SIFTESTS1 SIFRSON SIFCLKON SIFCA SIFEX SIFLCEN SIFCHx rw − (0) rw − (0) rw − (0) rw − (0) rw − (0) rw [...]
-
Página 511
Scan IF Registers 24-51 Scan IF SIFCLKON Bit 5 High-frequency clock on. Setting this bit turns the high-frequency clock source on for this state when SIF ACLK = 1, even though the high frequency clock is not used for the TSM. When the high-frequency clock is sourced from the DCO, the DCO is forced on for this state, regardless of the MSP430 low-pow[...]
-
Página 512
Scan IF Registers 24-52 Scan IF Processing State Machine T able Entry (MSP430 Memory Location) 76543 210 Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 Q7 Bit 7 When Q7 = 1, SIFIFG6 will be set. When SIFQ6EN = 1 and SIFQ7EN = 1 and Q7 = 1, the PSM proceeds to the next state immediately , regardless of the SIFSTOP(tsm) signal and Q7 is used in the next-state calculation. [...]