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

Port C GPIO Functionality

Unlike the pins on Port B, none of the GPIO pins on Port C can be configured to provide interrupts when configured as GPIO pins. When configured as peripheral pins, interrupts can be set within the peripheral. For example, when PC8–PC13 are configured to access the SSI functionality, level 0 maskable interrupts can be generated.

NOTE:

All CC bits are cleared on reset.

6.1.2 Port C Data Direction Register (PCDDR)

If a port pin is selected as a GPIO pin, the direction of that pin is determined by a corresponding bit in the PCDDR. The port pin is configured as an input if the corresponding CDD bit is cleared, and is configured as an output if the corresponding CDD bit is set. Table 6-2 shows how this bit is defined.

Table 6-2. PCDDR Bit Definition

CDD

Pin Direction

 

 

 

 

0

Input

 

 

1

Output

 

 

All PCC register bits and PCDDR bits are cleared on processor reset, configuring all Port C pins as general-purpose input pins. If the port pin is selected as an on-chip peripheral pin, the corresponding data direction bit is ignored and the direction of that pin is determined by the operating mode of the on-chip peripheral.

NOTE:

All CDD bits are cleared on reset.

6.1.3 Port C Data (PCD) Register

The Port C data (PCD) register allows accessing data through a port pin that has been configured as a GPIO pin. Data written to the PCD register is stored in an output latch. If the port pin is configured as an output, the output latch data is driven out on the port pin. When the PCD register is read, the logic value on the output port pin is read. If the port pin is configured as an input, data written to the PCD register is still stored in the output latch but is not gated to the port pin. When the PCD register is read, the state of the port pin is read. That is, reading the port data register will reflect the state of the pins regardless of how they were configured.

When a port pin is configured as a dedicated on-chip peripheral pin (the corresponding CC bit is set), the PCD register reads the state of the input pin or output driver.

6.2Port C Programming Examples

Example 6-1 on page 6-5 through Example 6-3 on page 6-7 show how to configure Port C pins as GPIO pins to use them for receiving data (configured as input) and for sending data (configured as output).

6-4

DSP56824 User’s Manual

 

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