19.07.2014 Views

PIC24HJ64 Datasheet

PIC24HJ64 Datasheet

PIC24HJ64 Datasheet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PIC24HJ32GP302/304, <strong>PIC24HJ64</strong>GPX02/X04, AND PIC24HJ128GPX02/X04<br />

10.1.1 OPEN-DRAIN CONFIGURATION<br />

In addition to the PORT, LAT and TRIS registers for<br />

data control, some port pins can also be individually<br />

configured for either digital or open-drain output. This<br />

is controlled by the Open-Drain Control register,<br />

ODCx, associated with each port. Setting any of the<br />

bits configures the corresponding pin to act as an<br />

open-drain output.<br />

The open-drain feature allows the generation of<br />

outputs higher than VDD (e.g., 5V) on any desired<br />

digital-only pins by using external pull-up resistors.<br />

The maximum open-drain voltage allowed is the same<br />

as the maximum VIH specification.<br />

Some I/O pins may have internal analog functionality<br />

that will not be shown on the device pin diagram.<br />

These pins must be treated as analog pins. Table 10-1<br />

lists all available pins and their functionality.<br />

TABLE 10-1: AVAILABLE I/O PINS AND THEIR FUNCTIONALITY<br />

I/O Pin Digital Only/5V Tolerant I/O Pin Digital Only/5V Tolerant<br />

RA0 No RB9 Yes<br />

RA1 No RB10 Yes<br />

RA2 No RB11 Yes<br />

RA3 No RB12 No<br />

RA4 No RB13 No<br />

RA7 Yes RB14 No<br />

RA8 Yes RB15 No<br />

RA9 Yes RC0 No<br />

RA10 Yes RC1 No<br />

RB0 No RC2 No<br />

RB1 No RC3 Yes<br />

RB2 No RC4 Yes<br />

RB3 No RC5 Yes<br />

RB4 No RC6 Yes<br />

RB5 Yes RC7 Yes<br />

RB6 Yes RC8 Yes<br />

RB7 Yes RC9 Yes<br />

RB8<br />

Yes<br />

10.2 Configuring Analog Port Pins<br />

The AD1PCFGL and TRIS registers control the operation<br />

of the analog-to-digital (A/D) port pins. The port<br />

pins that are to function as analog inputs must have<br />

their corresponding TRIS bit set (input). If the TRIS bit<br />

is cleared (output), the digital output level (VOH or VOL)<br />

is converted.<br />

When the PORT register is read, all pins configured as<br />

analog input channels are read as cleared (a low level).<br />

Pins configured as digital inputs do not convert an<br />

analog input. Analog levels on any pin defined as a<br />

digital input (including the ANx pins) can cause the<br />

input buffer to consume current that exceeds the<br />

device specifications.<br />

10.2.1 I/O PORT WRITE/READ TIMING<br />

One instruction cycle is required between a port<br />

direction change or port write operation and a read<br />

operation of the same port. Typically this instruction<br />

would be an NOP, as shown in Example 10-1.<br />

DS70293B-page 126 Preliminary © 2008 Microchip Technology Inc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!