BS2824 Holtek Semiconductor Inc., BS2824 Datasheet

no-image

BS2824

Manufacturer Part Number
BS2824
Description
Touch Key Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
Features
Rev. 1.00
Microcontroller Features
Touch Key Features
Operating voltage:
f
f
f
Up to 0.33 s instruction cycle with 12MHz system clock at V
Multi Operational Modes - Normal/Slow/Idle/Sleep and wake-up functions to reduce power
consumption
Oscillator types:
External high freuency Crystal -- HXT
External RC -- ERC
Internal RC -- HIRC
External low frequency crystal -- LXT
Fully integrated internal 4MHz, 8MHz and 12MHz oscillator requires no external components
Up to two 8-bit Timer/Event Counters
Two channel 8-bit PWM for BS2868
Up to 31 bidirectional I/O lines
Watchdog Timer function
Software controlled LCD driver
Low voltage reset function
Programmable Frequency Divider
Time-Base function
All instructions executed in one or two instruction cycles
Table read instructions
63 powerful instructions
Up to 6-level subroutine nesting
Bit manipulation instruction
Wide range of available package types
Single Line Communication Serial Interface
Four or Eight Touch Key Inputs
Only requires one external reference capacitor
Auto-calibration
Reliable Touch Detections
High Power Supply Rejection
SYS
SYS
SYS
= 4MHz: 2.2V~5.5V
= 8MHz: 3.0V~5.5V
= 12MHz: 4.5V~5.5V
1
BS2824/BS2854/BS2868
Touch Key MCU
DD
= 5V
January 27, 2010

Related parts for BS2824

BS2824 Summary of contents

Page 1

... Bit manipulation instruction Wide range of available package types Touch Key Features Single Line Communication Serial Interface Four or Eight Touch Key Inputs Only requires one external reference capacitor Auto-calibration Reliable Touch Detections High Power Supply Rejection Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU = January 27, 2010 ...

Page 2

... The special features of the BS2824/BS2854/BS2868 devices lie in their touch key functions which can detect human body contact using external touch pads. The high level of device integration enable full touch key applications to be implemented with a minimum number of external components ...

Page 3

... Pin Assignment Note: Bracketed pin names indicate non-default pinout remapping locations. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU 3 January 27, 2010 ...

Page 4

... BS2824/BS2854/BS2868 Touch Key MCU Pin Description BS2824 Pin Name Function OPT PAPU PA0 PA0 PAWK PAPU PA1 PAWK PA1/PFD PFD CTRL0 PAPU PA2 PAWK PA2/TC0 TC0 PAPU PA3 PAWK PA3/INT INT PAPU PA4 PAWK PA4/TC1 TC1 PAPU PA5 PAWK PA5/OSC2 OSC2 ...

Page 5

... PDPU KETY0~KEY3 Keyn SCD SCD CREF Cref VDD VDD VSS VSS Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU I/T O/T Description ST CMOS General purpose I/O. Register enabled pull-up and wake-up. CMOS PFD output ST CMOS General purpose I/O. Register enabled pull-up and wake-up. CMOS PFD output ST CMOS General purpose I/O. Register enabled pull-up and wake-up. ...

Page 6

... BS2824/BS2854/BS2868 Touch Key MCU I/T: Input type Note: O/T: Output type OPT: Optional by configuration option (CO) or register option CO: Configuration Option PWR: Power ST: Schmitt Trigger input CMOS: CMOS output NMOS: NMOS output SP: Special input SCOM: Software controlled LCD COM HXT: High frequency crystal oscillator ...

Page 7

... QFP package. These 11 pads default to an input state, the designer should set the register PCPU and PEPU to pull high options. In this way, these 11 internal pads can be pulled up in order to prevent input pin floating power consumption Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU I/T O/T Description ST CMOS General purpose I/O ...

Page 8

