Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
34
Добавлен:
27.04.2015
Размер:
1.98 Mб
Скачать

Port B GPIO Functionality

5.2 Port B Interrupt Generation

The following information describes the interrupt generation capabilities for the lower eight pins of Port B.

Pins PB7–PB0 can be programmed to generate an interrupt by a transition on any of their input signals.

Each pin can be programmed to detect a rising or a falling transition.

Each pin can be individually enabled or masked.

Each pin must be configured as an input pin to generate an interrupt.

Any pin not used for generating an interrupt can be used as a GPIO pin.

When the correct transition occurs on any pin enabled for interrupts, all pins enabled for interrupts are latched into the PBD register. Any pins not enabled for interrupt inputs are not latched.

As with all on-chip programmable peripheral interrupts for the DSP56824, the status register (SR) must first be set to enable maskable interrupts (interrupts of level IPL 1). See Section 3.1.3, “DSP56824 Status Register (SR),” on page 3-7 for more information about the SR. Next, the IPR must also be set to enable the interrupt. See Section 3.3.1, “DSP56824 Interrupt Priority Register (IPR),” on page 3-14 for more information about the IPR.

Set up the interrupt feature of Port B as follows:

1.Configure the SR to allow maskable interrupts.

2.Configure any pins desired for interrupt generation as inputs using the PBDDR.

3.Configure the associated INV bits for these pins, but leave associated MSK bits cleared (in the PBINT register).

4.Set the MSK bits for the associated pins.

5.Using the CH0 bit, enable the GPIO interrupt in the IPR. (See Section 3.3.1, “DSP56824 Interrupt Priority Register (IPR),” on page 3-14.)

Figure 5-3 shows the Port B interrupt block diagram.

5-6

DSP56824 User’s Manual

 

Соседние файлы в папке DSP568xx