Digital I/O Operation
11-3
Digital I/O
11.2 Digital I/O Operation
The digital I/O is configured with user software. The setup and operation of the
digital I/O is discussed in the following sections. Each port register is an 8-bit
register and is accessed with byte instructions. Registers for P7−P8 and
P9−P10 are arranged such that the two ports can be addressed at once as a
16-bit port. The P7/P8 combination is referred to as PA and the P9/P10
combination is referred to as PB in the standard definitions file. For example,
to write to P7SEL and P8SEL simultaneously, a word write to PASEL would
be used. Some examples of accessing these ports follow:
BIS.B #01h,&P7OUT
; Set LSB of P7OUT.
; P8OUT is unchanged
MOV.W #05555h,&PAOUT
; P7OUT and P8OUT written
; simultaneously
CLR.B &P9SEL
; Clear P9SEL, P10SEL is unchanged
MOV.W &PBIN,&0200h
; P9IN and P10IN read simultaneously
; as 16-bit port.
11.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 as I/O function.
Bit = 0: The input is low
Bit = 1: The input is high
Note:
Writing to Read-Only Registers PxIN
Writing to these read-only registers results in increased current consumption
while the write attempt is active.
11.2.2 Output Registers PxOUT
Each bit in each PxOUT register is the value to be output on the corresponding
I/O pin when the pin is configured as I/O function and output direction.
Bit = 0: The output is low
Bit = 1: The output is high
11.2.3 Direction Registers PxDIR
Each bit in each PxDIR register selects the direction of the corresponding I/O
pin, regardless of the selected function for the pin. PxDIR bits for I/O pins that
are selected for other module functions must be set as required by the other
function.
Bit = 0: The port pin is switched to input direction
Bit = 1: The port pin is switched to output direction
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...