BS2824 Holtek Semiconductor Inc., BS2824 Datasheet - Page 49

no-image

BS2824

Manufacturer Part Number
BS2824
Description
Touch Key Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
Rev. 1.00
Pin Remapping Configuration - BS2868
I/O Pin Structures
Programming Considerations
The pin remapping function enables the function pins INT, TC0 and PFD to be located on different
port pins. It is important not to confuse the Pin Remapping function with the Pin-shared function,
these two functions have no interdependence.
The PCFG bit in the CTRL0 register allows the three function pins INT, TC0 and PFD to be
remapped to different port pins. After power up, this bit will be reset to zero, which will define the
default port pins to which these three functions will be mapped. Changing this bit will move the
functions to other port pins.
Examination of the pin names on the package diagrams will reveal that some pin function names are
repeated, this indicates a function pin that can be remapped to other port pins. If the pin name is
bracketed then this indicates its alternative location. Pin names without brackets indicates its default
location which is the condition after Power-on.
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.
Within the user program, one of the first things to consider is port initialisation. After a reset, the I/O
data register and I/O 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 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
register is first programmed. Selecting which pins are inputs 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 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.
Pins PA0 to PA7 each have a wake-up functions, selected via the PAWK register. When the device is
in the Idle/Sleep Mode, various methods are available to wake the device up. One of these is a high
to low transition of any of the these pins. Single or multiple pins on Port A can be setup to have this
function.
Pin Mapping
PCFG Bit
Read Modify Write Timing
49
PCFG Bit Status
BS2824/BS2854/BS2868
Pin Remapping
PFD/PA1
TC0/PA2
INT/PA3
0
Touch Key MCU
[TC0]/PB4
[PFD]/PB3
[INT]/PB5
1
January 27, 2010

Related parts for BS2824