EasyManua.ls Logo

Holtek BS66F340 - Pull-High Resistors; Port a Wake-Up; I;O Port Control Registers

Default Icon
242 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Rev. 1.60 92 August 20, 2019 Rev. 1.60 93 August 20, 2019
BS66F340/BS66F350/BS66F360/BS66F370
Touch A/D Flash MCU with LED Driver
BS66F340/BS66F350/BS66F360/BS66F370
Touch A/D Flash MCU with LED Driver
Unimplemented, read as "0"
PAWUn: Port A Pin wake-up function control
0: Disable
1: Enable
PAPUn/PBPUn/PCPUn/PDPUn/PEPUn/PFPUn/PGPUn/PHPUn: I/O Pin pull-high function control
0: Disable
1: Enable
PAn/PBn/PCn/PDn/PEn/PFn/PGn/PHn: I/O Port Data bit
0: Data 0
1: Data 1
PACn/PBCn/PCCn/PDCn/PECn/PFCn/PGCn/PHCn: I/O Pin type selection
0: Output
1: Input
Pull-high Resistors
Many product applications require pull-high resistors for their switch inputs usually requiring the
use of an external resistor. To eliminate the need for these external resistors, all I/O pins, when
congured as an input have the capability of being connected to an internal pull-high resistor. These
pull-high resistors are selected using the relevant pull-high control registers and are implemented
using weak PMOS transistors. Note that the pull-high resistor can be controlled by the relevant
pull-high control register only when the pin-shared functional pin is selected as an input or NMOS
output. Otherwise, the pull-high resistors can not be enabled.
Port A Wake-up
The HALT instruction forces the microcontroller into the SLEEP or IDLE Mode which preserves
power, a feature that is important for battery and other low-power applications. Various methods
exist to wake-up the microcontroller, one of which is to change the logic condition on one of the Port
A pins from high to low. This function is especially suitable for applications that can be woken up
via external switches. Each pin on Port A can be selected individually to have this wake-up feature
using the PAWU register. Note that the wake-up function can be controlled by the wake-up control
registers only when the pin-shared functional pin is selected as general purpose input/output and the
MCU enters the Power down mode.
I/O Port Control Registers
Each Port has its own control register, known as PAC~PHC, which controls the input/output
configuration. With this control register, each I/O pin with or without pull-high resistors can be
reconfigured dynamically under software control. 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.

Table of Contents

Related product manuals