DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

48R01A3 데이터 시트보기 (PDF) - Holtek Semiconductor

부품명
상세내역
제조사
48R01A3
Holtek
Holtek Semiconductor Holtek
48R01A3 Datasheet PDF : 49 Pages
First Prev 11 12 13 14 15 16 17 18 19 20 Next Last
HT48R01A
I/O Port Control Registers
Port A has its own control register, known as PAC, which
controls the input/output configuration. With this control
register, each PA0~PA6 I/O pin with or without pull-high
resistors can be reconfigured dynamically under soft-
ware control. Pins PA0 to PA6 port are directly mapped
to a bit in its associated port control register. For the I/O
pin to function as an input, the corresponding bit of the
control register must be written as a ²1². This will then
allow the logic state of the input pin to be directly read by
instructions. When the corresponding bit of the control
register is written as a ²0², the I/O pin will be setup as a
CMOS output. If the pin is currently setup as an output,
instructions can still be used to read the output register.
However, it should be noted that the program will in fact
only read the status of the output data latch and not the
actual logic status of the output pin.
Pin-shared Functions
The flexibility of the microcontroller range is greatly en-
hanced by the use of pins that have more than one func-
tion. Limited numbers of pins can force serious design
constraints on designers but by supplying pins with
multi-functions, many of these difficulties can be over-
come. For some pins, the chosen function of the
multi-function I/O pins is set by configuration options
while for others the function is set by application pro-
gram control.
· External Interrupt Input
The external interrupt pin, INT, is pin-shared with the
I/O pin PA3. To use the pin as an external interrupt in-
put the correct bits in the INTCO register must be pro-
grammed. The pin must also be setup as an input by
setting the appropriate bit in the Port Control Register.
A pull-high resistor can also be selected via the appro-
priate port pull-high resistor register. Note that even if
the pin is setup as an external interrupt input the I/O
function still remains.
· External Timer/Event Counter Input
The device contains a single Timer/Event Counter.
The Timer/Event Counter has an external input pin,
known as TMR0 which is pin-shared with the I/O pin
PA2. For the shared pin to be used as a Timer/Event
Counter input, the Timer/Event Counter must be con-
figured to be in the Event Counter or Pulse Width
Measurement Mode. This is achieved by setting the
appropriate bits in the Timer/Event Counter Control
Register. The pin must also be setup as an input by
setting the appropriate bit in the Port Control Register.
Pull-high resistor options can also be selected via the
port pull-high resistor register. Note that even if the pin
is setup as an external timer input the I/O function still
remains.
· Buzzer
Buzzer output pins BZ and BZ are pin-shared with I/O
pins PA0 and PA1. The buzzer function is selected by
setting the appropriate bits in the CTRL0 register.
Note that the corresponding bits of the port control
register, PAC, must setup the pins as outputs to en-
able the buzzer outputs. If the PAC port control regis-
ter has setup the pins as inputs, then the pins will
functions as normal logic inputs with the usual
pull-high options, even if the buzzer function has been
selected.
I/O Pin Structures
The diagrams illustrate the I/O pin internal structures. As
the exact logical construction of the I/O pin may differ
from these drawings, they are supplied as a guide only
to assist with the functional understanding of the I/O
pins.
Programming Considerations
Within the user program, one of the first things to con-
sider is port initialisation. After a reset, the PA data regis-
ter and PAC port control register will be set high. This
means that all I/O pins will default to an input state, the
level of which depends on the other connected circuitry
and whether pull-high options have been selected. If the
PAC port control register, is then programmed to setup
some pins as outputs, these output pins will have an ini-
tial high output value unless the associated PA port data
register is first programmed. Selecting which pins are in-
puts and which are outputs can be achieved byte-wide
by loading the correct value into the port control register
or by programming individual bits in the port control reg-
ister using the ²SET [m].i² and ²CLR [m].i² instructions.
Note that when using these bit control instructions, a
read-modify-write operation takes place. The
microcontroller must first read in the data on the entire
port, modify it to the required new bit values and then re-
write this data back to the output ports.
S y s te m C lo c k
T1
T2
T3
T4
T1
T2
T3
T4
P o rt D a ta
W r ite to P o r t
R e a d fro m P o rt
Read/Write Timing
Pins PA0 to PA7 each have a wake-up functions, se-
lected via the PAWK register. When the device is in the
Power Down Mode, various methods are available to
wake the device up. One of these is a high to low transi-
tion of any of the these pins. Single or multiple pins on
Port A can be setup to have this function.
Rev. 1.10
15
August 4, 2008

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]