R-Engine-D
Chapter 3: Hardware
3-9
You can read the ports with:
inportb(0x1A0); // port 0
inportb(0x1A2); // port 1
inportb(0x1A4); // port 2
This returns an 8-bit value for each port, with each bit corresponding to the appropriate line on the port.
Port 1 and port 2 of the PPI are routed directly to the J3 header. Neither port has external pull-up or pull-
down resistors. When using these lines as input, their value will be floating unless driven by an external
source or pull resistor.
Port 0 is used as the input to the high voltage driver at U10. The corresponding outputs of the high voltage
driver are IO0 – IO7, which are also routed to the J3 header. If TTL level I/Os are necessary for Port 0 of
the PPI, a resistor pack can be installed in the U10 socket to generate eight additional TTL level I/Os. Port
0, I00 – I07, is tied to a pull-up resistor network, making the default output of the U10 high voltage driver
low.
Real-time Clock DS1337
The DS1337 serial real-time clock is a low-power clock/calendar with two programmable time-of-day
alarms and a programmable square-wave output. Address and data are transferred serially via a 2-wire,
bidirectional bus. The clock/calendar provides seconds, minutes, hours, day, date, month, and year
information. The data at the end of the month is automatically adjusted for months with fewer than 31
days, including corrections for leap year. The clock operates in either 24-hour or 12-hour format with
AM/PM indicator.
The RTC is accessed via software drivers
rtc_init()
and
rtc_rds().
Refer to sample code in the samples\re
directory for re_rtc.c. The sample code is identical to the
RD
s predecessor, the
RE
.
It is also possible to configure the real-time clock to raise an output line attached to an external interrupt, at
1/64 second, 1 second, 1 minute, or 1 hour intervals. This can be used in a time-driven application, or the
VOFF
signal can be used to turn on/off the controller using an external switching power supply.
UART SCC2692
The dual UART (SCC26C92, Phillips, U4) is a 44-pin PLCC chip. The SCC26C92 includes two
independent full-duplex asynchronous receiver/transmitters, a quadruple buffered receiver data register, an
interrupt control mechanism, programmable data format, selectable baud rate for the receiver and
transmitter, a multi-functional and programmable 16-bit counter/timer, an on-chip crystal oscillator, and a
multi-purpose input/output including RTS and CTS mechanism.
A 3.6864 MHz external crystal is installed as the default crystal for the dual UART.
For more detailed information, refer to the SCC26C92 data sheets (Phillips Semiconductors) or on the CD
in the
tern_docs\parts
directory.
Sample programs for the SCC2692 can be found in the
c:\tern\186\samples\re
directory.
3.7
Other Devices
A number of other devices are also available on the R-Engine-D. Some of these are optional, and might not
be installed on the particular controller you are using. For a discussion regarding the software interface for
these components, please see the Software chapter.