![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
ht48ra0 8-bit microcontroller 1 october 27, 1999 features operating voltage: 2.9v~5.2v ten bidirectional i/o lines six schmitt trigger input lines one carrier output (1/2 or 1/3 duty) on-chip crystal and rc oscillator watchdog timer 1k 14 program eprom 32 8 data ram low voltage reset function halt function and wake-up feature reduce power consumption 62 powerful instructions up to 1 s instruction cycle with 4mhz system clock all instructions in 1 or 2 machine cycles 14-bit table read instructions one-level subroutine nesting bit manipulation instructions 20-pin dip-a/sop-a package 24-pin sop-a package general description the ht48ra0 is an 8-bit high performance risc-like microcontroller specifically designed for multiple i/o product applications. the de - vice is particularly suitable for use in products such as remote controllers, fan/light control - lers, washing machine controllers, scales, toys and various subsystem controllers. a halt fea - ture is included to reduce power consumption.
block diagram ht48ra0 2 october 27, 1999 ! " # $%& '# ()* + ,- # . / /%/& ( # 0 .0## $) # $ 0 #/ /$%/ pin assignment pad assignment * the ic substrate should be connected to vss in the pcb layout artwork. ht48ra0 3 october 27, 1999 $ / /$ $) 1 * 2 3 & / /1 /* /2 1 * 2 3 & / /1 /* /2 /3 /& $ / /$ $) 1 * 2 3 & / /1 /* /2 $ / /$ $) 4 4 * 1 $ 5 6 & 3 2 * 1 1 * 2 3 & 6 5 $ $ 5 6 & 3 2 * 1 1 * 2 3 & 6 5 $ $ 5 6 & 3 2 * 1 1 * 2 3 & 6 5 $ # # 1# *# 2# 3# 6# 5# $# # 1# *# 2# 3# 6# 5# $# # 7$ 8$ 9# /$ /* /2 /3 /& 2 3 & / /1 * 1 $ / $) pad description pad name i/o code option function pb0, pb1 i/o wake-up or none 2-bit bidirectional input/output lines with pull-high resistors. each bit can be determined as nmos output or schmitt trigger in - put by software instructions. each bit can also be configured as wake-up input by code option. pc0/rem o level or carrier level or carrier output pin pc0 can be set as cmos output pin or carrier output pin by code option. vdd positive power supply osc2 osc1 i o crystal or rc osc1, osc2 are connected to an rc network or a crystal (deter - mined by code option) for the internal system clock. in the case of rc operation, osc2 is the output terminal for 1/4 system clock (nmos open drain output). vss negative power supply, gnd res i schmitt trigger reset input. active low. pb2~pb7 i wake-up or none 6-bit schmitt trigger input lines with pull-high resistors. each bit can be configured as a wake-up input by code option. pa0~pa7 i/o bidirectional 8-bit input/output port with pull-high resistors. each bit can be determined as nmos output or schmitt trigger in - put by software instructions. 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 maxi- mum 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 expo- sure to extreme conditions may affect device reliability. ht48ra0 4 october 27, 1999 d.c. characteristics ta=25 c symbol parameter test conditions min. typ. max. unit v dd conditions v dd operating voltage f sys =2mhz v lvr 5.2 v v dd operating voltage f sys =4mhz 3 5.2 v i dd operating current 3v no load, f sys =4mhz 0.7 1.5 ma i stb standby current 3v no load, system halt 1 a v il1 input low voltage for i/o ports 3v 0 1.05 v v ih1 input high voltage for i/o ports 3v 1.95 3v v il2 input low voltage (res )3v 1.5 v v ih2 input high voltage (res )3v 2.4 v i ol i/o ports sink current 3v v ol =0.3v 1.5 2.5 ma i oh i/o ports source current 3v v oh =2.7v 1 1.5 ma r ph1 pull-high resistance of pa port, pb0~pb1 and res 3v 60 k r ph2 pull-high resistance of pb2~pb7 3v 60 k v lvr low voltage reset 3v 2.3 2.6 2.9 v a.c. characteristics ta=25 c symbol parameter test conditions min. typ. max. unit v dd conditions f sys system clock 3v 400 4000 khz 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 note: t sys =1/f sys ht48ra0 5 october 27, 1999 ht48ra0 6 october 27, 1999 functional description execution flow the ht48ra0 system clock can be derived from a crystal/ceramic resonator oscillator. it is in - ternally divided into four non-overlapping clocks. one instruction 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 decoding and execution takes the next instruction cycle. however, the pipelining scheme causes each instruction to ef - fectively execute within one cycle. if an instruc - tion changes the program counter, two cycles are required to complete the instruction. program counter pc the 10-bit program counter (pc) controls the sequence in which the instructions stored in program eprom are executed and its contents specify a maximum of 1024 addresses. after accessing a program memory word to fetch an instruction 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 execution, loading pcl register, subrou- tine call, initial reset or return from subroutine, the pc manipulates the program transfer by loading the address corresponding to each in - struction. the conditional skip is activated by instruction. once the condition is met, the next instruction, fetched during the current instruction execu - tion, is discarded and a dummy cycle replaces it to get the proper instruction. otherwise pro - ceed with the next instruction. the lower byte of the program counter (pcl) is a readable and writeable register (06h). moving data into the pcl performs a short jump. the destination will be within 256 loca - tions. when a control transfer takes place, an addi - tional dummy cycle is required. program memory eprom the program memory is used to store the pro - gram instructions which are to be executed. it also contains data and table and is organized into 1024 14 bits, addressed by the program counter and table pointer. certain locations in the program memory are reserved for special usage: location 000h this area is reserved for the initialization program. after chip reset, the program al- ways begins execution at location 000h. 1 * 1 * 1 * , ! #4 #7 9 : #4 #7 ;9 , ! #4 #7 < 9 : #4 #7 9 , ! #4 #7 < 9 : #4 #7 <9 < < # 0= # 0 execution flow ht48ra0 7 october 27, 1999 mode program counter *9 *8 *7 *6 *5 *4 *3 *2 *1 *0 initial reset 0000000000 skip pc+2 loading pcl *9 *8 @7 @6 @5 @4 @3 @2 @1 @0 jump, call branch #9 #8 #7 #6 #5 #4 #3 #2 #1 #0 return from subroutine s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 program counter note: *9~*0: program counter bits #9~#0: instruction code bits s9~s0: stack register bits @7~@0: pcl bits table location any location in the eprom space can be used as look-up tables. the instructions tabrdc [m] (the current page, 1 page=256 words) and tabrdl [m] (the last page) transfer the con - tents 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 trans - ferred to the lower portion of tblh, the re - maining 2 bits are read as 0 . the table higher-order byte register (tblh) is read only. the table pointer (tblp) is a read/write register (07h), where p indicates the table lo - cation. before accessing the table, the loca - tion must be placed in tblp. the tblh is read only and cannot be restored. all table re - lated 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 used to save the contents of the program counter (pc) only. the stack is organized into one level 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 the contents of the program counter are pushed onto the stack. at the end of a subroutine signaled by a return instruction (ret), the program counter is re - stored to its previous value from the stack. af - ter a chip reset, the sp will point to the top of the stack. if the stack is full and a call is subsequently executed, stack overflow occurs and the first en- try will be lost (only the most recent return ad- dress is stored). $$$> .# 0? #@ *#a =;@# a0#723#b 9 $$> =;@# a0#723#b 9 1,,> 4 c# # #" #$# #1 ,,> program memory ht48ra0 8 october 27, 1999 instruction(s) table location *9 *8 *7 *6 *5 *4 *3 *2 *1 *0 tabrdc [m] p9 p8 @7 @6 @5 @4 @3 @2 @1 @0 tabrdl [m] 1 1 @7 @6 @5 @4 @3 @2 @1 @0 table location note: *9~*0: table location bits @7~@0: table pointer bits p9~p8: current program counter bits data memory ram the data memory is designed with 42 8 bits. the data memory is divided into two functional groups: special function registers and general purpose data memory (32 8). most of them are read/write, but some are read only. the special function registers include the indirect addressing register (00h), the memory pointer register (mp;01h), the accumulator (acc;05h) the program counter lower-order byte register (pcl;06h), the table pointer (tblp;07h), the ta - ble higher-order byte register (tblh;08h), the status register (status;0ah) and the i/o regis - ters (pa;12h, pb;14h, pc;16h). the remaining space before the 20h is reserved for future ex - panded usage and reading these locations will re - turn the result 00h. the general purpose data memory, addressed from 20h to 3fh, is used for data and control information under instruction command. all data memory areas can handle arithmetic, logic, increment, decrement and rotate opera - tions directly. except for some dedicated bits, each bit in the data memory can be set and re - set by the set [m].i and clr [m].i instructions, respectively. they are also indirectly accessible through memory pointer register (mp;01h). indirect addressing register location 00h is an indirect addressing register that is not physically implemented. any read/write operation of [00h] accesses data memory pointed to by mp (01h). reading loca- 0# @ # ' 71#/ 9 @0# @ # ' $$> $> $> $1> $*> $2> $3> $&> $6> $5> $ > $/ > $ > $ > $ > $,> $> > > 1> *> 2> 3> &> 6> 5> > / > > > > ,> 1,> # # / / > / c# ##d$$d $> ram mapping ht48ra0 9 october 27, 1999 tion 00h itself indirectly will return the result 00h. writing indirectly results in no operation. the memory pointer register mp (01h) is a 6-bit register. the bit 7~6 of mp is undefined and reading will return the result 1 . any writ - ing operation to mp will only transfer the lower 6-bit data to mp. accumulator the accumulator closely relates to alu opera - tions. it is also mapped to location 05h of the data memory and is capable of carrying out im - mediate data operations. data movement be - tween two data memory locations has to 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 op - eration but also changes the contents of the sta - tus register. status register status this 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 watchdog time-out flag (to). it also records the status information and controls the operation se - quence. with the exception of the to and pd flags, bits in the status register can be altered by instruc - tions like most other register. any data written into the status register will not change the to or pd flags. in addition 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 the watchdog timer overflow, chip power-up, clear - ing the watchdog timer and executing the halt instruction. labels bits function c0 c is set if the operation results in a carry during an addition operation or if a bor- row 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 the operation results in a carry out of the low nibbles in addition or no borrow from the high nibble into the low nibble in subtraction; otherwise ac is cleared. z2 z is set if the result of an arithmetic or logic operation is zero; otherwise z is cleared. ov 3 ov is set if the 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 in - struction. pd is set by executing the halt instruction. to 5 to is cleared by a system power-up or executing the clr wdt or halt instruc - tion. to is set by a wdt time-out. 6 undefined, read as 0 7 undefined, read as 0 status register ht48ra0 10 october 27, 1999 the z, ov, ac and c flags generally reflect the status of the latest operations. in addition, on executing the subroutine call, the status register will not be automatically pushed onto the stack. if the contents of the sta - tus are important and if the subroutine can cor - rupt the status register, precautions must be taken to save it properly. oscillator configuration there are two oscillator circuits in the ht48ra0. both are designed for system clocks; the rc os - cillator and the crystal oscillator, which are de - termined by code options. no matter what oscillator type is selected, the signal provides the system clock. the halt mode stops the system oscillator and ignores the external sig- nal to conserve power. if an rc oscillator is used, an external resistor between osc1 and vss in needed and the re- sistance must range from 51k to 1m . the system clock, divided by 4, is available on osc2, which can be used to synchronize exter - nal logic. the rc oscillator provides the most cost effective solution. however, the frequency of the oscillation may vary with v dd , tempera - ture and the chip itself due to process varia - tions. it is, therefore, not suitable for timing sensitive operations where accurate oscillator frequency is desired. if the crystal oscillator is used, a crystal across osc1 and osc2 is needed to provide the feed - back and phase shift for the oscillator. no other external components are needed. instead of a crystal, the resonator can also be connected be - tween osc1 and osc2 to get a frequency refer - ence, but two external capacitors in osc1 and osc2 are required. watchdog timer wdt the clock source of the wdt is implemented by instruction clock (system clock divided by 4). the clock source is processed by a frequency di - vider and a prescaller to yield various time out periods. wdt time out period = clock source 2 n where n= 8~11 selected by code option. this timer is designed to prevent a software malfunction or sequence jumping to an un- known location with unpredictable results. the watchdog timer can be disabled by code option. if the watchdog timer is disabled, all the exe- cutions related to the wdt result in no opera- 0# 00 # 00 " ' )* 74 #@ # @ 9 system oscillator 0=# 7 # 0=)*9 1;a # 00 76 ;a 9 + ; #@ 0 @ 0#+ ,- # . 0=# 7 e6%9 watchdog timer ht48ra0 11 october 27, 1999 tion and the wdt will lose its protection purpose. in this situation the logic can only be restarted by an external logic. a wdt overflow under normal operation will ini - tialize chip reset and set the status bit to .to clear the contents of the wdt prescaler, three methods are adopted; external reset (a low level to res ), software instructions, or a halt in - struction. there are two types of software in - structions. one type is the single instruction clr wdt , the other type comprises two in - structions, clr wdt1 and clr wdt2 .of these two types of instructions, only one can be active depending on the code option clr wdt times selection option .ifthe clr wdt is se - lected (i.e.. clrwdt times equal one), any execu - tion of the clr wdt instruction will clear the wdt. in case clr wdt1 and clr wdt2 are chosen (i.e.. clrwdt times equal two), these two instructions must be executed to clear the wdt; otherwise, the wdt may reset the chip due to a time-out. power down operation halt the halt mode is initialized by the halt in - struction and results in the following... the system oscillator turns off and the wdt stops. the contents of the on-chip ram and regis- ters remain unchanged. wdt prescaler are cleared. all i/o ports maintain their original status. the pd flag is set and the to flag is cleared. the system can quit the halt mode by means of an external reset or an external falling edge signal on port b. an external reset causes a de - vice initialization. examining the to and pd flags, the reason for chip reset can be deter - mined. the pd flag is cleared when the system powers up or execute the clr wdt instruction and is set when the halt instruction is exe - cuted. the to flag is set if the wdt time-out oc - curs, and causes a wake-up that only resets the pc (program counter) and sp, the others keep their original status. the port b wake-up can be considered as a con - tinuation of normal execution. each bit in port b can be independently selected to wake up the device by the code option. awakening from an i/o port stimulus, the program will resume exe - cution of the next instruction. once a wake-up event(s) occurs, it takes 1024 t sys (system clock period) to resume normal op - eration. in other words, a dummy cycle period will be inserted after the wake-up. 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: res reset during normal operation res reset during halt wdt time-out reset during normal operation some registers remain unchanged during reset conditions. most registers are reset to the ini- tial condition when the reset conditions are met. by examining the pd and to flags, the program can distinguish between different chip resets . to pd reset conditions 0 0 res reset during power-up uu res reset during normal operation 0 1 res wake-up halt 1u wdt time-out during normal operation note: u means unchanged . ht48ra0 12 october 27, 1999 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 system powers up or when the system awakes from a halt state. when a system power up occurs, an sst delay is added during the reset period. but when the reset comes from the res pin, the sst delay is disabled. any wake-up from halt will enable the sst delay. the functional unit chip reset status is shown be - low. pc 000h wdt prescaler clear input/output ports input mode sp points to the top of the stack carrier output low level + > + ; b; # $; @@0# # reset configuration reset circuit the chip reset status of the registers is summarized in the following table: register reset (power on) wdt time-out (normal operation) res reset (normal operation) res reset (halt) pc (program counter) 000h 000h 000h 000h mp -xxx xxxx -uuu uuuu -uuu uuuu -uuu uuuu acc xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu tblp xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu tblh --xx xxxx --uu uuuu --uu uuuu --uu uuuu status --00 xxxx --1u uuuu --uu uuuu --01 uuuu pa 1111 1111 1111 1111 1111 1111 1111 1111 pb 1111 1111 1111 1111 1111 1111 1111 1111 pc ---- ---1 ---- ---1 ---- ---1 ---- ---1 note: u means unchanged x means unknown # ; !@## reset timing chart ht48ra0 13 october 27, 1999 low voltage reset lvr the ht48ra0 provides low voltage reset cir - cuit in order to monitor the supply voltage of the device. if the supply voltage of the device is within the range 0.9v~2.6v, such as changing a battery, the lvr will automatically reset the device internally. the lvr includes the following specifications: the low voltage (0.9v~2.6v) has to remain in their original state to exceed 1 ms. if the low voltage state does not exceed 1 ms, the lvr will ignore it and do not perform a reset func - tion. the lvr uses the or function with the exter - nal res signal to perform chip reset. during halt mode, if the lvr occurs, the device will wake-up and the pd flag will be set as 1 , the same as the external res . because the operating voltage (v dd )is 2.6v~5.2v and the lvr operating voltage (v lvr ) is 0.9v~2.6v, therefore one margin volt - age about 0.1v is needed for proper chip opera - tion. the relationship between v dd and v lvr is shown below. note: v opr is the voltage range for proper chip operation at 2mhz system clock. carrier the ht48ra0 provides a carrier output which shares the pin with pc0. it can be selected to be a carrier output (rem) or level output pin (pc0) by code option. if the carrier output op - tion is selected, setting pc0= 0 to enable car - rier output and setting pc0= 1 to disable it at low level output. 2f $f5 $ # 0 g g 4 0#@ # #.0 e#$f5%f3 low voltage reset 2f f3 f* $f5 2f *1: to make sure that the system oscillator has stabilized, the sst provides an extra delay of 1024 system clock pulses before entering the normal operation. *2: since the low voltage has to maintain in its original state and exceed 1 ms, therefore 1 ms delay is needed to enter the reset mode. ht48ra0 14 october 27, 1999 0=# 7 # 0=)*9 1;a # #@ ) )1 ,- # . #@ !#"#; ";b $ # # )$ # @ 7 # #0 . 09 # 0 )##)1# .0 .0 carrier/level output # 00;@ /%/& #a #+ =;@ # @ pb input lines the clock source of the carrier is implemented by instruction clock (system clock divided by 4) and processed by a frequency divider to yield various carry frequency. carry frequency= clock source m2 n where m=2 or 3 and n=0~3, both are selected by code option. if m=2, the duty cycle of the carrier output is 1/2 duty. if m=3, the duty cycle of the carrier output can be 1/2 duty or 1/3 duty also determined by code option (with the exception of n=0). detailed selection of the carrier duty is shown below: m 2 n duty cycle 2, 4, 8, 16 1/2 3 1/3 6, 12, 24 1/2 or 1/3 input/output ports there are an 8-bit bidirectional input/output port, a 6-bit input with 2-bit i/o port and one-bit output port in the ht48ra0, labeled pa, pb and pc which are mapped to [12h], [14h], [16h] of the ram, respectively. each bit of pa can be selected as nmos output or schmitt trigger with pull-high resistor by soft - ware instruction. pb0~pb1 have the same structure with pa, while pb2~pb7 can only be used for input operation (schmitt trigger with pull-high resistors). pc is only one-bit output port shares the pin with carrier output. if the level option is selected, the pc is cmos output. both pa and pb for the input operation, these ports are non-latched, that is, the inputs should be ready at the t2 rising edge of the instruction mov a, [m] (m=12h or 14h). for pa, pb0~pb1 and pc output operation, all data are latched and remain unchanged until the output latch is rewritten. when the pa and pb0~pb1 is used for input op - eration, it should be noted that before reading data from pads, a 1 should be written to the related bits to disable the nmos device. that is, the instruction set [m].i (i=0~7 for pa, i=0~1 for pb) is executed first to disable related nmos device, and then mov a, [m] to get stable data. ht48ra0 15 october 27, 1999 h ( h #a + !@# # + = 00;@ $%& /$%/ #+ =;@ # @ /$%/# 0 pa, pb input/output lines after chip reset, pa and pb remain at a high level input line while pc remain at high level output, if the level option is selected. each bit of pa, pb0~pb1 and pc output latches can be set or cleared by the set [m].i and clr [m].i (m=12h, 14h or 16h) instructions respectively. some instructions first input data and then fol - low the output operations. for example, set [m].i , clr [m] , cpl [m] , cpla [m] read the entire port states into the cpu, execute the defined operations (bit-operation), and then write the results back to the latches or to the ac - cumulator. each line of pb has a wake-up capability to the device by code option. the highest seven bits of pc are not physically implemented, on reading them a 0 is returned and writing results in a no-operation. ht48ra0 16 october 27, 1999 code option the following table shows eight kinds of code option in the ht48ra0. all the code options must be defined to ensure proper system functioning. no. code option 1 wdt time-out period selection time-out period= clock source 2 n where n=8~11. 2 wdt enable/disable selection. this option is to decide whether the wdt timer is enabled or disabled. 3 clrwdt times selection. this option defines how 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, the wdt can be cleared. 4 wake-up selection. this option defines the wake-up activity function. external input pins (pb only) all have the capability to wake-up the chip from a halt. 5 carrier/level output selection. this option defines the activity of pc0 to be carrier output or level output. 6 carry frequency selection. carry frequency= clock source (2 or 3) 2 n where n=0~3. 7 carrier duty selection. there are two types of selection: 1/2 duty or 1/3 duty. if carrier frequency= clock source /(2, 4, 8 or 16), the duty cycle will be 1/2 duty. if carrier frequency= clock source /3, the duty cycle will be 1/3 duty. if carrier frequency= clock source /(6, 12 or 24), the duty cycle can be 1/2 duty or 1/3 duty. 8 osc type selection. this option is to decide if an rc or crystal oscillator is chosen as sys- tem clock. if the crystal oscillator is selected, the xst (crystal start-up timer) default is activated, otherwise the xst is disabled. application circuits note: it is recommended that a 0.1 f decoupling capacitor is placed between vss and vdd. if the crystal has a value above 1mhz the capacitors are not required. ht48ra0 17 october 27, 1999 / /1 /* /2 /3 /& & 3 2 * $) $ 1 /$ / $ %*$ 1$$@, 1$$@, i 0 7#4 9 $f , $$= ht48ra0 18 october 27, 1999 instruction set summary mnemonic description instruction cycle 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 with result in data memory decimal adjust acc for addition with result in data memory 1 1 (1) 1 1 1 (1) 1 1 1 (1) 1 1 (1) 1 (1) 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 1 1 1 1 (1) 1 (1) 1 (1) 1 1 1 1 (1) 1 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 1 1 (1) 1 1 (1) z z z z ht48ra0 19 october 27, 1999 mnemonic description instruction cycle flag affected 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 re - sult 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 1 1 (1) 1 1 (1) 1 1 (1) 1 1 (1) 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 1 1 (1) 1 none none none bit operation clr [m].i set [m].i clear bit of data memory set bit of data memory 1 (1) 1 (1) none none 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 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 2 1 (2) 1 (2) 1 (2) 1 (2) 1 (3) 1 (3) 1 (2) 1 (2) 2 2 2 none none none none none none none none none none none none ht48ra0 20 october 27, 1999 mnemonic description instruction cycle flag affected table read tabrdc [m] tabrdl [m] read eprom code (current page) to data memory and tblh read eprom code (last page) to data memory and tblh 2 (1) 2 (1) 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 1 1 (1) 1 (1) 1 1 1 1 (1) 1 1 none none none to,pd to (4) ,pd (4) to (4) ,pd (4) none none to,pd note: x: 8 bits immediate data m: 7 bits data memory address a: accumulator i: 0~7 number of bits addr: 11 bits program memory address : flag(s) is affected : flag(s) is not affected (1) : if a loading to the pcl register occurs, the execution cycle of instructions will be delayed for one more cycle (4 system clocks). (2) : if a skip to the next instruction occurs, the execution cycle of instructions will be delayed for one more cycle (4 system clocks). otherwise the original instruction cycle(s) is unchanged. (3) : (1) and (2) (4) : the flags may be affected by the execution status. if the watchdog timer is cleared by executing the clr wdt1 or clr wdt2 instruction, the to is set and the pd is cleared. otherwise the to and pd flags remain unchanged. 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 simultaneously, 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 simultaneously, 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 ht48ra0 21 october 27, 1999 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 and a,[m] logical and accumulator with data memory description data in the accumulator and the specified data memory perform a bitwise logical_and operation. 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 logi - cal_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 operation. the result is stored in the data memory. operation [m] acc and [m] affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 22 october 27, 1999 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 ad - dress. 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 zero. operation [m] 00h affected flag(s) tc2 tc1 to pd ov z ac c clr [m].i clear bit of data memory description the bit i of the specified data memory is cleared to zero. 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 zero). 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 ht48ra0 23 october 27, 1999 clr wdt1 preclear watchdog timer description the td, pd flags, wdt and the wdt prescaler has cleared (re-counting from zero), if the other preclear wdt instruction has been executed. only ex - ecution of this instruction without the other preclear instruction sets the in - dicated flag which implies that 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 zero), if the other preclear wdt instruction has been executed. only ex - ecution of this instruction without the other preclear instruction sets the in - dicated flag which implies that 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 (1 s comple- ment). bits which previously contained a one are changed to zero and vice-versa. operation [m] [m ] affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 24 october 27, 1999 cpla [m] complement data memory and place result in the accumulator description each bit of the specified data memory is logically complemented (1 s comple - ment). bits which previously contained a one are changed to zero 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 code decimal) code. the accumulator 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 ac - cumulator is greater than 9. the bcd adjustment 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 one. operation [m] [m] 1 affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 25 october 27, 1999 deca [m] decrement data memory and place result in the accumulator description data in the specified data memory is decremented by one, leaving the result in the accumulator. the contents of the data memory remain unchanged. operation acc [m] 1 affected flag(s) tc2 tc1 to pd ov z ac c 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 one. 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 one, leaving the result in the accumulator. the contents of the data memory remain unchanged. operation acc [m]+1 affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 26 october 27, 1999 jmp addr directly jump description the contents of the program counter are replaced with the directly-specified address unconditionally, 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 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 ht48ra0 27 october 27, 1999 or a,[m] logical or accumulator with data memory description data in the accumulator and the specified data memory (one of the data memories) perform 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 ret return from subroutine description the program counter is restored from the stack. this is a two-cycle instruc- tion. operation pc stack affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 28 october 27, 1999 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 specified 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 one 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 one 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 ht48ra0 29 october 27, 1999 rlc [m] rotate data memory left through carry description the contents of the specified data memory and the carry flag are rotated one bit left. bit 7 replaces 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 one bit left. bit 7 replaces the carry bit and the original carry flag is rotated into bit 0 po - sition. 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 one 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 ht48ra0 30 october 27, 1999 rra [m] rotate right-place result in the accumulator description data in the specified data memory is rotated one 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 ro - tated one bit right. bit 0 replaces the carry bit; the original carry flag is ro - tated 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 rrca [m] rotate right through carry-place result in the accumulator description data of the specified data memory and the carry flag are rotated one 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 con- tents 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 ht48ra0 31 october 27, 1999 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 subtracted from the accumulator, leaving the result in the accumula - tor. 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 subtracted 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 zero description the contents of the specified data memory are decremented by one. if the re - sult is zero, the next instruction is skipped. if the result is zero, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (two cycles). oth- erwise proceed with the next instruction (one 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 zero description the contents of the specified data memory are decremented by one. if the re - sult is zero, the next instruction is skipped. the result is stored in the accu - mulator but the data memory remains unchanged. if the result is zero, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (two cycles). otherwise proceed with the next instruction (one cycle). operation skip if ([m] 1)=0, acc ([m] 1) affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 32 october 27, 1999 set [m] set data memory description each bit of the specified data memory is set to one. 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 one. operation [m].i 1 affected flag(s) tc2 tc1 to pd ov z ac c siz [m] skip if increment data memory is zero description the contents of the specified data memory are incremented by one. if the re - sult is zero, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper in - struction (two cycles). otherwise proceed with the next instruction (one cy - cle). 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 zero description the contents of the specified data memory are incremented by one. if the re- sult is zero, the next instruction is skipped and the result is stored in the ac- cumulator. the data memory remains unchanged. if the result is zero, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (two cycles). otherwise proceed with the next instruction (one cycle). operation skip if ([m]+1)=0, acc ([m]+1) affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 33 october 27, 1999 snz [m].i skip if bit i of the data memory is not zero description if bit i of the specified data memory is not zero, the next instruction is skipped. if bit i of the data memory is not zero, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (two cycles). otherwise proceed with the next instruction (one cycle). operation skip if [m].i 0 affected flag(s) tc2 tc1 to pd ov z ac c sub a,[m] subtract data memory from the accumulator description the specified data memory is subtracted from the contents of the accumula - tor, 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 accumula- tor, 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 accumulator, leaving the result in the accumulator. operation acc acc+x +1 affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 34 october 27, 1999 swap [m] swap nibbles within the data memory description the low-order and high-order nibbles of the specified data memory (one of the data memories) 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-place result in the accumulator description the low-order and high-order nibbles of the specified data memory are inter - changed, writing 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 sz [m] skip if data memory is zero description if the contents of the specified data memory are zero, the following instruc - tion, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (two cycles). otherwise proceed with the next instruction (one 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 zero description the contents of the specified data memory are copied to the accumulator. if the contents is zero, the following instruction, fetched during the current in - struction execution, is discarded and a dummy cycle is replaced to get the proper instruction (two cycles). otherwise proceed with the next instruction (one cycle). operation skip if [m]=0, acc [m] affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 35 october 27, 1999 sz [m].i skip if bit i of the data memory is zero description if bit i of the specified data memory is zero, the following instruction, fetched during the current instruction execution, is discarded and a dummy cycle is replaced to get the proper instruction (two cycles). otherwise proceed with the next instruction (one 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 rom code (high byte) affected flag(s) tc2 tc1 to pd ov z ac c xor a,[m] logical xor accumulator with data memory description data in the accumulator and the indicated data memory perform a bitwise logical exclusive_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 ht48ra0 36 october 27, 1999 xorm a,[m] logical xor data memory with the accumulator description data in the indicated data memory and the accumulator perform a bitwise logical exclusive_or operation. the result is stored in the data memory. the zero 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 the accumulator and the specified data perform a bitwise logical exclusive_or operation. the result is stored in the accumulator. the zero flag is affected. operation acc acc xor x affected flag(s) tc2 tc1 to pd ov z ac c ht48ra0 37 october 27, 1999 ht48ra0 38 october 27, 1999 copyright 1999 by holtek semiconductor inc. the information appearing in this data sheet is believed to be accurate at the time of publication. however, holtek assumes 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 pres - ent 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, r.o.c. tel: 886-3-563-1999 fax: 886-3-563-1189 holtek semiconductor inc. (taipei office) 5f, no.576, sec.7 chung hsiao e. rd., taipei, taiwan, r.o.c. tel: 886-2-2782-9635 fax: 886-2-2782-9636 fax: 886-2-2782-7128 (international sales hotline) 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 |
Price & Availability of HT48RA020SOIC-A
![]() |
|
|
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] |