Engineering Agit

[Session 02 TM4C123GXL Study 02] - GPIO 01 본문

Embedded Lab. @ Modu inst./2020 Session 02 (2020.06~)

[Session 02 TM4C123GXL Study 02] - GPIO 01

Sean_Kim95 2020. 7. 28. 11:29

◈ 본문에 들어가기 앞서

 GPIO는 1. Datasheet 2. edX강좌 내용 으로 구성된다. 이번 포스트에서는 GPIO 핀의 기본적인 특징을 언급할 것이다.


#1 GPIO module features

 GPIO module은 6개의 물리적 GPIO block들로 이루어져있다. 이는 각각의 GPIO port(A~F)에 상응한다.

  • Up to 43 GPIOs, depending on configuration

  • Highly flexible pin muxing allows use as GPIO or one of several peripheral functions

  • 5-V-tolerant in input configuration

  • Ports A-G accessed through the Advanced Peripheral Bus (APB)

  • Fast toggle capable of a change every clock cycle for ports on AHB, every two clock cycles for ports on APB

  • Programmable control for GPIO interrupts

    • –  Interrupt generation masking

    • –  Edge-triggered on rising, falling, or both

    • –  Level-sensitive on High or Low values

  • Bit masking in both read and write operations through address lines

  • Can be used to initiate an ADC sample sequence or a μDMA transfer

  • Pin state can be retained during Hibernation mode

  • Pins configured as digital inputs are Schmitt-triggered

  • Programmable control for GPIO pad configuration

    • –  Weak pull-up or pull-down resistors

    • –  2-mA, 4-mA, and 8-mA pad drive for digital communication; up to four pads can sink 18-mA for high-current applications

    • –  Slew rate control for 8-mA pad drive

    • –  Open drain enables

    • –  Digital input enables

 

#2 Signal description

GPIO signal들은 alternate HW function들을 갖고 있다. 모든 GPIO signal들은 5V까지 input신호로 받을 수 있다(PD4, PD5, PB0 그리고 PB1의 경우에는 3.6V까지).

Digital alternate HW function은 GPIOAFSEL(GPIO Alternate Function Set)과 GPIODEN(GPIO Digital Enable) reg.에서 적절한 bit를 1로 쓰면 활성화 할 수 있고 PMCx bit field는 GPIOPCTL(GPIO Port Control) reg.를 numeric encodeing으로 설정할 수 있다.

Analog signal은 마찬가지로 5V까지 input으로 받을 수 있으며 GPIODEN reg.에서 해당 bit를 clear함으로써 활성화된다. AINx analog signal들은 Vdd(아래의 표 24-1.)이상을 넘지 못하게 하는 내부회로가 있지만, analog performance specification은 I/O pad에 0 < Vin < Vdd 내의 signal이 들어올 때에만 보장된다. 각각의 핀은 개별적으로 프로그램되어야한다.

 ★ 아래의 표는 GPIO 핀의 특수 기능에 대한 표이다. 각각의 GPIO 핀은 GPIO들과 tri-stated로 기본 설정되어 있다(GPIOAFSEL=0, GPIODEN=0, GPIOPDR=0, GPIOPUR=0, GPIOPCTL=0). 특수 기능의 핀들은 non-GPIO 기능이나 reset범위 밖의 special commit control들로 프로그램된다. 추가로 POWER-ON-RESET이나 RESET핀 활성화는 이 GPIO 핀들의 기능을 원래의 기본 설정대로 되돌린다.

 GPIO commit control reg.는 돌발적인 프로그래밍(JTAG/SWD signal과 NMI signal들로 GPIO 핀에 기능할 수 있는 critical HW signal들)을 막는 보호층을 제공한다. Commit control에 대한 내용은 다음과 같이 Datasheet p.656에 있다.

※ Commit Control: The GPIO commit control registers provide a layer of protection against accidental programming of critical hardware peripherals. Protection is provided for the GPIO pins that can be used as the four JTAG/SWD pins and the NMI pin (see “Signal Tables” on page 1329 for pin numbers). Writes to protected bits of the GPIO Alternate Function Select (GPIOAFSEL) register (see page 671), GPIO Pull Up Select (GPIOPUR) register (see page 677), GPIO Pull-Down Select (GPIOPDR) register (see page 679), and GPIO Digital Enable (GPIODEN) register (see page 682) are not committed to storage unless the GPIO Lock (GPIOLOCK) register (see page 684) has been unlocked and the appropriate bits of the GPIO Commit (GPIOCR) register (see page 685) have been set.

Tiva™ C Series TM4C123GH6PM Microcontroller Data Sheet (Rev. E)
Comments