I/O Ports (Pport) - Epson S1C31D01 Software Manual

Cmos 32-bit single chip microcontroller peripheral circuit sample software manual
Table of Contents

Advertisement

3.7 I/O Ports (PPORT)

The PPORT module controls the general-purpose input/output (GPIO) pins of the S1C31D01.
This example configures pin P35 as an output connected to pin P36 configured as an input. It performs various
tests to check the connectivity of P35 and P36.
Hardware Setup
For this example program, connect P35 to P36.
(J2.3) P35--------->>---------P36 (J2.1)
Operations
1. Start the OSC1 oscillation and switch the system clock from IOSC to OSC1. Then sotp the IOSC.
2. Initialize the ports.
3. Set the P35 port to output and Output a Low level signal.
4. Set the P36 port to input and set it so that an interrupt occurs when the level changes from Low to High.
5. Output a High level signal from the P35 port.
6. Confirm that the P36 port is at High level after an interrupt in the P36 port.
7. Set the P36 port so that an interrupt occurs when the level changes from High to Low.
8. Output a Low level signal from the P35 port.
9. Confirm that the P36 port is at Low level after an interrupt in the P36 port. Start the OSC1 oscillation and
switch the system clock from IOSC to OSC1. Then stop the IOSC.
Example of Output
-CPU clock- seCLG_IOSC (20000000)
P35 output state: Low
P36 input state: Low
P36 input waits for RISING edge interrupt
P35 output is going to HIGH...
Interrupt on P36 occured
P35 output state: High
P36 input state: High
P35 output state: High
P36 input state: High
P36 input waits for FALLING edge interrupt
P35 output is going to LOW...
Interrupt on P36 occured
P35 output state: Low
P36 input state: Low
Exit
38
Seiko Epson Corporation
S1C31D01 Peripheral Circuit Sample
Software Manual (Rev.3.00)

Advertisement

Table of Contents
loading

Table of Contents