English
Language : 

BS83A02A-4 Datasheet, PDF (42/81 Pages) Holtek Semiconductor Inc – Touch I/O Flash MCU
BS83A02A-4/BS83A04A-3/BS83A04A-4
Touch I/O Flash MCU
PAC Register – BS83A04A-3/BS83A04A-4
Bit
Name
R/W
POR
7
PAC7
R/W
1
6
PAC6
R/W
1
5
PAC5
R/W
1
4
PAC4
R/W
1
3
PAC3
R/W
1
2
PAC2
R/W
1
Bit 7~0
PAC7~PAC0: I/O Port bit 7 ~ bit 0 Input/Output Control
0: Output
1: Input
1
PAC1
R/W
1
0
PAC0
R/W
1
I/O Pin Structures
The accompanying diagrams illustrate the internal structures of some generic I/O pin types. As
the exact logical construction of the I/O pin will differ from these drawings, they are supplied as a
guide only to assist with the functional understanding of the I/O pins. The wide range of pin-shared
structures does not permit all types to be shown.
D a ta B u s
C o n tr o l B it
D
Q
P u ll- H ig h
R e g is te r
S e le c t
V DD
W eak
P u ll- u p
W r ite C o n tr o l R e g is te r
C h ip R e s e t
R e a d C o n tr o l R e g is te r
W r ite D a ta R e g is te r
R e a d D a ta R e g is te r
CK Q
S
D a ta B it
D
Q
CK Q
S
M
U
X
I/O p in
S y s te m W a k e -u p
W a k e - u p S e le c t P A o n ly
Generic Input/Output Ports
Programming Considerations
Within the user program, one of the things first to consider is port initialisation. After a reset, all
of the I/O data and port control registers will be set to high. This means that all I/O pins will be
defaulted to an input state, the level of which depends on the other connected circuitry and whether
pull-high selections have been chosen. If the port control registers are then programmed to setup
some pins as outputs, these output pins will have an initial high output value unless the associated
port data registers are first programmed. Selecting which pins are inputs and which are outputs can
be achieved byte-wide by loading the correct values into the appropriate port control register or
by programming individual bits in the port control register 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 rewrite this data back to the output ports.
Port A has the additional capability of providing wake-up functions. When the device is in the
SLEEP or IDLE Mode, various methods are available to wake the device up. One of these is a high
to low transition of any of the Port A pins. Single or multiple pins on Port A can be setup to have this
function.
Rev. 1.71
42
April 11, 2017