Contents Table of Contents Features ....................6 CPU Features ......................6 Peripheral Features ....................6 General Description ................7 Selection Table ..................7 Block Diagram ..................8 Pin assignment..................8 Pin Description ..................9 Pad Assignment for BS83B16G-3 ............11 Pad Coordinates for BS83B16G-3............11 Absolute Maximum Ratings .............12 D.C. Characteristics ................12 A.C.
Page 3
Contents Accumulator - ACC ....................29 Program Counter Low Register - PCL..............29 Look-up Table Registers - TBLP, TBHP, TBLH.............29 Status Register - STATUS ...................30 EEPROM Data Memory ..............31 EEPROM Data Memory Structure ................31 Reading Data from the EEPROM .................34 Writing Data to the EEPROM ................34 Write Protection ....................34 EEPROM Interrupt ....................34 Programming Considerations ................35...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Note that the BS83B16G-3/BS83C24-3 devices, although mentioned in this datasheet, have already been phased out and are presently no longer available. Features CPU Features Operating Voltage: · = 8MHz: V ~5.5V = 12MHz: 2.7V~5.5V = 16MHz: 4.5V~5.5V...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU General Description These devices are a series of Flash Memory type 8-bit high performance RISC architecture microcontrollers with fully integrated touch key functions. With all touch key functions provided internally and with the convenience of Flash Memory multi-programming features, this device range has all the features to offer designers a reliable and easy means of implementing Touch Keyes within their products applications.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Block Diagram . l a s h / E E P R O M W a t c h d o g L o w V o l t a g e P r o g r a m m i n g...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Pin Description The function of each pin is listed in the following table, however the details behind how each pin is configured is contained in other sections of the datasheet. BS83B08-3/B12-3/B16-3/B16G-3 Pin Name Function...
Page 10
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU BS83C24-3 Pin Name Function Description PAWU General purpose I/O. Register enabled pull-up and CMOS PAPU wake-up. PA0/SDI/SDA SIMC0 SPI data input ¾ SIMC0 NMOS I C data PAWU General purpose I/O. Register enabled pull-up and...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Pad Assignment for BS83B16G-3 1 0 1 1 1 2 1 3 Pad Coordinates for BS83B16G-3 Pad No. Pad Name Pad No. Pad Name DUMMY -1361.480 677.500 Dummy 1007.340 677.500 Align1 -1379.250 -557.780 Dummy 927.340...
=12MHz, WDT enable ¾ No load, f =16MHz, ¾ WDT enable ¾ Operating Current (LIRC), (f No load, f =32kHz, for BS83B08-3/B12-3/B16-3 WDT enable ¾ ¾ Operating Current (LIRC), (f No load, f =32kHz, for BS83C24-3 WDT enable ¾ ¾...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Ta=25°C Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions LVR Voltage Level LVR Enable 2.55 ¾ =9mA ¾ ¾ Output Low Voltage I/O Port =20mA ¾ ¾ =-3.2mA ¾ ¾ Output High Voltage I/O Port =-7.4mA...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Oscillator Temperature/Frequency Characteristics The following characteristic graphics depicts typical oscillator behavior. The data presented here is a statistical summary of data gathered on units from different lots over a period of time. This is for information only and the figures were not tested during manufacturing.
8-Bit Touch Key Flash MCU System Architecture A key factor in the high-performance features of the Holtek range of microcontroller is attributed to their internal system architecture. The range of devices take advantage of the usual features found within RISC microcontroller providing increased speed of operation and enhanced performance. The...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU For instructions involving branches, such as jump or call instructions, two machine cycles are required to complete instruction execution. An extra cycle is required as the program takes one cycle to first obtain the actual jump or call address and then another cycle to actually execute the branch. The requirement for this extra cycle should be taken into account by programmers in timing sensitive applications.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU If the stack is overflow, the first Program Counter save in the stack will be lost. Device Stack Levels P r o g r a m C o u n t e r BS83B08-3...
Note: PC11~PC8: Current Program Counter bits @7~@0: Table Pointer TBLP bits For the BS83B08-3, BS83B12-3 and BS83B16-3/BS83B16G-3, the Table address location is 11 bits, i.e. from b10~b0. For the BS83C24-3, the Table address location is 12 bits, i.e. from b11~b0 Rev.
Page 22
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Table Program Example The following example shows how the table pointer and table data is defined and retrieved from the microcontroller. This example uses raw table data located in the Program Memory which is stored there using the ORG statement.
The provision of Flash type Program Memory provides the user with a means of convenient and easy upgrades and modifications to their programs on the same device. As an additional convenience, Holtek has provided a means of programming the microcontroller in-circuit using a 5-pin interface. This provides manufacturers with the possibility of manufacturing their circuit boards complete with a programmed or un-programmed microcontroller, and then programming or upgrading the program at a later stage.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU RAM Data Memory The Data Memory is a volatile area of 8-bit wide RAM internal memory and is the location where temporary information is stored. Structure Divided into two sections, the first of these is an area of RAM, known as the Special Function Data Memory.
Page 25
T K M 0 C 3 5 F H U n u s e d Special Purpose Data Memory - BS83B08-3/BS83B12-3 Note: The ²Reserved² bytes shown in the table must not be modified by the user. Rev. 1.50 April 28, 2020...
Page 26
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU B S 8 3 B 1 6 - 3 B a n k 0 , B a n k 1 B a n k 0 B a n k 1 0 0 H I A R 0...
Page 27
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU B S 8 3 C 2 4 - 3 B a n k 0 , 1 , 2 , 3 B a n k 0 , 2 , 3 B a n k 1...
For this series of devices, the Data Memory is divided into several banks. Selecting the required Data Memory area is achieved using the Bank Pointer. In the BS83B08-3, BS83B12-3, BS83B16-3 and BS83B16G-3, the data memory is divided into two banks .The Bit 0 is used to select Data Memory Banks 0~1.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Status Register - STATUS 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.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Bit 1 AC: Auxiliary flag 0: no auxiliary carry 1: an operation results in a carry out of the low nibbles in addition, or no borrow from the high nibble into the low nibble in subtraction...
Page 32
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU BS83B08-3/B12-3/B16-3/B16G-3 EEPROM Register List · Name ¾ ¾ WREN RDEN ¾ ¾ ¾ ¾ EEA Register · Name ¾ ¾ ¾ ¾ ¾ ¾ ²x² unknown Bit 7~6 unimplemented, read as ²0² Bit 5~0...
Page 33
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU EEC Register Name WREN RDEN ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ Bit 7~4 unimplemented, read as ²0² Bit 3 WREN: data EEPROM write enable 0: disable 1: enable This is the Data EEPROM Write Enable Bit which must be set high before Data EEPROM write operations are carried out.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Reading Data from the EEPROM To read data from the EEPROM, the read enable bit, RDEN, in the EEC register must first be set high to enable the read function. The EEPROM address of the data to be read must then be placed in the EEA register.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Programming Considerations Care must be taken that data is not inadvertently written to the EEPROM. Protection can be enhanced by ensuring that the Write Enable bit is normally cleared to zero when not writing. Also the Bank Pointer could be normally cleared to zero as this would inhibit access to Bank 1 where the EEPROM control register exist.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Oscillator Various oscillator options offer the user a wide range of functions according to their various application requirements. The flexible features of the oscillator functions ensure that the best optimisation can be achieved in terms of speed and power saving. Oscillator selections and operation are selected through a combination of configuration options and registers.
As Holtek has provided these devices with both high and low speed clock sources and the means to switch between them dynamically, the user can optimise the operation of their microcontroller to achieve the best performance/power ratio.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Control Register A single register, SMOD, is used for overall control of the internal clocks within the device. SMOD Register Name CKS2 CKS1 CKS0 IDLEN HLCLK Bit 7~5 CKS2~CKS0: The system clock selection when HLCLK is ²0²...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU System Operation Modes There are five different modes of operation for the microcontroller, each one with its own special characteristics and which can be chosen according to the specific performance and power requirements of the application. There are two modes allowing normal operation of the microcontroller, the NORMAL Mode and SLOW Mode.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU N O R M A L M o d e S L O W M o d e C K S 2 ~ C K S 0 = 0 0 x B & C K S 2 ~ C K S 0 ¹ 0 0 0 B , 0 0 1 B...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Entering the IDLE0 Mode There is only one way for the device to enter the IDLE0 Mode and that is to execute the ²HALT² instruction in the application program with the IDLEN bit in SMOD register equal to ²1² and the FSYSON bit in WDTC register equal to ²0².
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Wake-up After the system enters the SLEEP or IDLE Mode, it can be woken up from one of various sources listed as follows: An external reset · An external falling edge on Port A ·...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Watchdog Timer The Watchdog Timer is provided to prevent program malfunctions or sequences from jumping to unknown locations, due to certain uncontrollable external events such as electrical noise. Watchdog Timer Clock Source The Watchdog Timer clock source is provided by the internal low speed oscillator, f .
Page 46
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Under normal program operation, a Watchdog Timer time-out will initialise a device reset and set the status bit TO. However, if the system is in the SLEEP or IDLE Mode, when a Watchdog Timer time-out occurs, the TO bit in the status register will be set and only the Program Counter and Stack Pointer will be reset.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Reset and Initialisation A reset function is a fundamental part of any microcontroller ensuring that the device can be set to some predetermined condition irrespective of outside parameters. The most important reset condition is after power is first applied to the microcontroller. In this case, internal circuitry will ensure that the microcontroller, after a short delay, will be in a well defined state and ready to execute the first program instruction.
Page 48
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU RES Pin Although the microcontroller has an internal RC reset function, if the VDD power supply rise time is not fast enough or does not stabilise quickly at power-on, the internal reset function may be incapable of providing proper reset operation.
Page 49
¾ ¾ ¾ ¾ ²x² unknown Bit 7 RESBF: Reset Pin reset flag -- BS83B08-3/B12-3/B16-3 0: no hardware reset occurred 1: hardware reset occured, this bit is cleared to zero by software. Bit 6 unimplemented, read as ²0² Bits 5,4...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Watchdog Time-out Reset during SLEEP or IDLE Mode The Watchdog time-out Reset during SLEEP or IDLE Mode is a little different from other kinds of reset. Most of the conditions remain unchanged except that the Program Counter and the Stack Pointer will be cleared to ²0²...
Page 51
The following table describes how each type of reset affects each of the microcontroller internal registers. Note that where more than one package type exists the table will reflect the situation for the larger package type. BS83B08-3 Register Reset RES Reset...
Page 53
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU BS83B12-3 Register Reset RES Reset RES Reset WDT Time-out WDT Time-out Register (Power-on) (Normal Operation) (HALT) (Normal Operation) (IDLE or SLEEP) x x x x x x x x u u u u u u u u...
Page 55
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU BS83B16-3/BS83B16G-3 Register Reset RES Reset RES Reset WDT Time-out WDT Time-out Register (Power-on) (Normal Operation) (HALT) (Normal Operation) (IDLE or SLEEP) x x x x x x x x u u u u u u u u...
Page 57
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU BS83C24-3 Register Reset WDT Time-out WDT Time-out Register (Power-on) (Normal Operation) (HALT) * IAR0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 u u u u u u u u...
Page 58
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Reset WDT Time-out WDT Time-out Register (Power-on) (Normal Operation) (HALT) * SIMD x x x x x x x x x x x x x x x x u u u u u u u u...
Page 59
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Reset WDT Time-out WDT Time-out Register (Power-on) (Normal Operation) (HALT) * TKM4C0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 u u u u u u u u...
8-Bit Touch Key Flash MCU Input/Output Ports Holtek microcontrollers offer considerable flexibility on their I/O ports. With the input or output designation of every pin fully under user program control, pull-high selections for all ports and wake-up selections on certain pins, the user is provided with an I/O structure to meet the needs of a wide range of application possibilities.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU 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 configured as an input have the capability of being connected to an internal pull-high resistor. These pull-high resistors are selected using the register PAPU~PFPU, and are implemented using weak PMOS transistors.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU I/O Port Control Register The I/O port has its own control register known as PAC~PFC, to control the input/output configuration. With this control register, each CMOS output or input can be reconfigured dynamically under software control. Each pin of the I/O port is directly mapped to a bit in its associated port control register.
Page 65
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU PCC Register BS83B12-3 · Name ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ Bit 7~4 unimplemented, read as ²0² Bit 3~0 PCC: Port C bit 3~bit 0 input/output control 0: output...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Timer/Event Counters The provision of timers form an important part of any microcontroller, giving the designer a means of carrying out time related functions. The devices contain one 8-bit and one 16-bit timers. The 8-bit timer is a general timer.
Timer Control Register - TMRC, TMR0C, TMR1C The flexible features of the Holtek microcontroller Timer/Event Counters enable them to operate in three different modes, the options of which are determined by the contents of their respective control register.
Page 69
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU The 16-bit timer, TMR1, can operate in three different modes. To choose which of the three modes the timer is to operate in, either in the timer mode, the event counting mode or the pulse width capture mode, bits 7 and 6 of the Timer Control Register, which are known as the bit pair T1M1/T1M0, must be set to the required logic levels.
Page 71
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Bit7 Bit6 Control Register Operating Mode Select Bits for the Timer Mode In this mode the internal clock is used as the timer clock. The timer input clock source is either the /4 or the LIRC oscillator. The timer-on bit, T1ON must be set high to enable the timer to run. Each time an internal clock high to low transition occurs, the timer increments by one;...
Page 72
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Pulse Width Capture Mode In this mode, the Timer/Event Counter can be utilised to measure the width of external pulses applied to the external timer pin. To operate in this mode, the Operating Mode Select bit pair, T1M1/T1M0, in the Timer Control Register must be set to the correct value as shown.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Prescaler Bits T0PSC0~T0PSC2 of the TMR0C or TPSC0~TPSC2 of the TMRC register can be used to define a division ratio for the internal clock source of the 8-bit Timer/Event Counter enabling longer time out periods to be setup.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU the next timer clock pulse arrives. As a result, there may be small differences in measured values requiring programmers to take this into account during programming. The same applies if the timer is configured to be in the event counting mode, which again is an external event and not synchronised with the internal system or timer clock.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Touch Key Function Each device provides multiple touch key functions. The touch key function is fully integrated and requires no external components, allowing touch key functions to be implemented by the simple manipulation of internal registers.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Touch Key Register Definition Each touch key module, which contains four touch key functions, has its own suite of six registers. The following table shows the register set for each touch key module. The Mn within the register name refers to the Touch Key module number and has a range of M0 to M5.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Touch Key Interrupt Each touch key module, which consists of four touch keys, has two independent interrupts, one for each of the, 16-bit C/F counter and time slot counter. The time slot counter interrupt has its own interrupt vector while the 16-bit C/F counter interrupts are contained within the Multi-function interrupts and therefore do not have their own vector.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Serial Interface Module - SIM These devices contain a Serial Interface Module, which includes both the four line SPI interface or the two line I C interface types, to allow an easy method of communication with external peripheral hardware.
Page 82
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU D a t a B u s S I M D S D I P i n T x / R x S h i f t R e g i s t e r...
Page 83
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU There are also two control registers for the SPI interface, SIMC0 and SIMC2. Note that the SIMC2 register also has the name SIMA which is used by the I C function. The SIMC1 register is not used by the SPI function, only by the I C function.
Page 84
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU SIMC2 Register Name CKPOLB CKEG CSEN WCOL Bit 7~6 Undefined bit This bit can be read or written by user software program. Bit 5 CKPOLB: Determines the base condition of the clock line 0: the SCK line will be high when the clock is inactive...
Page 85
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU SPI Communication After the SPI interface is enabled by setting the SIMEN bit high, then in the Master Mode, when data is written to the SIMD register, transmission/reception will begin simultaneously. When the data transfer is complete, the TRF flag will be set automatically, but must be cleared using the application program.
Page 86
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU S C S S C K ( C K P O L B = 1 ) S C K ( C K P O L B = 0 ) S D O D 7 / D 0...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU C Interface The I C interface is used to communicate with external peripheral devices such as sensors, EEPROM memory etc. Originally developed by Philips, it is a two line low speed serial interface for synchronous serial data transfer.
Page 88
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU The debounce time of the I C interface uses the system clock to in effect add a debounce time to the external clock to reduce the possibility of glitches on the clock line causing erroneous operation. The debounce time, is 2 system clocks.
Page 89
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU SIMC0 Register Name SIM2 SIM1 SIM0 SIMEN ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ Bit 7~5 SIM2, SIM1, SIM0: SIM Operating Mode Control 000: SPI master mode; SPI clock is f 001: SPI master mode;...
Page 90
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU SIMC1 Register Name HAAS TXAK IAMWU RXAK Bit 7 HCF: I C Bus data transfer completion flag 0: Data is being transferred 1: Completion of an 8-bit data transfer The HCF flag is the data transfer flag. This flag will be zero when data is being transferred.
Page 91
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU I2CTOC Register Name I2CTOEN I2CTOF I2CTOS5 I2CTOS4 I2CTOS3 I2CTOS2 I2CTOS1 I2CTOS0 Bit 7 I2CTOEN: I C Time-out Control 0: disable 1: enable Bit 6 I2CTOF: Time-out flag 0: no time-out 1: time-out occurred Bit 5~0...
Page 92
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU C Bus Communication Communication on the I C bus requires four separate steps, a START signal, a slave device address transmission, a data transmission and finally a STOP signal. When a START signal is placed on the I bus, all devices on the bus will receive this signal and be notified of the imminent arrival of data on the bus.
Page 93
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU S t a r t S l a v e A d d r e s s S R W A C K S C L S D A D a t a A C K...
Page 94
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU C Bus Slave Address Acknowledge Signal After the master has transmitted a calling address, any slave device on the I C bus, whose own internal address matches the calling address, must generate an acknowledge signal. The acknowledge signal will inform the master that a slave device has accepted its calling address.
Page 95
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU C Time-out Control In order to reduce the problem of I C lockup due to reception of erroneous clock sources, clock, a time-out function is provided. If the clock source to the I C is not received then after a fixed time period, the I C circuitry and registers will be reset.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Interrupts Interrupts are an important part of any microcontroller system. When an external event or an internal function such as a Touch Action or Timer/Event Counter overflow requires microcontroller attention, their corresponding interrupt will enforce a temporary suspension of the main program allowing the microcontroller to direct attention to their respective needs.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU MFI2 Register -- BS83C24-3 Name M516CTF M416CTF M516CTE M416CTE Bit 7 M516CTF: Touch key module 5 16-bit counter interrupt request flag 0: no request 1: interrupt request Bit 6 D6: Reserved bit, must not be modified.
Page 105
E M I M 3 1 6 C T F T K M 3 F T K M 3 E 2 C H M 3 1 6 C T E L o w Interrupt Structure -- BS83B08-3/B12-3/B16-3/B16G-3 Rev. 1.50 April 28, 2020...
Page 106
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU E M I a u t o d i s a b l e d i n I S R L e g e n d P r i o r i t y...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU External Interrupt The external interrupt is controlled by signal transitions on the INT pin. An external interrupt request will take place when the external interrupt request flag, INTF, is set, which will occur when a transition, whose type is chosen by the edge select bits, appears on the external interrupt pin.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Time Base Interrupts The function of the Time Base Interrupt is to provide regular time signal in the form of an internal interrupt. It is controlled by the overflow signal from its respective timer function. When this happens its respective interrupt request flag, TBF, will be set.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Timer/Event Counter Interrupt For a Timer/Event Counter interrupt to occur, the global interrupt enable bit, EMI, and the corresponding timer interrupt enable bit, TE, T0E or T1E, must first be set. An actual Timer/Event Counter interrupt will take place when the Timer/Event Counter request flag, TF, T0F or T1F, is set, a situation that will occur when the relevant Timer/Event Counter overflows.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Interrupt Wake-up Function Each of the interrupt functions has the capability of waking up the microcontroller when in the SLEEP or IDLE Mode. A wake-up is generated when an interrupt request flag changes from low to high and is independent of whether the interrupt is enabled or not.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Application Circuits 0 . 0 1 m F * * V D D R e s e t 1 0 k W ~ C i r c u i t 1 0 0 k W 1 N 4 1 4 8 * 0 .
In the case of Holtek microcontrollers, a comprehensive and flexible set of over 60 instructions is provided to enable programmers to implement their application with the minimum of programming overheads.
Data Memory. To overcome this problem, Holtek microcontrollers allow an area of Program Memory to be setup as a table where data can be directly stored. A set of easy to use instructions provides the means by which this fixed data can be referenced and retrieved from the Program Memory.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Instruction Set Summary The following table depicts a summary of the instruction set categorised according to function and can be consulted as a basic instruction reference using the following listed conventions. Table conventions: x: Bits immediate data...
Page 115
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Mnemonic Description Cycles Flag Affected Bit Operation Note CLR [m].i Clear bit of Data Memory None Note SET [m].i Set bit of Data Memory None Branch JMP addr Jump unconditionally None Note SZ [m]...
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Instruction Definition Add Data Memory to ACC with Carry ADC A,[m] Description The contents of the specified Data Memory, Accumulator and the carry flag are added. The result is stored in the Accumulator. Operation ACC ¬...
Page 117
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Subroutine call CALL addr Description Unconditionally calls a subroutine at the specified address. The Program Counter then increments by 1 to obtain the address of the next instruction which is then pushed onto the stack. The specified address is then loaded and the program continues execution from this new address.
Page 118
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Complement Data Memory CPL [m] Description Each bit of the specified Data Memory is logically complemented (1¢s complement). Bits which previously contained a 1 are changed to 0 and vice versa. Operation [m] ¬ [m]...
Page 119
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Increment Data Memory INC [m] Description Data in the specified Data Memory is incremented by 1. Operation [m] ¬ [m] + 1 Affected flag(s) Increment Data Memory with result in ACC INCA [m] Description Data in the specified Data Memory is incremented by 1.
Page 120
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Logical OR immediate data to ACC OR A,x Description Data in the Accumulator and the specified immediate data perform a bitwise logical OR operation. The result is stored in the Accumulator. Operation ACC ¬ ACC ²OR² x...
Page 121
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Rotate Data Memory left through Carry RLC [m] Description The contents of the specified Data Memory and the carry flag are rotated left by 1 bit. Bit 7 replaces the Carry bit and the original carry flag is rotated into bit 0.
Page 122
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Subtract Data Memory from ACC with Carry SBC A,[m] Description The contents of the specified Data Memory and the complement of the carry flag are subtracted from the Accumulator. The result is stored in the Accumulator. Note that if the result of subtraction is negative, the C flag will be cleared to 0, otherwise if the result is positive or zero, the C flag will be set to 1.
Page 123
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Skip if increment Data Memory is 0 SIZ [m] Description The contents of the specified Data Memory are first incremented by 1. If the result is 0, the following instruction is skipped. As this requires the insertion of a dummy instruc- tion while the next instruction is fetched, it is a two cycle instruction.
Page 124
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Swap nibbles of Data Memory SWAP [m] Description The low-order and high-order nibbles of the specified Data Memory are interchanged. Operation [m].3~[m].0 « [m].7 ~ [m].4 Affected flag(s) None Swap nibbles of Data Memory with result in ACC...
Page 125
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Read table (last page) to TBLH and Data Memory TABRDL [m] Description The low byte of the program code (last page) addressed by the table pointer (TBLP) is moved to the specified Data Memory and the high byte moved to TBLH.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3 8-Bit Touch Key Flash MCU Package Information Note that the package information provided here is for consultation purposes only. As this information may be updated at regular intervals users are reminded to consult the Holtek website for the latest version of the Package/Carton Information.
Page 136
Holtek¢s products are not authorized for use as critical components in life support devices or systems. Holtek reserves the right to alter its products without prior notification.
Need help?
Do you have a question about the BS83B08-3 and is the answer not in the manual?
Questions and answers