BS2824 Holtek Semiconductor Inc., BS2824 Datasheet - Page 14

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
Program Counter
Stack
The requirement for this extra cycle should be taken into account by programmers in timing
sensitive applications.
During program execution, the Program Counter is used to keep track of the address of the next
instruction to be executed. It is automatically incremented by one each time an instruction is
executed except for instructions, such as JMP or CALL that demand a jump to a
non-consecutive Program Memory address. Note that the Program Counter width varies with the
Program Memory capacity depending upon which device is selected. However, it must be noted that
only the lower 8 bits, known as the Program Counter Low Register, are directly addressable by user.
When executing instructions requiring jumps to non-consecutive addresses such as a jump
instruction, a subroutine call, interrupt or reset, etc., the microcontroller manages program control
by loading the required address into the Program Counter. For conditional skip instructions, once the
condition has been met, the next instruction, which has already been fetched during the present
instruction execution, is discarded and a dummy cycle takes its place while the correct instruction is
obtained.
The lower byte of the Program Counter, known as the Program Counter Low register or PCL, is
available for program control and is a readable and writeable register. By transferring data directly
into this register, a short program jump can be executed directly, however, as only this low byte is
available for manipulation, the jumps are limited to the present page of memory, that is 256
locations. When such program jumps are executed it should also be noted that a dummy cycle will be
inserted.
The lower byte of the Program Counter is fully accessible under program control. Manipulating the
PCL might cause program branching, so an extra cycle is needed to pre-fetch. Further information
on the PCL register can be found in the Special Function Register section.
This is a special part of the memory which is used to save the contents of the Program Counter only.
The stack is neither part of the Data or Program Memory space, and is neither readable nor writeable.
The activated level is indexed by the Stack Pointer, SP, and is neither readable nor writeable. At a
subroutine call or interrupt acknowledge signal, the contents of the Program Counter are pushed
onto the stack. At the end of a subroutine or an interrupt routine, signaled by a return instruction,
RET or RETI, the Program Counter is restored to its previous value from the stack. After a device
reset, the Stack Pointer will point to the top of the stack.
BS2824, BS2868
BS2854
Device
BS2824, BS2854
BS2868
Device
Capacity
4
6
Program Counter High Byte
14
PC10~PC8
PC11~PC8
Program Counter
PCL Register
PCL7~PCL0
January 27, 2010

Related parts for BS2824