... BS2824/BS2854/BS2868 Touch Key MCU Absolute Maximum Ratings Supply Voltage ...............................................................................................V Storage Temperature ................................................................................................. 125 C Input Voltage .................................................................................................V Operating Temperature................................................................................................ Total...................................................................................................................................100mA OL I Total ................................................................................................................................ 100mA OH Total Power Dissipation .........................................................................................................500mW Note: These are stress ratings only. Stresses exceeding the range specified under Absolute Maximum Ratings may cause substantial damage to the device ...

Page 9

... I PA7 Sink Current OL2 R Pull-high Resistance PH I SCOM Operating Current SCOM Voltage for LCD COM SCOM DD Note: The standby current ( and I STB1 STB3 Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Test Conditions Min. V Conditions DD 0.7V 0 0.9V VLVR = 4.2V 3.98 VLVR = 3.15V 2.98 VLVR = 2.1V 1. =0.1V OL ...

Page 10

... BS2824/BS2854/BS2868 Touch Key MCU A.C. Characteristics Symbol Parameter f System Clock SYS System Clock f HIRC (HIRC) System Clock f ERC (ERC) f System Clock (LXT) LXT Timer Input Frequency f TIMER (TCn) Rev. 1.00 Test Conditions Min. V Conditions DD 2.2V~5.5V 32 3.0V~5.5V 32 4.5V~5.5V 32 3V/5V Ta= 3V/5V Ta= Ta= 3V/5V Ta=0~ 3V/5V Ta=0~ Ta=0~ ...

Page 11

... Key Response Time in Normal Mode KRT1 f Key Response Time in Standby Mode KRT2 t Maximum Key Hold Time KH t Auto-Calibration Period - Normal Mode CAL1 t Auto-Calibration Period - Standby Mode CAL2 Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Test Conditions Min. V Conditions 6.5 1 For HXT/LXT For ERC/IRC (By configuration option ...

Page 12

... BS2824/BS2854/BS2868 Touch Key MCU Power-on Reset Characteristics Symbol Parameter VDD Start Voltage to Ensure V POR Power-on Reset VDD raising rate to Ensure RR VDD Power-on Reset Minimum Time for VDD Stays at t POR V to Ensure Power-on Reset POR Rev. 1.00 Test Conditions Min. V Conditions DD 0.035 ...

Page 13

... For instructions involving branches, such as jump or call instructions, two instruction 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. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU System Clocking and Pipelining Instruction Fetching ...

Page 14

... 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. Device BS2854 BS2824, BS2868 Rev. 1.00 Program Counter Program Counter High Byte PC10~PC8 ...

Page 15

... The Program Memory has a capacity 15. The Program Memory is addressed by the Program Counter and also contains data, table information and interrupt entries. Table data, which can be setup in any location within the Program Memory, is addressed by separate table pointer registers. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Program Memory Structure 15 January 27, 2010 ...

Page 16

... TABRDL [ Note: PC11~PC8: Current Program Counter bits @7~@0: Table Pointer TBLP bits For the BS2824, BS2854, the Table address location is 11 bits, i.e. from b10~b0. For the BS2868, the Table address location is 12 bits, i.e. from b11~b0 Rev. 1.00 Device Capacity BS2824, BS2854 2K 15 ...

Page 17

... However, in situations where simultaneous use cannot be avoided, the interrupts should be disabled prior to the execution of any main routine table-read instructions. Note that all table related instructions require two instruction cycles to complete their operation. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU 17 January 27, 2010 ...

Page 18

... By using the SET [m].i and CLR [m].i instructions individual bits can be set or reset under program control giving the user a large range of flexibility for bit manipulation in the Data Memory. Rev. 1.00 Device Capacity Banks BS2824, BS2854 96 8 BS2868 0, 1 224 8 18 January 27, 2010 ...

Page 19

... MP1. Acting as a pair, IAR0 with MP0 and IAR1 with MP1 can together access data from the Data Memory. As the Indirect Addressing Registers are not physically implemented, reading the Indirect Addressing Registers indirectly will return a result of 00H and writing to the registers indirectly will result in no operation. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Data Memory Structure 19 January 27, 2010 ...

Page 20

... BS2824/BS2854/BS2868 Touch Key MCU Rev. 1.00 Special Purpose Data Memory 20 January 27, 2010 ...

Page 21

... PCL register will cause a jump to the specified Program Memory location, however, as the register is only 8-bit wide, only jumps within the current Program Memory page are permitted. When such operations are used, note that a dummy cycle will be inserted. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU data ; setup size of block ...

Page 22

... BS2824/BS2854/BS2868 Touch Key MCU Bank Pointer - BP 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 ...

Page 23

... Bit 0 C: Carry flag 0: no carry-out 1: an operation results in a carry during an addition operation borrow does not take place during a subtraction operation C is also affected by a rotate through carry instruction. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU PDF ...

Page 24

... These registers are used to provide control over various internal functions. Some of these include the PFD control, PWM control, certain system clock options, the LXT Oscillator low power control, external Interrupt edge trigger type, Watchdog Timer enable function, Time Base function division ratio, and the LXT oscillator enable control. CTRL0 Register BS2824 Bit 7 Name R/W ...

Page 25

... High speed - HIRC/ERC/HXT used as system clock 1: Low speed - LXT used as system clock, internal HIRC/ERC/HXT stopped. Note: If PWM0/1/2 output is selected by PWMC0/1/2 bit the clock source for timer0/2 , time base and PWM) TP Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU PFDCS PWMSEL PWMC1 PWMC0 ...

Page 26

... BS2824/BS2854/BS2868 Touch Key MCU CTRL1 Register Bit 7 Name INTEG1 R/W R/W POR 1 Bit 7, 6 INTEG1, INTEG0: External interrupt edge type 00: disable 01: rising edge trigger 10: falling edge trigger 11: dual edge trigger Bit 5, 4 TBSEL1, TBSEL0: Time base period selection 10 00: 2 (1/f 11 01: 2 (1/f 12 10: 2 (1/f 13 ...

Page 27

... There are five system oscillators. Three high speed oscillators and two low speed oscillators. The high speed oscillators are the external crystal/ceramic oscillator - HXT, the external - ERC, and the internal RC oscillator - HIRC. The two low speed oscillator are the external 32768Hz oscillator - LXT and the internal 13kHz (V Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Name Freq. Pins ...

Page 28

... BS2824/BS2854/BS2868 Touch Key MCU External Crystal/Resonator Oscillator - HXT The simple connection of a crystal across OSC1 and OSC2 will create the necessary phase shift and feedback for oscillation. However, for some crystals and most resonator types, to ensure oscillation and accurate frequency generation necessary to add two small value external capacitors, C1 and C2 ...

Page 29

... HIRC oscillator. For the BS2868 devices the LXT oscillator must be used together with either the HXT, ERC or HIRC register. 32768 Hz Crystal Recommended Capacitor Values Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Internal RC Oscillator - HIRC External LXT Oscillator - HXT LXT Oscillator C1 and C2 Values ...

Page 30

... BS2824/BS2854/BS2868 Touch Key MCU For the BS2868, a configuration option determines if the XT1/XT2 pins are used for the LXT oscilla- tor or as I/O pins. If the I/O option is selected then the XT1/XT2 pins can be used as normal I/O pins. If the LXT oscillator is selected then the 32kHz crystal should be connected to the XT1/ XT2 pins ...

Page 31

... BS2824, BS2854 For these devices, if the LXT oscillator is used then the internal RC oscillator, HIRC, must be used as the high frequency oscillator. If the HXT or the ERC oscillator is chosen as the high frequency system clock then the LXT oscillator cannot be used for sharing the same pins ...

Page 32

... BS2824/BS2854/BS2868 Touch Key MCU Operating Mode Control BS2824, BS2854 Operating Mode Normal Slow Sleep BS2868 Operating Mode Normal Slow Idle Sleep Mode Switching The devices are switched between one mode and another using a combination of the CLKMOD bit in the CTRL0 register and the HALT instruction. The CLKMOD bit chooses whether the system runs in either the Normal or Slow Mode by selecting the system clock to be sourced from either a high or low frequency oscillator ...

Page 33

... Wake-up After the microcontroller enters the Idle/Sleep Mode, it can be woken up from one of various sources listed as follows: An external reset An external falling edge on PA0 to PA7 A system interrupt A WDT overflow Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Interrupt Pin Wake-up Timer Pin Wake-up 33 January 27, 2010 ...

Page 34

... BS2824/BS2854/BS2868 Touch Key MCU If the system is woken external reset, the device will experience a full system reset, however, if the device is woken WDT overflow, a Watchdog Timer reset will be initiated. Although both of these wake-up methods will initiate a reset operation, the actual source of the wake-up can be determined by examining the TO and PDF flags ...

Page 35

... With auto-calibration, low standby current and a choice of wake-up features, this range of touch key devices provides a simple and effective means of implementing touch switches in a wide variety of applications. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Operating Flow 35 January 27, 2010 ...

Page 36

... BS2824/BS2854/BS2868 Touch Key MCU Operation Modes The touch keys have two modes of operation, the Standby Mode and the Normal Mode. After the device is powered up it will automatically enter the Standby Mode to conserve power. The devices can then be directly woken One-key Wake-up using Key0. However if the devices are setup by the microcontroller the Any Key Wake-up mode, they can be woken up by touching any key ...

Page 37

... This allows the MCU to synchronise itself for the data transfer. The touch switch circuitry will then transmit its key status, given as D0~Dn. For the BS2824 and BS2854 the data format is D0~D3. For the BS2868 the data format is D0~D7. ...

Page 38

... BS2824/BS2854/BS2868 Touch Key MCU SCD Pin Touch Key Status Request Maximum Key On Duration Time To minimise the possibility of unintentional switch detections, such as undesired objects covering the sense electrodes, the devices includes a Maximum Key-On duration time function. To implement this function the devices include an internal timer, which starts running after each switch detection ...

Page 39

... The Watchdog Timer clock can emanate from three different sources, selected by configuration option. These are LXT, f Idle/Sleep Mode the instruction clock is stopped, therefore if the configuration options have selected Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU CTRL1 Register WDT Function Disable ...

Page 40

... BS2824/BS2854/BS2868 Touch Key MCU the Watchdog Timer clock source, the Watchdog Timer will cease to function. For systems SYS that operate in noisy environments, using the LIRC or the LXT as the clock source is therefore the recommended choice. The division ratio of the prescaler is determined by bits 0, 1 and 2 of the WDTS register, known as WS0, WS1 and WS2 ...

Page 41

... VSS and the RES pin will provide a suitable external reset circuit. Any wiring connected to the RES pin should be kept as short as possible to minimise any stray noise interference. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU is invoked to provide an extra delay time after which the RSTD ...

Page 42

... BS2824/BS2854/BS2868 Touch Key MCU For applications that operate within an environment where more noise is present the Enhanced Reset Circuit shown is recommended. Note recommended that this component is added for added ESD protection ** It is recommended that this component is added in environments where power line noise ...

Page 43

... Program Counter Interrupts WDT Timer/Event Counter Prescaler Input/Output Ports Stack Pointer Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Note power-on delay, typical time=100ms RSTD RESET Conditions Power-on reset RES or LVR reset during Normal or Slow Mode operation WDT time-out reset during Normal or Slow Mode operation ...

Page 44

... BS2824/BS2854/BS2868 Touch Key MCU The different kinds of resets all affect the internal registers of the microcontroller in different ways. To ensure reliable continuation of normal program execution after a reset occurs important to know what condition the microcontroller is in after a particular reset occurs. The following table de- scribes how each type of reset affects each of the microcontroller internal registers ...

Page 45

... PWM0 PWM1 Note: - not implemented u means unchanged x means unknown Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU RES or LVR WDT Time-out Reset (Normal Operation ...

Page 46

... This function is especially suitable for applications that can be woken up via external switches. Note that pins PA0 to PA7 can be selected individually to have this wake-up feature using an internal register known as PAWK, located in the Data Memory. PAWK, PAC, PAPU, PBC, PBPU, PCC, PCPU, PDC, PDPU, PFC, PFPU Register BS2824 Register POR Name ...

Page 47

... PFC 03H PFPU 00H Unimplemented, read as 0 PAWKn: PA wake-up function enable 0: disable 1: enable PACn/PBCn/PCCn/PDCn/PECn/PFCn: I/O type selection 0: output 1: input PAPUn/PBPUn/PCPUn/PDPUn/PEPUn/PFPUn: Pull-high function enable 0: disable 1: enable Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Bit PAC6 PAC5 PAC4 PAC3 PAPU6 PAPU5 PAPU4 PAPU3 PBC5 ...

Page 48

... BS2824/BS2854/BS2868 Touch Key MCU I/O Port Control Registers Each Port has its own control register, known as PAC, PBC, PCC, PDC, PFC 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 ...

Page 49

... 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. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU PCFG Bit Status PCFG Bit 0 ...

Page 50

... BS2824/BS2854/BS2868 Touch Key MCU Rev. 1.00 Generic Input/Output Ports PA7 NMOS Input/Output Port PB Input/Output Port 50 January 27, 2010 ...

Page 51

... Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU 51 or the ...

Page 52

... BS2824/BS2854/BS2868 Touch Key MCU Clock Structure for Timer/PWM/Time Base 8-bit Timer/Event Counter 0 Structure 8-bit Timer/Event Counter 1 Structure Note: If PWM0/PWM1 is enabled, then f Rev. 1.00 comes from f (ignore T0S) TP SYS 52 January 27, 2010 ...

Page 53

... Timer internal clock= 000 001 010 011 100: f /16 TP 101: f /32 TP 110: f /64 TP 111: f /128 TP Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU T0M0 T0S T0ON T0EG R/W R/W R/W R which is provided for Timer 0, Timer 2, the T0PSC2 ...

Page 54

... BS2824/BS2854/BS2868 Touch Key MCU TMR1C Register Bit 7 Name T1M1 R/W R/W POR 0 Bit 7,6 T1M1, T1M0: Timer 1 Operation mode selection 00: no mode available 01: event counter mode 10: timer mode 11: pulse width capture mode Bit 5 T1S: timer clock source SYS 1: LXT oscillator Bit 4 T1ON: Timer/event counter counting enable ...

Page 55

... At this point the enable bit will be automatically reset to zero and the Timer/Event Counter will stop counting. If the Active Edge Select bit is high, the Timer/Event Counter will begin counting once a low to high transition has Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Bit7 Bit6 ...

Page 56

... BS2824/BS2854/BS2868 Touch Key MCU been received on the external timer pin and stop counting when the external timer pin returns to its original low level. As before, the enable bit will be automatically reset to zero and the Timer/Event Counter will stop counting important to note that in the pulse width capture Mode, the enable ...

Page 57

... Using this method of frequency generation, and if a crystal oscillator is used for the system clock, very precise values of frequency can be generated. BS2854 PFD Function - Complementary Outputs BS2824/BS2868 Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU PFD Function - Single Output PFD Function 57 January 27, 2010 ...

Page 58

... BS2824/BS2854/BS2868 Touch Key MCU I/O Interfacing The Timer/Event Counter, when configured to run in the event counter or pulse width capture mode, requires the use of an external timer pin for its operation. As this pin is a shared pin it must be configured correctly to ensure that it is setup for use as a Timer/Event Counter input pin. This is achieved by ensuring that the mode select bits in the Timer/Event Counter control register, select either the event counter or pulse width capture mode ...

Page 59

... When the Time Base time out, a Time Base interrupt signal will be generated. It should be noted that as the Time Base clock source is the same as the Timer/Event Counter clock source, care should be taken when programming. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU ; external interrupt vector ; Timer Counter 0 interrupt vector ...

Page 60

... BS2824/BS2854/BS2868 Touch Key MCU Pulse Width Modulator Every device includes an 8-bit PWM function. Useful for such applications such as motor speed control, the PWM function provides outputs with a fixed frequency but with a duty cycle that can be varied by setting particular values into the corresponding PWM register. ...

Page 61

... The following diagram illustrates the waveforms associated with the 6+2 mode of PWM operation important to note how the single PWM cycle is subdivided into 4 individual modulation cycles, numbered from 0~3 and how the AC value is related to the PWM value. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Parameter AC (0~3) ...

Page 62

... BS2824/BS2854/BS2868 Touch Key MCU 7+1 PWM Mode Each full PWM cycle controlled by an 8-bit PWM register, has 256 clock periods. However, in the 7+1 PWM mode, each PWM cycle is subdivided into two individual sub-cycles known as modulation cycle 0 ~ modulation cycle 1, denoted the table. Each one of these two sub-cycles contains 128 clock cycles ...

Page 63

... The devices contain a single external interrupt and multiple internal interrupts. The external interrupt is controlled by the action of the external interrupt pin, while the internal interrupt is controlled by the Timer/Event Counters and Time Base overflows. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU ; setup PWM value of decimal 100 ; select the 7+1 PWM mode ...

Page 64

... BS2824/BS2854/BS2868 Touch Key MCU Interrupt Register Overall interrupt control, which means interrupt enabling and request flag setting, is controlled by using two registers, INTC0 and INTC1. By controlling the appropriate enable bits in this registers each individual interrupt can be enabled or disabled. Also when an interrupt occurs, the corresponding request flag will be set by the microcontroller ...

Page 65

... Note that any pull-high resistor connections on this pin will re- main valid even if the pin is used as an external interrupt input. Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU BS2854 Priority BS2824/BS2868 Priority INTEG0 Edge Trigger Type 0 0 External interrupt disable ...

Page 66

... BS2824/BS2854/BS2868 Touch Key MCU INTC0 Register BS2824/BS2868 Bit 7 Name R/W POR Bit 7 unimplemented, read as 0 Bit 6 T1F: Timer/Event Counter 1 interrupt request flag 0: inactive 1: active Bit 5 T0F: Timer/Event Counter 0 interrupt request flag 0: inactive 1: active Bit 4 INTF: External interrupt request flag 0: inactive 1: active Bit 3 ...

Page 67

... Bit 4 ADF: A/D Conversion interrupt request flag 0: inactive 1: active Bit 3~2 unimplemented, read as 0 Bit 1 TBE: Time base event interrupt enable 0: disable 1: enable Bit 0 ADE: A/D Conversion interrupt enable 0: disable 1: enable Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU TBF T0F INTF TBE R/W R/W R/W R ...

Page 68

... BS2824/BS2854/BS2868 Touch Key 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, TnE, must first be set. An actual Timer/Event Counter interrupt will take place when the Timer/Event Counter request flag, TnF, is set, a situation that will occur when the relevant Timer/Event Counter overflows ...

Page 69

... COM3EN: PB3 or SCOM3 selection 0: GPIO 1: SCOM3 Bit 2 COM2EN: PB2 or SCOM2 selection 0: GPIO 1: SCOM2 Bit 1 COM1EN: PB1 or SCOM1 selection 0: GPIO 1: SCOM1 Bit 0 COM0EN: PB0 or SCOM0 selection 0: GPIO 1: SCOM0 Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU COMnEN Pin Function SCOMN Output Control 6 5 ...

Page 70

... BS2824/BS2854/BS2868 Touch Key MCU Configuration Options Configuration options refer to certain options within the MCU that are programmed into the OTP Program Memory device during the programming process. During the development process, these options are selected using the HT-IDE software development tools. As these options are programmed into the device using the hardware programming tools, once they are selected they cannot be changed later by the application software ...

Page 71

... RR, RL, RRC and RLC which provide a simple means of rotating one bit right or left. Different rotate instructions exist depending on program requirements. Rotate instructions are useful for serial port programming applications where data can be rotated from an internal register into the Carry bit Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU 71 January 27, 2010 ...

Page 72

... BS2824/BS2854/BS2868 Touch Key MCU from where it can be examined and the necessary serial bit set high or low. Another application where rotate data operations are used is to implement multiplication and division calculations. Branches and Control Transfer Program branching takes the form of either jumps to specified locations using the JMP instruction subroutine using the CALL instruction ...

Page 73

... Rotate Data Memory left through Carry with result in ACC RLC [m] Rotate Data Memory left through Carry Data Move MOV A,[m] Move Data Memory to ACC MOV [m],A Move ACC to Data Memory MOV A,x Move immediate data to ACC Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Description 73 Cycles Flag Affected AC, OV Note AC, OV ...

Page 74

... BS2824/BS2854/BS2868 Touch Key MCU Mnemonic Bit Operation CLR [m].i Clear bit of Data Memory SET [m].i Set bit of Data Memory Branch JMP addr Jump unconditionally SZ [m] Skip if Data Memory is zero SZA [m] Skip if Data Memory is zero with data movement to ACC SZ [m].i Skip if bit i of Data Memory is zero SNZ [m] ...

Page 75

... ACC AND x Affected flag(s) Z Logical AND ACC to Data Memory ANDM A,[m] Description Data in the specified Data Memory and the Accumulator perform a bitwise logical AND operation. The result is stored in the Data Memory. Operation [m] ACC AND [m] Affected flag(s) Z Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU 75 January 27, 2010 ...

Page 76

... BS2824/BS2854/BS2868 Touch Key MCU Subroutine call CALL addr Description Unconditionally calls a subroutine at the specified address. The Program Counter then increments 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 77

... This instruction stops the program execution and turns off the system clock. The con- tents of the Data Memory and registers are retained. The WDT and prescaler are cleared. The power down flag PDF is set and the WDT time-out flag TO is cleared. Operation TO 0 PDF 1 Affected flag(s) TO, PDF Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU 77 January 27, 2010 ...

Page 78

... BS2824/BS2854/BS2868 Touch Key MCU Increment Data Memory INC [m] Description Data in the specified Data Memory is incremented by 1. Operation [m] [ Affected flag(s) Z Increment Data Memory with result in ACC INCA [m] Description Data in the specified Data Memory is incremented by 1. The result is stored in the Accu- mulator. The contents of the Data Memory remain unchanged. ...

Page 79

... The contents of the specified Data Memory are rotated left by 1 bit with bit 7 rotated into bit 0. The rotated result is stored in the Accumulator and the contents of the Data Mem- ory remain unchanged. Operation ACC.(i+1) ACC.0 [m].7 Affected flag(s) None Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Stack Stack Stack [m]. 0~6) [m]. 0~6) 79 January 27, 2010 ...

Page 80

... BS2824/BS2854/BS2868 Touch Key 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. Operation [m] ...

Page 81

... Set Data Memory SET [m] Description Each bit of the specified Data Memory is set to 1. Operation [m] FFH Affected flag(s) None Set bit of Data Memory SET [m].i Description Bit i of the specified Data Memory is set to 1. Operation [m].i 1 Affected flag(s) None Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU 81 January 27, 2010 ...

Page 82

... BS2824/BS2854/BS2868 Touch Key MCU Skip if increment Data Memory is 0 SIZ [m] Description The contents of the specified Data Memory are first incremented 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 two cycle instruction. If the result is not 0 the program proceeds with the following instruction ...

Page 83

... The low byte of the program code (current page) addressed by the table pointer (TBLP) is moved to the specified Data Memory and the high byte moved to TBLH. Operation [m] program code (low byte) TBLH program code (high byte) Affected flag(s) None Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU [m].7 ~ [m].4 [m].7 ~ [m].4 [m].3 ~ [m].0 83 January 27, 2010 ...

Page 84

... BS2824/BS2854/BS2868 Touch Key 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. Operation [m] program code (low byte) ...

Page 85

... Package Information 16-pin NSOP (150mil) Outline Dimensions Symbol Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Dimensions in mil Min. Nom. 228 149 14 386 Max. 244 157 20 394 January 27, 2010 ...

Page 86

... BS2824/BS2854/BS2868 Touch Key MCU 24-pin SOP (300mil) Outline Dimensions MS-013 Symbol Rev. 1.00 Dimensions in mil Min. Nom. 393 256 12 598 Max. 419 300 20 613 104 January 27, 2010 ...

Page 87

... SOP (300mil) Outline Dimensions MS-013 Symbol Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Dimensions in mil Min. Nom. 393 256 12 697 Max. 419 300 20 713 104 January 27, 2010 ...

Page 88

... BS2824/BS2854/BS2868 Touch Key MCU 44-pin QFP (10mm´10mm) Outline Dimensions Symbol Rev. 1.00 Dimensions in mm Min. Nom. 13.00 9.90 13.00 9.90 0.80 0.30 1.90 0.25 0.73 0.10 0. Max. 13.40 10.10 13.40 10.10 2.20 2.70 0.50 0.93 0.20 7 January 27, 2010 ...

Page 89

... Space Between Flange T2 Reel Thickness SOP 24W, SOP 28W (300mil) Symbol A Reel Outer Diameter B Reel Inner Diameter C Spindle Hole Diameter D Key Slit Width T1 Space Between Flange T2 Reel Thickness Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Description Dimensions in mm Description Dimensions 330.0 1.0 100.0 1.5 +0.5/-0.2 13.0 2.0 0.5 +0.3/-0.2 16.8 22.2 0.2 330.0 1.0 100.0 1.5 +0.5/-0.2 13 ...

Page 90

... BS2824/BS2854/BS2868 Touch Key MCU Carrier Tape Dimensions SOP 16N (150mil) Symbol W Carrier Tape Width P Cavity Pitch E Perforation Position F Cavity to Perforation (Width Direction) D Perforation Diameter D1 Cavity Hole Diameter P0 Perforation Pitch P1 Cavity to Perforation (Length Direction) A0 Cavity Length B0 Cavity Width K0 Cavity Depth t Carrier Tape Thickness ...

Page 91

... Cavity Pitch E Perforation Position F Cavity to Perforation (Width Direction) D Perforation Diameter D1 Cavity Hole Diameter P0 Perforation Pitch P1 Cavity to Perforation (Length Direction) A0 Cavity Length B0 Cavity Width K0 Cavity Depth t Carrier Tape Thickness C Cover Tape Width Rev. 1.00 BS2824/BS2854/BS2868 Touch Key MCU Description Dimensions in mm Description Dimensions 24.0 0.3 12.0 0.1 1.75 0.1 11.5 0.1 +0.10/-0.00 1.55 +0.25/-0.00 1.50 4.0 0.1 2.0 0.1 10.9 0.1 15.9 0.1 3.1 0.1 0.35 0.05 21.3 0.1 24.0 0.3 12.0 0.1 1 ...

Page 92

... BS2824/BS2854/BS2868 Touch Key MCU Holtek Semiconductor Inc. (Headquarters) No.3, Creation Rd. II, Science Park, Hsinchu, Taiwan Tel: 886-3-563-1999 Fax: 886-3-563-1189 http://www.holtek.com.tw Holtek Semiconductor Inc. (Taipei Sales Office) 4F-2, No. 3-2, YuanQu St., Nankang Software Park, Taipei 115, Taiwan Tel: 886-2-2655-7070 Fax: 886-2-2655-7373 Fax: 886-2-2655-7383 (International sales hotline) Holtek Semiconductor Inc ...

Related keywords