HT46RU25 Holtek Semiconductor Inc., HT46RU25 Datasheet - Page 21

no-image

HT46RU25

Manufacturer Part Number
HT46RU25
Description
Ht46ru25/ht46cu25 -- A/d Type 8-bit Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
HT46RU25
Manufacturer:
HOLTEK/合泰
Quantity:
20 000
Input/Output Ports
There are 48 bidirectional input/output lines in the
microcontroller, labeled as PA, PB, PC, PD, PF and PG,
which are mapped to the data memory of [12H], [14H],
[16H], [18H], [28H] and [2AH] respectively. All of these
I/O ports can be used for input and output operations.
For input operation, these ports are non-latching, that is,
the inputs must be ready at the T2 rising edge of instruc-
tion MOV A,[m] (m=12H, 14H, 16H, 18H, 28H or 2AH).
For output operation, all the data is latched and remains
unchanged until the output latch is rewritten.
Each I/O line has its own control register (PAC, PBC,
PCC, PDC, PFC, PGC) to control the input/output con-
figuration. With this control register, CMOS output or
Schmitt trigger input with or without pull-high resistor
structures can be reconfigured dynamically under soft-
ware control. To function as an input, the corresponding
latch of the control register must write a 1 . The input
source also depends on the control register. If the con-
trol register bit is 1 , the input will read the pad state. If
the control register bit is 0 , the contents of the latches
will move to the internal bus. The latter is possible in the
For output function, CMOS is the only configuration.
These control registers are mapped to locations 13H,
15H, 17H, 19H, 29H and 2BH.
Rev. 1.30
read-modify- write instruction.
Bit No.
0
1
2
3
4
5
6
7
T2PSC0
T2PSC1
T2PSC2
T2ON
Label
T2M0
T2M1
T2E
Defines the prescaler stages, T2PSC2, T2PSC1, T2PSC0=
000: f
001: f
010: f
011: f
100: f
101: f
110: f
111: f
Defines the TMR2 active edge of the timer/event counter:
In Event Counter Mode (T2M1,T2M0)=(0,1):
1:count on falling edge;
0:count on rising edge
In Pulse Width measurement mode (T2M1,T2M0)=(1,1):
1: start counting on the rising edge, stop on the falling edge;
0: start counting on the falling edge, stop on the rising edge
Enable/disable timer counting (0=disable; 1=enable)
Unused bit, read as 0
Defines the operating mode, T2M1, T2M0:
01=Event count mode (external clock)
10=Timer mode (internal clock)
11=Pulse width measurement mode
00=Unused
INT
INT
INT
INT
INT
INT
INT
INT
=f
=f
=f
=f
=f
=f
=f
=f
SYS
SYS
SYS
SYS
SYS
SYS
SYS
SYS
/2
/4
/8
/16
/32
/64
/128
TMR2C (2EH) Register
21
After a chip reset, these input/output lines remain at high
levels or floating state (depending on pull-high options).
Each bit of these input/output latches can be set or
cleared by SET [m].i and CLR [m].i (m=12H, 14H,
16H, 18H, 28H or 2AH) instructions.
Some instructions first input data and then follow the
output operations. For example, SET [m].i , CLR
[m].i , CPL [m] , CPLA [m] read the entire port states
into the CPU, execute the defined operations
(bit-operation), and then write the results back to the
latches or the accumulator.
Each line of port A has the capability of waking-up the
device. Each I/O port has a pull-high option. Once the
pull-high option is selected, the I/O port has a pull-high
resistor, otherwise, there s none. Take note that a
non-pull-high I/O port operating in input mode will cause
a floating state.
The PA3 and PA5 are pin-shared with the PFD and INT
pins respectively. If the PFD option is selected, the out-
put signal in output mode of PA3 will be the PFD signal
generated by the timer/event counter overflow signal.
The input mode always remain in its original functions.
Once the PFD option is selected, the PFD output signal
is controlled by the PA3 data register only. Writing a 1
to the PA3 data register will enable the PFD output func-
tion and writing 0 will force the PA3 to remain at 0 .
Function
HT46RU25/HT46CU25
March 9, 2007

Related parts for HT46RU25