Part Number Hot Search : 
E4982A B3765 EMA212 STH6N100 FC510 SPG510S EMK21 D2525P56
Product Description
Full Text Search
 

To Download HT82K68A Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  HT82K68A 8-bit multimedia keyboard encoder mask mcu block diagram rev. 1.10 1 november 20, 2001 features  operating voltage: 2.4v~5.5v  32/34 bidirectional i/o lines  one 8-bit programmable timer counter with overflow interrupts  crystal or rc oscillator  watchdog timer  3k  16 program rom  160  8 data ram  one external interrupt pin (shared with pc2)  halt function and wake-up feature reduce power consumption  six-level subroutine nesting  bit manipulation instructions  16-bit table read instructions  63 powerful instructions  all instructions in 1 or 2 machine cycles  20/28-pin sop, 40-pin dip, 48-pin ssop package general description the HT82K68A is an 8-bit high performance peripheral interface ic, designed for multiple i/o products and mul - timedia applications. it supports interface to a low speed pc with multimedia keyboard or wireless keyboard in windows 95, windows 98 or windows 2000 environment. a halt feature is included to reduce power consumption.          
          
  
    
  
  
              
                  
   
     
               !  !     " ! #   $  %
   !    !          &     '   (       )  &  # * + ,    )  &  # * + , -    -   &      .  -    &   / & 0 
       &     '   (  !   !   & !  !  '  ! (  1   1   & 1  1  '  1 (   !  *    !  * 2   !  *    !  *    !  * ,   !  * 3         '   ,   &    
pin assignment pin description pin name i/o mask option description pa0~pa7 i/o wake-up pull-high or none bidirectional 8-bit input/output port. each bit can be configured as a wake-up input by mask option. software* instructions determine the cmos output or schmitt trig - ger input with or without 12k pull-high resistor. pb0~pb7 i/o pull-high or none bidirectional 8-bit input/output port. software* instructions determine the output or schmitt trigger input with or without pull-high resistor. pc0 i/o wake-up pull-high or none this pin is an i/o port. nmos open drain output with pull-high resistor and can be used as data or clock line of ps2. this pin can be configured as a wake-up in - put by mask option. pc1 i/o wake-up pull-high or none this pin is an i/o port. nmos open drain output with pull-high resistor and can be used as data or clock line of ps2. this pin can be configured as a wake-up in - put by mask option. pc2~pc3 i/o wake-up pull-high or none bidirectional 2-bit input/output port. each bit can be configured as a wake-up input by mask option. software* instructions determine the cmos output or schmitt trig - ger input with or without pull-high resistor. pc2 also as external interrupt input pin. pe0 determine whether rising edge or fall - ing edge of pc2 to trigger the int circuit. pc4~pc7 i/o pull-high or none bidirectional 4-bit input/output port. software* instructions determine the cmos output or schmitt trigger input with or without pull-high resistor. pd0~pd7 i/o pull-high or none bidirectional 8-bit input/output port. software* instructions determine the cmos output or schmitt trigger input with or without pull-high resistor. HT82K68A rev. 1.10 2 november 20, 2001  1 4  1 (  ! ,  ! 3  ! 4  ! (                , 5 #   6   2            (   4   3   ,   2  1 3  1 ,  ! 2  !   !   !   1 2  1   1   1    (   4   3   ,       5 #   6   2 5 #   6          ,  2 7 2 / 2 ( 2 4 2 3 2 , 2 2 2  2  2   7  /  (  4  3  ,  2       2 , 3 4 ( / 7        2  ,  3  4  (  /  7    1 3  1 ,  ! 2  !   !   !   1 2  1   1   1        (   4   3   ,       5 #   6   2 5 #   6                 1 4  1 (  ! ,  ! 3  ! 4  ! (                        , 5 #   6   2            (   4   3   ,   2             
                       , / , ( , 4 , 3 , , , 2 ,  ,  ,  2 7 2 / 2 ( 2 4 2 3 2 , 2 2 2  2  2   7  /  (  4  3   2 , 3 4 ( / 7        2  ,  3  4  (  /  7        2  ,    7  /  (  4  3  ,  2       2 , 3 4 ( / 7    /  (  4  3  ,  2        7  /  (  4  3   2 , 3 4 ( / 7        2  ,              
      ! 2  !   !   !   1   1               ! ,  ! 3  ! 4  ! (                2                         1 3  1 ,  ! 2  !   !   !   1 2  1   1   1             2  1 4  1 (  ! ,  ! 3  ! 4  ! (                (   4   3   ,
pin name i/o mask option description pe0~pe1 i/o pull-high or none bidirectional input/output port. software* instruction determine the cmos output or schmitt trigger input with or without pull-high resistor. if pe0 output 1, rising edge of pc2 trigger int circuit. pe0 output 0, falling edge of pc2 trigger int circuit. pe2 o this pin is a cmos output structure. the pad can function as led (scr) drivers for the keyboard. i ol =14ma, @v ol =3.2v pe3 o this pin is a cmos output structure. the pad can function as led (num) drivers for the keyboard. i ol =14ma, @v ol =3.2v pe4 o this pin is a cmos output structure. the pad can function as led (cap) drivers for the keyboard. i ol =14ma, @v ol =3.2v vdd  positive power supply vss  negative power supply, ground reset i  chip reset input. active low. built-in power-on reset circuit to reset the entire chip. chip can also be externally reset via reset pin osc1 osc2 i o crystal or rc osc1, osc2 are connected to an rc network or a crystal for the internal system clock. in the case of rc operation, osc2 is the output terminal for the 1/4 system clock; a 110k  resistor is connected to osc1 to generat e a 2 mhz frequency. note: *: software means the ht  ide (holtek integrated development environment) can be configured by mask op - tion. absolute maximum ratings supply voltage ........................................  0.3v to 5.5v storage temperature ...........................  50  cto125  c input voltage .............................v ss  0 . 3v to v dd +0.3v operating temperature ..........................  25  cto70  c note: these are stress ratings only. stresses exceeding the range specified under  absolute maximum ratings  may cause substantial damage to the device. functional operation of this device at other conditions beyond those listed in the specification is not implied and prolonged exposure to extreme conditions may affect device reliabil- ity. d.c. characteristics ta=25  c symbol parameter test conditions min. typ. max. unit v dd conditions v dd operating voltage  2.4  5.5 v i dd1 operating current (crystal osc) 3v no load, f sys = 6mhz  0.7 1.5 ma 5v  25ma i dd2 operating current (rc osc) 3v no load, f sys = 6mhz  0.5 1 ma 5v  25ma i stb1 standby current (wdt enabled) 3v no load, system halt  8  a 5v  15  a i stb2 standby current (wdt disabled) 3v no load, system halt  3  a 5v  6  a v il1 input low voltage for i/o ports (schmitt) 3v  0  0.9 v 5v  0  1.5 v input high voltage for i/o ports (schmitt) 3v  2.1  3v 5v  3.5  5v HT82K68A rev. 1.10 3 november 20, 2001
symbol parameter test conditions min. typ. max. unit v dd conditions v il2 input low voltage for i/o ports (cmos) 3v  0  1.2 v 5v  0  2.3 v v ih2 input high voltage for i/o ports (cmos) 3v  1.7  3v 5v  2.7  5v v il3 input low voltage (reset ) 3v  0  0.7 v 5v  0  1.3 v v ih3 input high voltage (reset ) 3v  2.4  3v 5v  4.0  5v i ol i/o port sink current 5v v ol = 0.5v 712  ma i oh i/o port source current 5v v oh = 4.5v  2.5  4.5  ma i led led sink current (scr, num, cap) 5v v ol =3.4v 10 14 18 ma t por power-on reset time 5v  120 150 180 ms r ph internal pull-high resistance of pa, pb, pc, pd, pe port 5v  51220 k  r ph1 internal pull-high resistance of data, clk 5v  2 4.7 8 k  r ph2 internal pull-high resistance of reset 5v  15 31 46 k  f/f frequency variation 5v crystal 
1 % f/f1 frequency variation 5v rc 
10 % a.c. characteristics ta=25  c symbol parameter test conditions min. typ. max. unit v dd conditions f sys1 system clock (crystal osc) 3v  6  mhz 5v  6  mhz f sys2 system clock (rc osc) 3v  6  mhz 5v  6  mhz t wdtosc watchdog oscillator 3v  45 90 180  s 5v  35 76 130  s t wdt1 watchdog time-out period (rc) 3v without wdt prescaler 12 23 45 ms 5v 9 19 35 ms t wdt2 watchdog time-out period (system clock)  without wdt prescaler  1024  t sys t res external reset low pulse width  1  s t sst system start-up timer period  power-up or wake-up from halt  1024  t sys t int interrupt pulse width  1  s note: t sys = 1/f sys HT82K68A rev. 1.10 4 november 20, 2001
mode program counter 11 10 9 8 7 6 5 4 3 2 1 0 initial reset 0 0 0 0 00000000 external interrupt 0 0 0 0 00000100 timer counter overflow 0 0 0 0 00001000 skip pc+2 loading pcl 11 10 9 8 @7 @6 @5 @4 @3 @2 @1 @0 jump, call branch #11 #10 #9 #8 #7 #6 #5 #4 #3 #2 #1 #0 return from subroutine s11 s10 s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 HT82K68A rev. 1.10 5 november 20, 2001      2  ,      2  ,      2  , 8
 $ &     & 5   6  9  
&     & 5   :  6 8
 $ &     & 5   ;  6  9  
&     & 5   6 8
 $ &     & 5   ;  6  9  
&     & 5   ;  6     ;    ;   " 
 &  .   <    & 5  &  . " 6   5    &   &     &  
 
6 execution flow functional description execution flow the HT82K68A system clock is derived from either a crystal or an rc oscillator. the system clock is internally divided into four non-overlapping clocks. one instruc - tion cycle consists of four system clock cycles. instruction fetching and execution are pipelined in such a way that a fetch takes one instruction cycle while de - coding and execution takes the next instruction cycle. however, the pipelining scheme causes each instruc - tion to effectively execute within one cycle. if an instruc - tion changes the program counter, two cycles are required to complete the instruction. program counter  pc the 12-bit program counter (pc) controls the sequence in which the instructions stored in the program rom are executed and its contents specify a maximum of 4096 addresses. after accessing a program memory word to fetch an in - struction code, the contents of the program counter are incremented by one. the program counter then points to the memory word containing the next instruction code. when executing a jump instruction, conditional skip ex - ecution, loading pcl register, subroutine call, initial re - set, internal interrupt, external interrupt or return from subroutine, the pc manipulates the program transfer by loading the address corresponding to each instruction. the conditional skip is activated by instruction. once the condition is met, the next instruction, fetched during the current instruction execution, is discarded and a dummy cycle replaces it to get the proper instruction. otherwise proceed with the next instruction. the lower byte of the program counter (pcl) is a read - able and writeable register (06h). moving data into the pcl performs a short jump. the destination will be within 256 locations. once a control transfer takes place, an additional dummy cycle is required. program memory  rom the program memory is used to store the program in - structions which are to be executed. it also contains data, table, and interrupt entries, and is organized with 3072  16 bits, addressed by the program counter and ta - ble pointer. note: *11~*0: program counter bits #11~#0: instruction code bits s11~s0: stack register bits @7~@0: pcl bits
instruction(s) table location 11 10 9 8 7 6 5 4 3 2 1 0 tabrdc [m] p11 p10 p9 p8 @7 @6 @5 @4 @3 @2 @1 @0 tabrdl [m] 1 0 1 1 @7 @6 @5 @4 @3 @2 @1 @0 HT82K68A rev. 1.10 6 november 20, 2001 certain locations in the program memory are reserved for special usage:  location 000 this area is reserved for the initialization program. af - ter chip reset, the program always begins execution at location 000h.  location 004h location 004h is reserved for external interrupt ser - vice program. if the pc2 (external input pin) is acti - vated, the interrupt is enabled, and the stack is not full, the program begins execution at location 004h. the pin pe0 determine whether the rising or falling edge of the pc2 to activate external interrupt service program.  location 008h this area is reserved for the timer counter interrupt service program. if timer interrupt results from a timer counter overflow, and if the interrupt is enabled and the stack is not full, the program begins execution at location 008h.  table location any location in the rom space can be used as look-up tables. the instructions tabrdc [m] (the cur - rent page, one page=256 words) and tabrdl [m] (the last page) transfer the contents of the lower-order byte to the specified data memory, and the higher-order byte to tblh (08h). only the destination of the lower-order byte in the table is well-defined, the other bits of the table word are transferred to the lower portion of tblh, the remaining 1 bit is read as 0. the table higher-order byte register (tblh) is read only. the tblh is read only and cannot be restored. if the main routine and the isr (interrupt service routine) both employ the table read instruction, the contents of the tblh in the main routine are likely to be changed by the table read instruction used in the isr. errors can occur. in other words, using the table read instruc - tion in the main routine and the isr simultaneously should be avoided. however, if the table read instruc - tion has to be applied in both the main routine and the isr, the interrupt is supposed to be disabled prior to the table read instruction. it will not be enabled until the tblh has been backed up. the table pointer (tblp) is a read/write register (07h), which indicates the table location. before accessing the table, the location must be placed in tblp. all table related instructions need 2 cycles to complete the operation. these areas may function as normal program memory depending upon the requirements. stack register  stack this is a special part of the memory which is used to save the contents of the program counter (pc) only. the stack is organized into six levels and is neither part of the data nor part of the program 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- ment, 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 chip reset, the sp will point to the top of the stack. data memory  ram the data memory is designed with 184  8 bits. it is di - vided into two functional groups: special function regis - ters and general purpose data memory (160  8). most of them are read/write, but some are read only. the special function registers include the indirect ad - dressing register 0 (00h), the memory pointer register 0 (mp0;01h), the indirect addressing register 1 (02h), the memory pointer register 1 (mp1;03h), the accumulator (acc;05h), the program counter lower-byte register (pcl;06h), the table pointer (tblp;07h), the table higher-order byte register (tblh;08h), the watchdog timer option setting register (wdts;09h), the status reg - ister (status;0ah), the interrupt control register    =   / =  >   &  
  .  ? 
  &            + >
&   
 & 
   
&   0   
          4 & 0 
 #   < :   &
 0 . & 5  3 4 & @     6   = #   < :   &
 0 . & 5  3 4 & @     6 1 8 8 =  
a & &     & %    &  &
 & 1 & & 8 8 = program memory note: *11~*0: table location bits p11~p8: current program counter bits @7~@0: table location bits
HT82K68A rev. 1.10 7 november 20, 2001 (intc;0bh), the timer counter register (tmr;0dh), the timer counter control register (tmrc;0eh), the i/o regis - ters (pa;12h, pb;14h, pc;16h, pd;18h, pe;1ah) and the i/o control registers (pac;13h, pbc;15h, pcc;17h, pdc;19h, pec;1bh). the remaining space before the 60h is reserved for future expanded usage and reading these locations will get the result 00h. the general pur - pose data memory, addressed from 60h to ffh, is used for data and control information under instruction com - mand. all data memory areas can handle arithmetic, logic, in - crement, decrement and rotate operations directly. ex - cept for some dedicated bits, each bit in the data memory can be set and reset by the set [m].i and clr [m].i instructions, respectively. they are also indirectly accessible through memory pointer registers (mp0;01h, mp1;03h). indirect addressing register location 00h and 02h are indirect addressing registers that are not physically implemented. any read/write op - eration of [00h] and [02h] can access the data memory pointed to by mp0 (01h) and mp1 (03h) respectively. reading location 00h or 02h indirectly will return the re - sult 00h. writing indirectly results in no operation. the function of data movement between two indirect ad - dressing registers is not supported. the memory pointer registers, mp0 and mp1, are 8-bit registers which can be used to access the data memory by combining corre - sponding indirect addressing registers. accumulator the accumulator is closely related to the alu opera - tions. it is also mapped to location 05h of the data mem - ory and is capable of carrying out immediate data operations. the data movement between two data memory locations must pass through the accumulator. arithmetic and logic unit  alu this circuit performs 8-bit arithmetic and logic operation. the alu provides the following functions:  arithmetic operations (add, adc, sub, sbc, daa)  logic operations (and, or, xor, cpl)  rotation (rl, rr, rlc, rrc)  increment and decrement (inc, dec)  branch decision (sz, snz, siz, sdz ....) the alu not only saves the results of a data operation but also changes the status register. status register  status the 8-bit status register (0ah) contains the zero flag (z), carry flag (c), auxiliary carry flag (ac), overflow flag (ov), power down flag (pd) and watch dog time-out flag (to). the status register not only records the status in- formation but also controls the operation sequence. with the exception of the to and pd 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 pd flags. it should be noted that operations related to the status register may give different results from those intended. the to and pd flags can only be changed by system power up, watch - dog timer overflow, executing the halt instruction and clearing the watchdog timer. the z, ov, ac and c flags generally reflect the status of the latest operations. in addition, on entering an interrupt sequence or execut - ing a subroutine call, the status register will not be auto - matically pushed onto the stack. if the contents of status are important and if the subroutine can corrupt the sta - tus register, precaution must be taken to save it properly.     
& !        &   
 &         
& !        &   
 &     !     #  1 #   1 # = -      !              !  !   1  1                    . &        !  ! &    ) 5  4  & 1 "
 6      . &        !  ! &    )   =   =   =  2 =  , =  3 =  4 =  ( =  / =  7 =  ! =  1 =   =   =   =  8 =   =   =   =  2 =  , =  3 =  4 =  ( =  / =  7 =  ! =  1 =   =   =   =  8 = 8 8 = a &     b   &   &       = 4  = ram mapping
HT82K68A rev. 1.10 8 november 20, 2001 interrupt the HT82K68A provides an internal timer counter inter - rupt and an external interrupt shared with pc2. the in - terrupt control register (intc;0bh) contains the interrupt control bits to set not only the enable/disable status but also the interrupt request flags. once an interrupt subroutine is serviced, all other inter- rupts will be blocked (by clearing the emi bit). this scheme may prevent any further interrupt nesting. other interrupt requests may occur during this interval but only the interrupt request flag is recorded. if a certain inter- rupt requires servicing within the service routine, the emi bit and the corresponding bit of the intc may be set to allow interrupt nesting. if the stack is full, the inter- rupt request will not be acknowledged, even if the re - lated interrupt is enabled, until the sp is decremented. if immediate service is desired, the stack must be pre - vented from becoming full. all these kinds of interrupt have the wake-up capability. as an interrupt is serviced, a control transfer occurs by pushing the program counter onto the stack followed by a branch to a subroutine at the specified location in the program memory. only the program counter is pushed onto the stack. if the contents of the register and status register (status) are altered by the interrupt service program which corrupt the desired control sequence, the contents should be saved in advance. the internal timer counter interrupt is initialized by set - ting the timer counter interrupt request flag (t0f; bit 5 of intc), which is normally caused by a timer counter overflow. when the interrupt is enabled, and the stack is not full and the t0f bit is set, a subroutine call to location 08h will occur. the related interrupt request flag (t0f) will be reset and the emi bit cleared to disable further in- terrupts. the external interrupt is shared with pc2. the external interrupt is activated, the related interrupt request flag (eif; bit4 of intc) is then set. when the interrupt is en - abled, the stack is not full, and the external interrupt is active, a subroutine call to location 04h will occur. the interrupt request flag (eif) and emi bits will also be cleared to disable other interrupts. the external interrupt (pc2) can be triggered by a high to low transition, or a low to high transition of the pc2, which is depend on the output level of the pe0. when pe0 is output high, the external interrupt is triggered by labels bits function c0 c is set if an operation results in a carry during an addition operation or if a borrow does not take place during a subtraction operation; otherwise c is cleared. c is also affected by a rotate through carry instruction. ac 1 ac is set if an operation results in a carry out of the low nibbles in addition or if no borrow from the high nibble into the low nibble in subtraction; otherwise ac is cleared. z 2 z is set if the result of an arithmetic or logical operation is zero; otherwise z is cleared. ov 3 ov is set if an operation results in a carry into the highest-order bit but not a carry out of the highest-order bit, or vice versa; otherwise ov is cleared. pd 4 pd is cleared when either a system power-up or executing the clr wdt instruction. pd is set by executing a halt instruction. to 5 to is cleared by a system power-up or executing the clr wdt or halt instruction. to is set by a wdt time-out.  6 unused bit, read as  0   7 unused bit, read as  0  status register register bit no. label function intc (0bh) 0 emi controls the master (global) interrupt (1= enabled; 0= disabled) 1 eei control the external interrupt 2 et0i controls the timer counter interrupt (1= enabled; 0= disabled) 3  unused bit, read as  0  4 eif external interrupt flag 5 t0f internal timer counter request flag (1= active; 0= inactive) 6  unused bit, read as  0  7  unused bit, read as  0  intc register
HT82K68A rev. 1.10 9 november 20, 2001 a low to high transition of the pc2. when pe0 is output low, the external interrupt is triggered by a high to low transition of pc2. during the execution of an interrupt subroutine, other in - terrupt acknowledgements are held until the reti in - struction is executed or the emi bit and the related interrupt control bit are set to 1 (if the stack is not full). to return from the interrupt subroutine, a ret or reti in - struction may be invoked. reti will set the emi bit to en - able an interrupt service, but ret will not. interrupts occurring in the interval between the rising edges of two consecutive t2 pulses, will be serviced on the latter of the two t2 pulses, if the corresponding inter - rupts are enabled. in the case of simultaneous requests, the following table shows the priority that is applied. these can be masked by resetting the emi bit. no. interrupt source vector a external interrupt 1 04h b timer counter overflow 08h the timer counter interrupt request flag (t0f), external interrupt request (eif) enable timer counter bit (et0i), enable external interrupt bit (eei) and enable master in - terrupt bit (emi) constitute an interrupt control register (intc) which is located at 0bh in the data memory. emi, et0i and eei, are used to control the enabling/disabling of interrupts. these bits prevent the requested interrupt from being serviced. once the interrupt request flags (t0f) are set, they will remain in the intc register until the interrupts are serviced or cleared by a software in- struction. it is suggested that a program does not use the  call subroutine  within the interrupt subroutine. because in- terrupts often occur in an unpredictable manner or need to be serviced immediately in some applications, if only one stack is left and enabling the interrupt is not well controlled, once the  call subroutine  operates in the in - terrupt subroutine it will damage the original control se - quence. oscillator configuration there are two oscillator circuits in HT82K68A. both are designed for system clocks; the rc oscillator and the crystal oscillator, which are determined by mask op - tions. no matter what oscillator type is selected, the sig - nal provides the system clock. the halt mode stops the system oscillator and resists the external signal to conserve power. if an rc oscillator is used, an external resistor between osc1 and vdd is needed and the resistance must range from 51k  to 1m  . the system clock, divided by 4, is available on osc2, which can be used to synchro - nize external logic. the rc oscillator provides the most cost effective solution. however, the frequency of the oscillation may vary with vdd, temperature and the chip itself due to process variations. it is, therefore, not suit - able for timing sensitive operations where accurate os - cillator frequency is desired. if the crystal oscillator is used, a crystal across osc1 and osc2 is needed to provide the feedback and phase shift needed for oscillator, no other external components are needed. instead of a crystal, the resonator can also be connected between osc1 and osc2 to get a fre- quency reference, but two external capacitors in osc1 and osc2 are required. the wdt oscillator is a free running on-chip rc oscilla- tor, and no external components are required. even if the system enters the power down mode, the system clock is stopped, but the wdt oscillator still works for a period of approximately 78  s. the wdt oscillator can be disabled by mask option to conserve power. watchdog timer  wdt the wdt clock source is implemented by a dedicated rc oscillator (wdt oscillator) or instruction clock (sys - tem clock divided by 4), decided by mask options. this timer is designed to prevent a software malfunction or  " 
 &  .   < + , / : 0 
&   
 -   &      .  ( : 0 
&   
 / :
 :  &   -   &    :  
-   ' -      < 
   . 
-     watchdog timer crystal oscillator rc oscillator osc1 osc2 osc1 osc2 v dd f sys /4 (nmos open drain output) system oscillator
HT82K68A rev. 1.10 10 november 20, 2001 sequence jumping to an unknown location with unpre - dictable results. the watchdog timer can be disabled by mask option. if the watchdog timer is disabled, all the executions related to the wdt results in no opera - tion. once the internal wdt oscillator (rc oscillator normally with a period of 78  s) is selected, it is first divided by 256 (8-stages) to get the nominal time-out period of approxi - mately 20 ms. this time-out period may vary with tem - perature, vdd and process variations. by invoking the wdt prescaler, longer time-out periods can be realized. writing data to ws2, ws1, ws0 (bit 2,1,0 of the wdts) can give different time-out periods. if ws2, ws1, ws0 are all equal to 1, the division ratio is up to 1:128, and the maximum time-out period is 2.6 seconds. if the wdt oscillator is disabled, the wdt clock may still come from the instruction clock and operate in the same manner except that in the halt state the wdt may stop counting and lose its protecting purpose. in this situation the wdt logic can be restarted by external logic. the high nibble and bit 3 of the wdts are reserved for user defined flags, which can be used to indicate some speci - fied status. if the device operates in a noisy environment, using the on-chip rc oscillator (wdt osc) is strongly recom - mended, since the halt will stop the system clock. ws2 ws1 ws0 division ratio 000 1:1 001 1:2 010 1:4 011 1:8 1 0 0 1:16 1 0 1 1:32 1 1 0 1:64 1 1 1 1:128 wdts register the wdt overflow under normal operation will initialize  chip reset  and set the status bit to. an overflow in the halt mode, initializes a  warm reset  only when the pc and sp are reset to zero. to clear the contents of the wdt (including the wdt prescaler ), three methods are adopted; external reset (a low level to reset ), software instruction(s), or a halt instruction. there are two types of software instructions; clr wdt and clr wdt1/clr wdt2. of these two types of instruction, only one can be active depending on the mask option   clr wdt times selection option  .ifthe  clr wdt  is selected (ie. clr wdt times equal one), any execution of the clr wdt instruction will clear the wdt. in case  clr wdt1  and  clr wdt2  are chosen (ie. clrwdt times equal two), these two instructions must be exe - cuted to clear the wdt; otherwise, the wdt may reset the chip because of the time-out. power down operation  halt the halt mode is initialized by the halt instruction and results in the following...  the system oscillator will turn off but the wdt oscilla - tor keeps running (if the wdt oscillator is selected).  the contents of the on chip ram and registers re - main unchanged.  wdt and wdt prescaler will be cleared and recount again (if the wdt clock has come from the wdt oscil - lator).  all i/o ports maintain their original status.  the pd flag is set and the to flag is cleared. the system can leave the halt mode by means of an external reset, interrupt, and external falling edge signal on port a and port c [0:3] or a wdt overflow. an exter - nal reset causes a device initialization and the wdt overflow performs a  warm reset  . examining the to and pd flags, the reason for chip reset can be deter - mined. the pd flag is cleared when system power-up or executing the clr wdt instruction and is set when the halt instruction is executed. the to flag is set if the wdt time-out occurs, and causes a wake-up that only resets the pc and sp, the others keep their original sta - tus. on the other hand, awakening from an external interrupt (pc2), two sequences may happen. if the interrupt is disabled or the interrupt is enabled but the stack is full, the program will resume execution at the next instruc- tion. but if the interrupt is enabled and the stack is not full, the regular interrupt response takes place. the port a or port c [0:3] wake-up can be considered as a continuation of normal execution. each bit in port a can be independently selected to wake up the device by mask option. awakening from an i/o port stimulus, the program will resume execution of the next instruction. once a wake-up event occurs, and the system clock co - mes from a crystal, it takes 1024 t sys (system clock pe - riod) to resume normal operation. in other words, the HT82K68A will insert a dummy period after the wake-up. if the system clock comes from an rc oscilla - tor, it continues operating immediately. if the wake-up results in next instruction execution, this will execute im - mediately after the dummy period is completed. to minimize power consumption, all i/o pins should be carefully managed before entering the halt status. reset there are three ways in which a reset can occur:  reset reset during normal operation  reset reset during halt  wdt time-out reset during normal operation the wdt time-out during halt is different from other chip reset conditions, since it can perform a warm reset that just resets the pc and sp, leaving the other circuits
HT82K68A rev. 1.10 11 november 20, 2001 to remain in their original state. some registers remain unchanged during other reset conditions. most registers are reset to the  initial condition  when the reset condi - tions are met. by examining the pd and to flags, the program can distinguish between different  chip resets  . to pd reset conditions 0 0 reset reset during power-up u u reset reset during normal operation 0 1 reset wake-up halt 1 u wdt time-out during normal operation 1 1 wdt wake-up halt note:  u  means  unchanged  to guarantee that the system oscillator has started and stabilized, the sst (system start-up timer) provides an extra-delay of 1024 system clock pulses when the sys - tem powers up or when it awakes from the halt state. when a system power-up occurs, the sst delay is added during the reset period. but when the reset co - mes from the reset pin, the sst delay is disabled. any wake-up from halt will enable the sst delay. the functional unit chip reset status is shown below. pc 000h prescaler clear wdt clear. after master reset, wdt begins counting timer counter off input/output ports input mode sp points to the top of the stack timer counter a timer counter (tmr) is implemented in the HT82K68A. the timer counter contains an 8-bit pro - grammable count-up counter and the clock may come from the system clock divided by 4. using the internal instruction clock, there is only one ref- erence time-base. there are two registers related to the timer counter; tmr ([0dh]), tmrc ([0eh]). two physical registers are mapped to tmr location; writing tmr makes the start- ing value be placed in the timer counter preload register and reading tmr gets the contents of the timer counter. the tmrc is a timer counter control register, which de- fines some options. in the timer mode, once the timer counter starts count - ing, it will count from the current contents in the timer counter to ffh. once overflow occurs, the counter is re - loaded from the timer counter preload register and gen - erates the interrupt request flag (tf; bit 5 of intc) at the same time.           &    :  
 $   & & 

   reset timing chart        reset circuit -   = ! #  -      :  

      .  
  @  :  & 

       : 
  &    . &   
    -    & 
reset configuration label bits function  0~3 unused bit, read as "0" ton 4 to enable/disable timer counting (0= disabled; 1= enabled)  5 unused bit, read as "0" tm0 tm1 6 7 10= timer mode (internal clock) tmrc register
HT82K68A rev. 1.10 12 november 20, 2001 to enable the counting operation, the timer on bit (ton; bit 4 of tmrc) should be set to 1. in the case of timer counter off condition, writing data to the timer counter preload register will also reload that data to the timer counter. but if the timer counter is turned on, data written to it will only be kept in the timer counter preload register. the timer counter will still operate until overflow occurs. when the timer counter (reading tmr) is read, the clock will be blocked to avoid errors. as clock blocking may results in a counting error, this must be taken into consideration by the programmer. the state of the registers is summarized in the following table: register reset (power on) wdt time-out (normal operation) reset reset (normal operation) reset reset (halt) wdt time-out (halt) tmr xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tmrc 00-0 1--- 00-0 1--- 00-0 1--- 00-0 1--- uu-u u--- pc 000h 000h 000h 000h 000h mp0 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu mp1 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu acc xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tblp xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tblh -xxx xxxx -uuu uuuu -uuu uuuu -uuu uuuu -uuu uuuu status --00 xxxx --1u uuuu --uu uuuu --01 uuuu --11 uuuu intc -000 0000 -000 0000 -000 0000 -000 0000 -uuu uuuu wdts 0000 0111 0000 0111 0000 0111 0000 0111 uuuu uuuu pa 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pac 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pb 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pbc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pcc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pd 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pdc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pe ---1 1111 ---1 1111 ---1 1111 ---1 1111 ---u uuuu pec ---1 1111 ---1 1111 ---1 1111 ---1 1111 ---u uuuu note:   stands for  warm reset   u  stands for  unchanged   x  stands for  unknown   " 
 &  .   < + ,                 .  & -  
$      
   &  
  .     &   
   .    &   
       
  
 & 1   .    >  % .  @
 & 
   
timer counter
HT82K68A rev. 1.10 13 november 20, 2001 input/output ports there are 32 bidirectional input/output lines in the HT82K68A, labeled from pa to pe, which are mapped to the data memory of [12h], [14h], [16h], [18h] and [1ah] respectively. all these i/o ports can be used for input and output operations. for input operation, these ports are non-latching, that is, the inputs must be ready at the t2 rising edge of instruction mov a,[m] (m=12h, 14h, 16h, 18h or 1ah). for output operation, all data is latched and remains unchanged until the output latch is rewritten. each i/o line has its own control register (pac, pbc, pcc, pdc, pec) to control the input/output configuration. with this control register, cmos output or schmitt trigger input with or without pull-high resistor (mask option) structures can be reconfigured dynamically (i.e., on-the-fly) under software control. to function as an input, the correspond - ing latch of the control register must write  1  .the pull-high resistance will exhibit automatically if the pull-high option is selected. the input source(s) also de - pend(s) on the control register. if the control register bit is  1  , input will read the pad state. if the control register bit is  0  , the contents of the latches will move to the internal bus. the latter is possible in  read-modify-write  instruc - tion. for output function, cmos is the only configuration. these control registers are mapped to locations 13h, 15h, 17h, 19h and 1bh. after a chip reset, these input/output lines stay at high levels or floating (mask option). each bit of these in - put/output latches can be set or cleared by the set [m].i or clr [m].i (m=12h, 14h, 16h, 18h or 1ah) instruc - tion. some instructions first input data and then follow the output operations. for example, the set [m].i, clr [m].i, cpl [m] and cpla [m] instructions read the entire port states into the cpu, execute the defined operations (bit-operation), and then write the results back to the latches or the accumulator. each line of port a and port c [0:3] has the capability to wake-up the device. pc2 is shared with the external interrupt pin, pe2~pe4 is defined as cmos output pins only. pe0 can deter - mine whether the high to low transition, or the low to high transition of pc2 to activate the external subrou - tine, when pe0 output high, the low to high transition of pc2 to trigger the external subroutine, when pe0 output low, the high to low transition of pc2 to trigger the exter - nal subroutine. pe2~pe4 is configured as cmos output only and is used to drive the led. pc0, pc1 is configured as nmos open drain output with 4.6k  pull-high resistor such that it can easy to use as data or clock line of ps2 keyboard application.    c   *  c c   *  c       
 & 1   -  
&  
  . &   
  $   & 
  &  
  . &   
 -  
&  +   &  +  " 
 & -  < :   5  ! & d &    '   2 &  . " 6 -  <   . . :    !  '  ! (  1  '  1 (    < & 
     < & 
     '   (    '   (    '   , input/output ports
no. mask option 2 wdt source selection. there are three types of selection: on-chip rc oscillator, instruction clock or disable the wdt. 3 clrwdt times selection. this option defines the way to clear the wdt by instruction.  one time  means that the clr wdt instruction can clear the wdt.  two times  means only if both of the clr wdt1 and clr wdt2 instructions have been executed, only then will the wdt be cleared. 4 wake-up selection. this option defines the wake-up function activity. external i/o pins (pa and pc [0:3] only) all have the capability to wake-up the chip from a halt. 5 pull-high selection. this option is to decide whether the pull-high resistance is visible or not in the input mode of the i/o ports. each bit of an i/o port can be independently selected. 6 special power on reset. this option defines the function will reset the chip to prevent incorrect status. if the special power on reset is enabled, the chip must not enter the halt mode. application circuits HT82K68A rev. 1.10 14 november 20, 2001 mask option the following shows five kinds of mask option in the HT82K68A. all the mask options must be defined to ensure proper system function.        !     %  )  + , & 5    &  &     & 
 
6                                           !             "                                !                              !                            > & %     
        b         8 b 1 b  !        # *     # *  !  !  !  !      2  ,  3  4  (    2 , 3 4 ( / 7        2  ,  3  4  (  !   !   ! 2  ! ,  ! 3  ! 4  ! (  1   1   1   1 2  1 ,  1 3  1 4  1 (            2   ,   3   4   (   4   (  !         2  ,  3  4  (    2 , 3 4 ( / 7        2  ,  3  4  (  !   !   ! 2  ! ,  ! 3  ! 4  ! (  1   1   1   1 2  1 ,  1 3  1 4  1 (            2   ,   3   4   (   4   (     b         8 b 1 b  !        # *     # *  !  !  !  !
instruction set summary mnemonic description flag affected arithmetic add a,[m] addm a,[m] add a,x adc a,[m] adcm a,[m] sub a,x sub a,[m] subm a,[m] sbc a,[m] sbcm a,[m] daa [m] add data memory to acc add acc to data memory add immediate data to acc add data memory to acc with carry add acc to register with carry subtract immediate data from acc subtract data memory from acc subtract data memory from acc with result in data memory subtract data memory from acc with carry subtract data memory from acc with carry and result in data memory decimal adjust acc for addition with result in data memory z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov z,c,ac,ov c logic operation and a,[m] or a,[m] xor a,[m] andm a,[m] orm a,[m] xorm a,[m] and a,x or a,x xor a,x cpl [m] cpla [m] and data memory to acc or data memory to acc exclusive-or data memory to acc and acc to data memory or acc to data memory exclusive-or acc to data memory and immediate data to acc or immediate data to acc exclusive-or immediate data to acc complement data memory complement data memory with result in acc z z z z z z z z z z z increment & decrement inca [m] inc [m] deca [m] dec [m] increment data memory with result in acc increment data memory decrement data memory with result in acc decrement data memory z z z z rotate rra [m] rr [m] rrca [m] rrc [m] rla [m] rl [m] rlca [m] rlc [m] rotate data memory right with result in acc rotate data memory right rotate data memory right through carry with result in acc rotate data memory right through carry rotate data memory left with result in acc rotate data memory left rotate data memory left through carry with result in acc rotate data memory left through carry none none c c none none c c data move mov a,[m] mov [m],a mov a,x move data memory to acc move acc to data memory move immediate data to acc none none none bit operation clr [m].i set [m].i clear bit of data memory set bit of data memory none none HT82K68A rev. 1.10 15 november 20, 2001
mnemonic description flag affected branch jmp addr sz [m] sza [m] sz [m].i snz [m].i siz [m] sdz [m] siza [m] sdza [m] call addr ret ret a,x reti jump unconditionally skip if data memory is zero skip if data memory is zero with data movement to acc skip if bit i of data memory is zero skip if bit i of data memory is not zero skip if increment data memory is zero skip if decrement data memory is zero skip if increment data memory is zero with result in acc skip if decrement data memory is zero with result in acc subroutine call return from subroutine return from subroutine and load immediate data to acc return from interrupt none none none none none none none none none none none none none table read tabrdc [m] tabrdl [m] read rom code (current page) to data memory and tblh read rom code (last page) to data memory and tblh none none miscellaneous nop clr [m] set [m] clr wdt clr wdt1 clr wdt2 swap [m] swapa [m] halt no operation clear data memory set data memory clear watchdog timer pre-clear watchdog timer pre-clear watchdog timer swap nibbles of data memory swap nibbles of data memory with result in acc enter power down mode none none none to,pd to*,pd* to*,pd* none none to,pd note: x: 8 bits immediate data m: data memory address a: accumulator i: 0~7 number of bits addr: program memory address : flag is affected  : flag is not affected *: flag(s) may be affected by the execution status HT82K68A rev. 1.10 16 november 20, 2001
instruction definition adc a,[m] add data memory and carry to the accumulator description the contents of the specified data memory, accumulator and the carry flag are added si - multaneously, leaving the result in the accumulator. operation acc acc+[m]+c affected flag(s) tc2 tc1 to pd ov z ac c  adcm a,[m] add the accumulator and carry to data memory description the contents of the specified data memory, accumulator and the carry flag are added si - multaneously, leaving the result in the specified data memory. operation [m] acc+[m]+c affected flag(s) tc2 tc1 to pd ov z ac c  add a,[m] add data memory to the accumulator description the contents of the specified data memory and the accumulator are added. the result is stored in the accumulator. operation acc acc+[m] affected flag(s) tc2 tc1 to pd ov z ac c  add a,x add immediate data to the accumulator description the contents of the accumulator and the specified data are added, leaving the result in the accumulator. operation acc acc+x affected flag(s) tc2 tc1 to pd ov z ac c  addm a,[m] add the accumulator to the data memory description the contents of the specified data memory and the accumulator are added. the result is stored in the data memory. operation [m] acc+[m] affected flag(s) tc2 tc1 to pd ov z ac c  HT82K68A rev. 1.10 17 november 20, 2001
and a,[m] logical and accumulator with data memory description data in the accumulator and the specified data memory perform a bitwise logical_and op - eration. the result is stored in the accumulator. operation acc acc  and  [m] affected flag(s) tc2 tc1 to pd ov z ac c   and a,x logical and immediate data to the accumulator description data in the accumulator and the specified data perform a bitwise logical_and operation. the result is stored in the accumulator. operation acc acc  and  x affected flag(s) tc2 tc1 to pd ov z ac c   andm a,[m] logical and data memory with the accumulator description data in the specified data memory and the accumulator perform a bitwise logical_and op - eration. the result is stored in the data memory. operation [m] acc  and  [m] affected flag(s) tc2 tc1 to pd ov z ac c   call addr subroutine call description the instruction unconditionally calls a subroutine located at the indicated address. the program counter increments once to obtain the address of the next instruction, and pushes this onto the stack. the indicated address is then loaded. program execution continues with the instruction at this address. operation stack pc+1 pc addr affected flag(s) tc2 tc1 to pd ov z ac c    clr [m] clear data memory description the contents of the specified data memory are cleared to 0. operation [m] 00h affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 18 november 20, 2001
clr [m].i clear bit of data memory description the bit i of the specified data memory is cleared to 0. operation [m].i 0 affected flag(s) tc2 tc1 to pd ov z ac c    clr wdt clear watchdog timer description the wdt and the wdt prescaler are cleared (re-counting from 0). the power down bit (pd) and time-out bit (to) are cleared. operation wdt and wdt prescaler 00h pd and to 0 affected flag(s) tc2 tc1 to pd ov z ac c  00  clr wdt1 preclear watchdog timer description the to, pd flags, wdt and the wdt prescaler has cleared (re-counting from 0), if the other preclear wdt instruction has been executed. only execution of this instruction with - out the other preclear instruction just sets the indicated flag which implies this instruction has been executed and the to and pd flags remain unchanged. operation wdt and wdt prescaler 00h* pd and to 0* affected flag(s) tc2 tc1 to pd ov z ac c  0* 0*  clr wdt2 preclear watchdog timer description the to, pd flags, wdt and the wdt prescaler are cleared (re-counting from 0), if the other preclear wdt instruction has been executed. only execution of this instruction with - out the other preclear instruction, sets the indicated flag which implies this instruction has been executed and the to and pd flags remain unchanged. operation wdt and wdt prescaler 00h* pd and to 0* affected flag(s) tc2 tc1 to pd ov z ac c  0* 0*  cpl [m] complement data memory description each bit of the specified data memory is logically complemented (1s complement). bits which previously containe d a 1 are changed to 0 and vice-versa. operation [m] [m ] affected flag(s) tc2 tc1 to pd ov z ac c   HT82K68A rev. 1.10 19 november 20, 2001
cpla [m] complement data memory and place result in the accumulator description each bit of the specified data memory is logically complemented (1s complement). bits which previously contained a 1 are changed to 0 and vice-versa. the complemented result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc [m ] affected flag(s) tc2 tc1 to pd ov z ac c   daa [m] decimal-adjust accumulator for addition description the accumulator value is adjusted to the bcd (binary coded decimal) code. the accumu - lator is divided into two nibbles. each nibble is adjusted to the bcd code and an internal carry (ac1) will be done if the low nibble of the accumulator is greater than 9. the bcd ad - justment is done by adding 6 to the original value if the original value is greater than 9 or a carry (ac or c) is set; otherwise the original value remains unchanged. the result is stored in the data memory and only the carry flag (c) may be affected. operation if acc.3~acc.0 >9 or ac=1 then [m].3~[m].0 (acc.3~acc.0)+6, ac1=ac else [m].3~[m].0) (acc.3~acc.0), ac1=0 and if acc.7~acc.4+ac1 >9 or c=1 then [m].7~[m].4 acc.7~acc.4+6+ac1,c=1 else [m].7~[m].4 acc.7~acc.4+ac1,c=c affected flag(s) tc2 tc1 to pd ov z ac c    dec [m] decrement data memory description data in the specified data memory is decremented by 1. operation [m] [m]  1 affected flag(s) tc2 tc1 to pd ov z ac c   deca [m] decrement data memory and place result in the accumulator description data in the specified data memory is decremented by 1, leaving the result in the accumula - tor. the contents of the data memory remain unchanged. operation acc [m]  1 affected flag(s) tc2 tc1 to pd ov z ac c   HT82K68A rev. 1.10 20 november 20, 2001
halt enter power down mode description this instruction stops program execution and turns off the system clock. the contents of the ram and registers are retained. the wdt and prescaler are cleared. the power down bit (pd) is set and the wdt time-out bit (to) is cleared. operation pc pc+1 pd 1 to 0 affected flag(s) tc2 tc1 to pd ov z ac c  01  inc [m] increment data memory description data in the specified data memory is incremented by 1 operation [m] [m]+1 affected flag(s) tc2 tc1 to pd ov z ac c   inca [m] increment data memory and place result in the accumulator description data in the specified data memory is incremented by 1, leaving the result in the accumula - tor. the contents of the data memory remain unchanged. operation [m]+1 affected flag(s) tc2 tc1 to pd ov z ac c   jmp addr directly jump description bits of the program counter are replaced with the directly-specified address uncondition- ally, and control is passed to this destination. operation pc addr affected flag(s) tc2 tc1 to pd ov z ac c    mov a,[m] move data memory to the accumulator description the contents of the specified data memory are copied to the accumulator. operation acc [m] affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 21 november 20, 2001
mov a,x move immediate data to the accumulator description the 8-bit data specified by the code is loaded into the accumulator. operation acc x affected flag(s) tc2 tc1 to pd ov z ac c    mov [m],a move the accumulator to data memory description the contents of the accumulator are copied to the specified data memory (one of the data memories). operation [m] acc affected flag(s) tc2 tc1 to pd ov z ac c    nop no operation description no operation is performed. execution continues with the next instruction. operation pc pc+1 affected flag(s) tc2 tc1 to pd ov z ac c    or a,[m] logical or accumulator with data memory description data in the accumulator and the specified data memory (one of the data memories) per- form a bitwise logical_or operation. the result is stored in the accumulator. operation acc acc  or  [m] affected flag(s) tc2 tc1 to pd ov z ac c   or a,x logical or immediate data to the accumulator description data in the accumulator and the specified data perform a bitwise logical_or operation. the result is stored in the accumulator. operation acc acc  or  x affected flag(s) tc2 tc1 to pd ov z ac c   orm a,[m] logical or data memory with the accumulator description data in the data memory (one of the data memories) and the accumulator perform a bitwise logical_or operation. the result is stored in the data memory. operation [m] acc  or  [m] affected flag(s) tc2 tc1 to pd ov z ac c   HT82K68A rev. 1.10 22 november 20, 2001
ret return from subroutine description the program counter is restored from the stack. this is a 2-cycle instruction. operation pc stack affected flag(s) tc2 tc1 to pd ov z ac c    ret a,x return and place immediate data in the accumulator description the program counter is restored from the stack and the accumulator loaded with the speci - fied 8-bit immediate data. operation pc stack acc x affected flag(s) tc2 tc1 to pd ov z ac c    reti return from interrupt description the program counter is restored from the stack, and interrupts are enabled by setting the emi bit. emi is the enable master (global) interrupt bit (bit 0; register intc). operation pc stack emi 1 affected flag(s) tc2 tc1 to pd ov z ac c    rl [m] rotate data memory left description the contents of the specified data memory are rotated 1 bit left with bit 7 rotated into bit 0. operation [m].(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) [m].0 [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    rla [m] rotate data memory left and place result in the accumulator description data in the specified data memory is rotated 1 bit left with bit 7 rotated into bit 0, leaving the rotated result in the accumulator. the contents of the data memory remain unchanged. operation acc.(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) acc.0 [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 23 november 20, 2001
rlc [m] rotate data memory left through carry description the contents of the specified data memory and the carry flag are rotated 1 bit left. bit 7 re - places the carry bit; the original carry flag is rotated into the bit 0 position. operation [m].(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) [m].0 c c [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    rlca [m] rotate left through carry and place result in the accumulator description data in the specified data memory and the carry flag are rotated 1 bit left. bit 7 replaces the carry bit and the original carry flag is rotated into bit 0 position. the rotated result is stored in the accumulator but the contents of the data memory remain unchanged. operation acc.(i+1) [m].i; [m].i:bit i of the data memory (i=0~6) acc.0 c c [m].7 affected flag(s) tc2 tc1 to pd ov z ac c    rr [m] rotate data memory right description the contents of the specified data memory are rotated 1 bit right with bit 0 rotated to bit 7. operation [m].i [m].(i+1); [m].i:bit i of the data memory (i=0~6) [m].7 [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    rra [m] rotate right and place result in the accumulator description data in the specified data memory is rotated 1 bit right with bit 0 rotated into bit 7, leaving the rotated result in the accumulator. the contents of the data memory remain unchanged. operation acc.(i) [m].(i+1); [m].i:bit i of the data memory (i=0~6) acc.7 [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    rrc [m] rotate data memory right through carry description the contents of the specified data memory and the carry flag are together rotated 1 bit right. bit 0 replaces the carry bit; the original carry flag is rotated into the bit 7 position. operation [m].i [m].(i+1); [m].i:bit i of the data memory (i=0~6) [m].7 c c [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 24 november 20, 2001
rrca [m] rotate right through carry and place result in the accumulator description data of the specified data memory and the carry flag are rotated 1 bit right. bit 0 replaces the carry bit and the original carry flag is rotated into the bit 7 position. the rotated result is stored in the accumulator. the contents of the data memory remain unchanged. operation acc.i [m].(i+1); [m].i:bit i of the data memory (i=0~6) acc.7 c c [m].0 affected flag(s) tc2 tc1 to pd ov z ac c    sbc a,[m] subtract data memory and carry from the accumulator description the contents of the specified data memory and the complement of the carry flag are sub - tracted from the accumulator, leaving the result in the accumulator. operation acc acc+[m ]+c affected flag(s) tc2 tc1 to pd ov z ac c  sbcm a,[m] subtract data memory and carry from the accumulator description the contents of the specified data memory and the complement of the carry flag are sub - tracted from the accumulator, leaving the result in the data memory. operation [m] acc+[m ]+c affected flag(s) tc2 tc1 to pd ov z ac c  sdz [m] skip if decrement data memory is 0 description the contents of the specified data memory are decremented by 1. if the result is 0, the next instruction is skipped. if the result is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruc - tion (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]  1)=0, [m] ([m]  1) affected flag(s) tc2 tc1 to pd ov z ac c    sdza [m] decrement data memory and place result in acc, skip if 0 description the contents of the specified data memory are decremented by 1. if the result is 0, the next instruction is skipped. the result is stored in the accumulator but the data memory remains unchanged. if the result is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cy - cles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]  1)=0, acc ([m]  1) affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 25 november 20, 2001
set [m] set data memory description each bit of the specified data memory is set to 1. operation [m] ffh affected flag(s) tc2 tc1 to pd ov z ac c    set [m]. i set bit of data memory description bit i of the specified data memory is set to 1. operation [m].i 1 affected flag(s) tc2 tc1 to pd ov z ac c    siz [m] skip if increment data memory is 0 description the contents of the specified data memory are incremented by 1. if the result is 0, the fol - lowing instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]+1)=0, [m] ([m]+1) affected flag(s) tc2 tc1 to pd ov z ac c    siza [m] increment data memory and place result in acc, skip if 0 description the contents of the specified data memory are incremented by 1. if the result is 0, the next instruction is skipped and the result is stored in the accumulator. the data memory re- mains unchanged. if the result is 0, the following instruction, fetched during the current in- struction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if ([m]+1)=0, acc ([m]+1) affected flag(s) tc2 tc1 to pd ov z ac c    snz [m].i skip if bit i of the data memory is not 0 description if bit i of the specified data memory is not 0, the next instruction is skipped. if bit i of the data memory is not 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). other - wise proceed with the next instruction (1 cycle). operation skip if [m].i  0 affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 26 november 20, 2001
sub a,[m] subtract data memory from the accumulator description the specified data memory is subtracted from the contents of the accumulator, leaving the result in the accumulator. operation acc acc+[m ]+1 affected flag(s) tc2 tc1 to pd ov z ac c  subm a,[m] subtract data memory from the accumulator description the specified data memory is subtracted from the contents of the accumulator, leaving the result in the data memory. operation [m] acc+[m ]+1 affected flag(s) tc2 tc1 to pd ov z ac c  sub a,x subtract immediate data from the accumulator description the immediate data specified by the code is subtracted from the contents of the accumula - tor, leaving the result in the accumulator. operation acc acc+x +1 affected flag(s) tc2 tc1 to pd ov z ac c  swap [m] swap nibbles within the data memory description the low-order and high-order nibbles of the specified data memory (1 of the data memo- ries) are interchanged. operation [m].3~[m].0  [m].7~[m].4 affected flag(s) tc2 tc1 to pd ov z ac c    swapa [m] swap data memory and place result in the accumulator description the low-order and high-order nibbles of the specified data memory are interchanged, writ - ing the result to the accumulator. the contents of the data memory remain unchanged. operation acc.3~acc.0 [m].7~[m].4 acc.7~acc.4 [m].3~[m].0 affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 27 november 20, 2001
sz [m] skip if data memory is 0 description if the contents of the specified data memory are 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if [m]=0 affected flag(s) tc2 tc1 to pd ov z ac c    sza [m] move data memory to acc, skip if 0 description the contents of the specified data memory are copied to the accumulator. if the contents is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if [m]=0 affected flag(s) tc2 tc1 to pd ov z ac c    sz [m].i skip if bit i of the data memory is 0 description if bit i of the specified data memory is 0, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruc - tion (2 cycles). otherwise proceed with the next instruction (1 cycle). operation skip if [m].i=0 affected flag(s) tc2 tc1 to pd ov z ac c    tabrdc [m] move the rom code (current page) to tblh and data memory description the low byte of rom code (current page) addressed by the table pointer (tblp) is moved to the specified data memory and the high byte transferred to tblh directly. operation [m] rom code (low byte) tblh rom code (high byte) affected flag(s) tc2 tc1 to pd ov z ac c    tabrdl [m] move the rom code (last page) to tblh and data memory description the low byte of rom code (last page) addressed by the table pointer (tblp) is moved to the data memory and the high byte transferred to tblh directly. operation [m] rom code (low byte) tblh  code (high byte) affected flag(s) tc2 tc1 to pd ov z ac c    HT82K68A rev. 1.10 28 november 20, 2001
xor a,[m] logical xor accumulator with data memory description data in the accumulator and the indicated data memory perform a bitwise logical exclu - sive_or operation and the result is stored in the accumulator. operation acc acc  xor  [m] affected flag(s) tc2 tc1 to pd ov z ac c   xorm a,[m] logical xor data memory with the accumulator description data in the indicated data memory and the accumulator perform a bitwise logical exclu - sive_or operation. the result is stored in the data memory. the 0 flag is affected. operation [m] acc  xor  [m] affected flag(s) tc2 tc1 to pd ov z ac c   xor a,x logical xor immediate data to the accumulator description data in the accumulator and the specified data perform a bitwise logical exclusive_or op - eration. the result is stored in the accumulator. the 0 flag is affected. operation acc acc  xor  x affected flag(s) tc2 tc1 to pd ov z ac c   HT82K68A rev. 1.10 29 november 20, 2001
HT82K68A rev. 1.10 30 november 20, 2001 copyright  2001 by holtek semiconductor inc. the information appearing in this data sheet is believed to be accurate at the time of publication. however, holtek as - sumes no responsibility arising from the use of the specifications described. the applications mentioned herein are used solely for the purpose of illustration and holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. holtek reserves the right to alter its products without prior notification. for the most up-to-date information, please visit our web site at http://www.holtek.com.tw. holtek semiconductor inc. (headquarters) no.3, creation rd. ii, science-based industrial park, hsinchu, taiwan tel: 886-3-563-1999 fax: 886-3-563-1189 http://www.holtek.com.tw holtek semiconductor inc. (sales office) 11f, no.576, sec.7 chung hsiao e. rd., taipei, taiwan tel: 886-2-2782-9635 fax: 886-2-2782-9636 fax: 886-2-2782-7128 (international sales hotline) holtek semiconductor (shanghai) inc. 7th floor, building 2, no.889, yi shan rd., shanghai, china tel: 021-6485-5560 fax: 021-6485-0313 http://www.holtek.com.cn holtek semiconductor (hong kong) ltd. rm.711, tower 2, cheung sha wan plaza, 833 cheung sha wan rd., kowloon, hong kong tel: 852-2-745-8288 fax: 852-2-742-8657 holmate semiconductor, inc. 48531 warm springs boulevard, suite 413, fremont, ca 94539 tel: 510-252-9880 fax: 510-252-9885 http://www.holmate.com


▲Up To Search▲   

 
Price & Availability of HT82K68A

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X