R-Engine-D
Chapter 3: Hardware
3-5
PIO
Function
Power-On/Reset
status
R-Engine-D Pin No. R-Engine-D Initial
after ae_init();
function call
P28
RxD
Input with pull-up
J2 pin 26
RxD1
P29
S6/CLKSEL1
Input with pull-up
N/A
Input with pull-up*
P30
INT4
Input with pull-up
U24 pin 37
ith pull-up
Input w
P31
INT2
Input with pull-up
J2 pin 19
Input with pull-up
*
P2
t N
uring power-on or reset.
bl
O pin def
n aft
on or reset
The
E and PIODIRECTION. The
setti
Note:
6 and P29 mus
OT be forced low d
Ta e 3.1 I/
ault configuratio
er power-
32 PIO lines, P0-P31, are configurable via two 16-bit registers, PIOMOD
ngs are as follows:
MODE
PIOMODE reg.
PIODIRECTION reg.
PIN FUNCTION
0 0
0
Normal
operation
1
0
1
INPUT with pull-up/pull-down
2 1
0
OUTPUT
3
1
1
INPUT without pull-up/pull-down
R-Eng
itialization on PIO pins
ae_init()
is listed below
ou
rt
(0xff78,0xc7bc);
// PDIR1, TxD0, RxD0, TxD
PI
outport
(0xff76,0x2040); //
PIOM1
2=PCS6=RTC
The
itialize PIO pins.
void
2, 2); will set P12 as output
tput
void
pio
, char
pio_wr
(12,0); set P12 pin low, if P12 is in output mode
unsigned
ing pin is in input mode,
io_rd
(1); return 16-bit status of P16-P31, if corresponding pin is in input mode,
by the R-Engine-D system for on-board components (
Error! Reference
source
hat you are not
interferi
ine-D in
in
:
tpo
1, RxD1, P16=PCS0, P17=PCS1=P
outport
(0xff72,0xec73);
// PDIR0, P12,A19,A18,A17,P
outport
(0xff70,0x1040);
// PIOM0, P12=LED
C function in the library
re_lib
can be used to in
pio_init
(char bit, char mode);
Where bit = 0-31 and mode = 0-3, see the table above.
Example:
pio_init
(1
pio_init
(1, 0); will set P1 as Timer1 ou
_wr
(char bit
dat);
pio_wr
(12,1); set P12 pin high, if P12 is in output mode
int
pio_rd
(char port);
pio_rd
(0); return 16-bit status of P0-P15, if correspond
p
Some of the I/O lines are used
not found.
). We suggest that you not use these lines unless you are sure t
ng with the operation of such components (i.e., if the component is not installed).