2009년 10월 19일 월요일

[AVR] ATmega I/O 레지스터

ATmega128 각 포트는 3개의 I/O레지스터를 사용하여 제어할 수 있도록 구성되어 있다.

 

DDRx(Data Direction Register) : 입출력의 방향 설정 (R/W)

PINx(Port Input Pins Register) : 포트 입력 핀 (Only Read)

PORTx : 데이터 출력 (R/W)

 

보통의 마이컴은 입력과 출력 데이터 레지스터를 구분하지 않는데 AVR의 경우 각각의 레지스터를 가진다.

 

 

* Datasheet 보러가기 : Atmega128L

 

* Datasheet 일부 발췌 (60page..)

Three I/O memory address locations are allocated for each port, one each for the Data

Register – PORTx, Data Direction Register – DDRx, and the Port Input Pins – PINx. The

Port Input Pins I/O location is read only, while the Data Register and the Data Direction

Register are read/write.

댓글 없음:

댓글 쓰기