BS2824 Holtek Semiconductor Inc., BS2824 Datasheet - Page 22

no-image

BS2824

Manufacturer Part Number
BS2824
Description
Touch Key Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
BS2824/BS2854/BS2868
Touch Key MCU
Rev. 1.00
Bank Pointer - BP
Status Register - STATUS
Input/Output Ports and Control Registers
BP Register
In the BS2868, the Data Memory is divided into two Banks, known as Bank 0 and Bank 1. A Bank
Pointer, which is bit 0 of the Bank Pointer register is used to select the required Data Memory bank.
Only data in Bank 0 can be directly addressed as data in Bank 1 must be indirectly addressed using
Memory Pointer MP1 and Indirect Addressing Register IAR1. Using Memory Pointer MP0 and
Indirect Addressing Register IAR0 will always access data from Bank 0, irrespective of the value of
the Bank Pointer. Memory Pointer MP1 and Indirect Addressing Register IAR1 can indirectly
address data in either Bank 0 or Bank 1 depending upon the value of the Bank Pointer.
The Data Memory is initialised to Bank 0 after a reset, except for the WDT time-out reset in the
Idle/Sleep Mode, in which case, the Data Memory bank remains unaffected. It should be noted that
Special Function Data Memory is not affected by the bank selection, which means that the Special
Function Registers can be accessed from within either Bank 0 or Bank 1. Directly addressing the Data
Memory will always result in Bank 0 being accessed irrespective of the value of the Bank Pointer.
This 8-bit register contains the zero flag (Z), carry flag (C), auxiliary carry flag (AC), overflow flag
(OV), power down flag (PDF), and watchdog time-out flag (TO). These arithmetic/logical operation
and system management flags are used to record the status and operation of the microcontroller.
With the exception of the TO and PDF flags, bits in the status register can be altered by instructions
like most other registers. Any data written into the status register will not change the TO or PDF flag.
In addition, operations related to the status register may give different results due to the different
instruction operations. The TO flag can be affected only by a system power-up, a WDT time-out or
by executing the CLR WDT or HALT instruction. The PDF flag is affected only by executing
the HALT or CLR WDT instruction or during a system power-up.
The Z, OV, AC and C flags generally reflect the status of the latest operations.
In addition, on entering an interrupt sequence or executing a subroutine call, the status register will
not be pushed onto the stack automatically. If the contents of the status registers are important and if
the interrupt routine can change the status register, precautions must be taken to correctly save it.
Note that bits 0~3 of the STATUS register are both readable and writeable bits.
Within the area of Special Function Registers, the port PA, PB, PC, PD, PF etc data I/O registers and
their associated control register PAC, PBC, PCC, PDC, PFC etc play a prominent role. These
registers are mapped to specific addresses within the Data Memory as shown in the Data Memory
table. The data I/O registers, are used to transfer the appropriate output or input data on the port. The
control registers specifies which pins of the port are set as inputs and which are set as outputs. To
setup a pin as an input, the corresponding bit of the control register must be set high, for an output it
must be set low. During program initialisation, it is important to first setup the control registers to
Bit 7~1 : unimplemented, read as 0
Bit 0
Name
POR
R/W
Bit
DMBP0: Data Memory bank point
0: Bank 0
1: Bank 1
7
6
5
22
4
3
2
1
January 27, 2010
DMBP0
R/W
0
0

Related parts for BS2824