본문 바로가기
3. 개발 관련/정리 :: issue 와 resovle

MSP430 P1/P2 Interrupt register 정리(펌)

by kyuho.choi 2009. 7. 9.
728x90
반응형

MSP430 유저 매뉴얼에서도 찾기 힘들었었던 내용이었는데,(Interrupt enable과 Interrupt flag register만 나와있었다)

구글의 힘은 대단하구나 -_-;;


원본 출처는 모르지만 정리해놓은 분께 감사드립니다.


Operation of Digital I/O Ports
------------------------------

# Direction registers PnDIR(n=1..6)
 Bit = 0: the port pin is switched to input direction
 Bit = 1: the port pin is switched to output direction

# Input registers, PnIN
 Each bit in each PnINreflects the value of the input signal at the 
 corresponding I/O pin when the pin is configured as I/O function

# Output registers, PnOUT
 Each bit in each PnOUTis the value to be output on the corresponding 
 I/O pin when the pin is configured as I/O function and output direction

# Function select registers, PnSEL
 Bit = 0: I/O Function is selected for the pin
 Bit = 1: peripheral module function is selected for the pin

# Example: Output ACLK on P1.5 on MSP430F41x

 BIS.B #020h, &P1SEL ; Select ACLK function for pin
 BIS.B #020h, &P1DIR ; Set direction to output *Required*
 
# When any P1SELx or P2SELx bit is set, the corresponding pin’s 
 interrupt function is disabled, regardless of the state of the 
 corresponding P1IE or P2IE bit


P1 and P2 Interrupts
--------------------

# Each pin in ports P1 and P2 have interrupt capability, 
 configured with the PnIFG, PnIE, and PnIESregisters

# Interrupt enable register, P1IE and P2IE

 Each PnIEbit enables the associated PnIFG interrupt flag
  Bit = 0: the interrupt is disabled
  Bit = 1: the interrupt is enabled
 
# Interrupt flag registers, P1IFG and P2IFG
 Each PnIFGxbit is set when the selected input signal edge occurs 
 at the pin
  Bit = 0: No interrupt is pending
  Bit = 1: An interrupt is pending
 Each PnIFGflag must be reset with software Software can also set 
 each PnIFGflag, providing a way to generate a software initiated 
 interrupt

# Interrupt edge select registers, P1IES and P2IES
 Bit = 0: the PnIFGxflag is set with a low-to-high transition
 Bit = 1: the PnIFGxflag is set with a high-to-low transition



다시 자료를 찾다보니 출처를 찾았네요.

http://www.ezdoum.com/stories.php?story=06/02/22/5243884

정말 잘 참고하였습니다.

728x90
반응형

댓글