User guide

55
SmartBook for Renesas R8C/Tiny Microcontrollers
www.MightyMicons.com
Chapter 6. Ports, Data Converters and Communication Facilities
6.1 Introduction:
As you already know, Renesas microcontrollers are very popular for the rich set
of peripheral functions. R8C/Tiny controllers sport plenty of I/O lines, range of 8/
16 bit timer/counters, flexible communicating options like serial ports, IIC, SPI
compatible ports, CAN and LIN facilities apart from multi channel 10 bit Analog to
Digital converters. Also newly introduced R8C/Tiny controllers come with 8 bit
Digital to Analog converters. In fact, about 90% of the device pins correspond to
the peripheral functions in every device.
6.2 I/O Port Lines:
Now, we start our discussion on these peripheral functions by taking up the port
lines. In the R8C/Tiny devices, all the input and output lines of other peripheral
functions are tied up with these port lines. In other words, each of these port pins
act either as an I/O line or as a part of other peripheral functions. Proper initialization
is always required prior to using the pins in the applications. These I/O port lines
have facility to get internal pull up resistors by the software initialization. Also
few specified I/O ports have capacity to provide high current output under the
software control. These ports can directly drive LEDs.
These I/O ports are managed by using corresponding port control
registers like Port Direction Registers, Port Data Registers,
Pull up Control Registers and Port Drive Capacity
Control Registers. Port direction registers define
the port lines either as an input line or output
line. When the microcontroller comes out of
reset, all the port lines are predefined as
the input lines. During application
execution, the port lines are required to
be configured properly by this direction
register. A high level at the
corresponding bit defines the port line
as output line. Always the micon
comes with enough port direction
registers to match all the available
port lines.
D
a
t
a
4
D
e
s
i
g
n
The I/O
ports are managed
by using corresponding
port control registers like
Port Direction Registers, Port
Data Registers, Pull up Control
Registers and Port Drive Capacity
Control Registers. Port data registers are
the intermediate stage between the CPU
and the port lines
managing the external
events. These registers
come with input buffers and
output latches for all the
available port lines.