04.03.2013 Views

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Under development<br />

Preliminary document<br />

Specifications in this document are tentative and subject to change.<br />

<strong>RL78</strong>/<strong>D1A</strong> CHAPTER 4 PORT FUNCTIONS<br />

4.2.3 Port 2<br />

48-pin products: P20 to P23 and P27 function as a 5-bit I/O.<br />

64-pin products: P20 to P23 and P27 function as a 5-bit I/O.<br />

80-pin products: P20 to P27 function as an 8-bit I/O port.<br />

100-pin products: P20 to P27 function as an 8-bit I/O port<br />

Port 2 is an 8-bit or a 5-bit I/O port with an output latch. Port 2 can be set to the input mode or output mode in 1-bit units<br />

using port mode register 2 (PM2).<br />

This port can also be used for A/D converter analog input and reference voltage input.<br />

To use P20/ANI0 to P27/ANI7 as digital input pins, set them in the digital I/O mode by using the A/D port configuration<br />

register (ADPC) and in the input mode by using the PM2 register. Use these pins starting from the upper bit.<br />

To use P20/ANI0 to P27/ANI7 as digital output pins, set them in the digital I/O mode by using the ADPC register and in<br />

the output mode by using the PM2 register. Use these pins starting from the upper bit.<br />

To use P20/ANI0 to P27/ANI7 as analog input pins, set them in the analog input mode by using the A/D port<br />

configuration register (ADPC) and in the input mode by using the PM2 register. Use these pins starting from the lower bit.<br />

P20<br />

P21<br />

P22<br />

P23<br />

P24<br />

P25<br />

P26<br />

P27<br />

P20 to P27 Pins<br />

port function<br />

Table 4-4. Setting Functions of P20 to P27 Pins<br />

ADPC<br />

Register<br />

Input port 0001<br />

Input mode<br />

Output port<br />

R01UH0317EJ0004 Rev. 0.04 159<br />

Feb. 22, 2013<br />

PM2<br />

Register<br />

Output mode<br />

Input port 0001 or 0010<br />

Input mode<br />

Output port<br />

Output mode<br />

Input port 0001 to 0011<br />

Input mode<br />

Output port<br />

Output mode<br />

Input port 0001 to 0100<br />

Input mode<br />

Output port<br />

Output mode<br />

Input port 0001 to 0101<br />

Input mode<br />

Output port<br />

Output mode<br />

Input port 0001 to 0110<br />

Input mode<br />

Output port<br />

Output mode<br />

Input port 0001 to 0111<br />

Input mode<br />

Output port<br />

Output mode<br />

Input port 0001 to 1000<br />

Input mode<br />

Output port<br />

Output mode<br />

All P20/ANI0/AVREFP to P27/ANI7 are set in the analog input mode when the reset signal is generated.<br />

Figures 4-12 shows block diagrams of port 2.<br />

Remarks

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

Saved successfully!

Ooh no, something went wrong!