background image

HT46R46/C46/R47/C47/R48A/C48A/R49

Rev. 1.41

15

December 30, 2008

Accumulator

-

ACC

The Accumulator is central to the operation of any
microcontroller and is closely related with operations
carried out by the ALU. The Accumulator is the place
where all intermediate results from the ALU are stored.
Without the Accumulator it would be necessary to write
the result of each calculation or logical operation such
as addition, subtraction, shift, etc., to the Data Memory
resulting in higher programming and timing overheads.
Data transfer operations usually involve the temporary
storage function of the Accumulator; for example, when
transferring data between one user defined register and
another, it is necessary to do this by passing the data
through the Accumulator as no direct transfer between
two registers is permitted.

Program Counter Low Register

-

PCL

To provide additional program control functions, the low
byte of the Program Counter is made accessible to pro-
grammers by locating it within the Special Purpose area
of the Data Memory. By manipulating this register, direct
jumps to other program locations are easily imple-
mented. Loading a value directly into this PCL register
will cause a jump to the specified Program Memory lo-
cation, however, as the register is only 8-bit wide, only
jumps within the current Program Memory page are per-
mitted. When such operations are used, note that a
dummy cycle will be inserted.

Look-up Table Registers

-

TBLP, TBLH

These two special function registers are used to control
operation of the look-up table which is stored in the Pro-
gram Memory. TBLP is the table pointer and indicates
the location where the table data is located. Its value
must be setup before any table read commands are ex-
ecuted. Its value can be changed, for example using the

²

INC

²

or

²

DEC

²

instructions, allowing for easy table data

pointing and reading. TBLH is the location where the
high order byte of the table data is stored after a table
read data instruction has been executed. Note that the
lower order table data byte is transferred to a user de-
fined location.

Status Register

-

STATUS

This 8-bit register contains the zero flag (Z), carry flag
(C), auxiliary carry flag (AC), overflow flag (OV), power
down flag (PDF), and watchdog time-out flag (TO).
These arithmetic/logical operation and system manage-
ment flags are used to record the status and operation of
the microcontroller.

With the exception of the TO and PDF 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 PDF flag. In addition, opera-
tions related to the status register may give different re-
sults due to the different instruction operations. The TO
flag can be affected only by a system power-up, a WDT

time-out or by executing the

²

CLR WDT

²

or

²

HALT

²

in-

struction. The PDF flag is affected only by executing the

²

HALT

²

or

²

CLR WDT

²

instruction or during a system

power-up.

The Z, OV, AC and C flags generally reflect the status of
the latest operations.

¨

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

is set if an operation results in a carry out of the

low nibbles in addition, or no borrow from the high
nibble into the low nibble in subtraction; otherwise
AC is cleared.

¨

Z

is set if the result of an arithmetic or logical opera-

tion is zero; otherwise Z is cleared.

¨

OV

is set if an operation results in a carry into the

highest-order bit but not a carry out of the high-
est-order bit, or vice versa; otherwise OV is cleared.

¨

PDF

is cleared by a system power-up or executing

the

²

CLR WDT

²

instruction. PDF is set by executing

the

²

HALT

²

instruction.

¨

TO

is cleared by a system power-up or executing

the

²

CLR WDT

²

or

²

HALT

²

instruction. TO is set by

a WDT time-out.

T O

P D F

O V

Z

A C

C

S T A T U S   R e g i s t e r

A r i t h m e t i c / L o g i c   O p e r a t i o n   F l a g s

C a r r y   f l a g

A u x i l i a r y   c a r r y   f l a g

Z e r o   f l a g

O v e r f l o w   f l a g

S y s t e m   M a n a g e m e n t   F l a g s

P o w e r   d o w n   f l a g

W a t c h d o g   t i m e - o u t   f l a g

N o t   i m p l e m e n t e d ,   r e a d   a s   " 0 "

b 7

b 0

Status Register

Содержание HT46R47

Страница 1: ...pplication possibil ities such as sensor signal processing motor driving in dustrial control consumer products subsystem controllers etc Many features are common to all de vices however they differ in...

Страница 2: ...y C o n f i g u r a t i o n O p t i o n P r o g r a m M e m o r y A d d r e s s D e c o d e r S t a c k S t a c k P o i n t e r P r o g r a m C o u n t e r L o o k u p T a b l e P o i n t e r T o P r...

Страница 3: ...P A 5 I N T P A 6 P A 7 O S C 2 O S C 1 V D D R E S P D 0 P W M N C 2 0 1 9 1 8 1 7 1 6 1 5 1 4 1 3 1 2 1 1 1 2 3 4 5 6 7 8 9 1 0 P A 3 P F D P A 2 P A 1 P A 0 P B 3 A N 3 N C P B 2 A N 2 P B 1 A N 1...

Страница 4: ...instructions determine if the pin is a CMOS output or Schmitt Trigger input Configuration options determine which pins on the port have pull high resistors PD0 PWM I O Pull high I O or PWM Bidirectio...

Страница 5: ...guration option determines if this pin has a pull high resistor The PWM output are pin shared with pins PD0 and PD1 selected via a configuration option OSC1 OSC2 I O Crystal or RC OSC1 OSC2 are connec...

Страница 6: ...rent WDT Disabled 3V No load system HALT 1 mA 5V 2 mA VIL1 Input Low Voltage for I O Ports TMR and INT 0 0 3VDD V VIH1 Input High Voltage for I O Ports TMR and INT 0 7VDD VDD V VIL2 Input Low Voltage...

Страница 7: ...riod System Clock 217 218 tSYS tRES External Reset Low Pulse Width 1 ms tSST System Start up Timer Period Wake up from HALT 1024 tSYS tLVR Low Voltage Reset Time 0 25 1 2 ms tINT Interrupt Pulse Width...

Страница 8: ...T1 clock during which time a new instruction is fetched The remaining T2 T4 clocks carry out the decoding and execution functions In this way one T1 T4 clock cycle forms one instruction cycle Although...

Страница 9: ...le and writable register By transferring data directly into this register a short program jump can be executed directly however as only this low byte is available for manipulation the jumps are limite...

Страница 10: ...sion JMP SZ SZA SNZ SIZ SDZ SIZA SDZA CALL RET RETI Program Memory The Program Memory is the location where the user code or program is stored For microcontrollers two types of Program Memory are usua...

Страница 11: ...2K Program Memory of the HT46R47 microcontroller The table pointer is setup here to have an initial value of 06H This will ensure that the first data read from the data table will be at the Program Me...

Страница 12: ...mended that simultaneous use of the table read instructions should be avoided However in situations where simultaneous use cannot be avoided the inter rupts should be disabled prior to the execution o...

Страница 13: ...ocations between these special function registers and the point where the General Pur pose Memory begins is reserved for future expansion purposes attempting to read data from these locations will ret...

Страница 14: ...ses 0 0 H 0 1 H 0 2 H 0 3 H 0 4 H 0 5 H 0 6 H 0 7 H 0 8 H 0 9 H 0 A H 0 B H 0 C H 0 D H 0 E H 0 F H 1 0 H 1 1 H 1 2 H 1 3 H 1 4 H 1 5 H 1 6 H 1 7 H 1 8 H 1 9 H 1 A H 1 B H 1 C H 1 D H 1 E H 1 F H 2 0...

Страница 15: ...s transferred to a user de fined location Status Register STATUS This 8 bit register contains the zero flag Z carry flag C auxiliary carry flag AC overflow flag OV power down flag PDF and watchdog tim...

Страница 16: ...also mapped to specific addresses with the Data Memory The control register specifies which pins of that port are set as inputs and which are set as outputs To setup a pin as an input the correspondi...

Страница 17: ...h or without pull high resistor structures can be re configured dynamically under software control Each pin of the I O ports is directly mapped to a bit in its associ ated port control register For th...

Страница 18: ...options asso ciated with the A D function If used as I O pins then full pull high resistor configuration options remain however if used as A D inputs then any pull high resis tor options associated wi...

Страница 19: ...R 0 W e a k P u l l u p A n a l o g I n p u t S e l e c t o r D Q C K S Q D Q C K S Q PB Input Output Ports V D D P F D o r P W M W a v e f o r m M U X R e a d D a t a R e g i s t e r C o n t r o l B...

Страница 20: ...they should be connected to pull high resistors Timer Event Counters The provision of timers form an important part of any microcontroller giving the designer a means of carrying out time related func...

Страница 21: ...programmed with the right data to ensure its correct operation a process that is normally carried out during program initialisation To choose which of the three modes the timer is to oper ate in the...

Страница 22: ...s to ensure that the port control regis ter configures the pin as an input It should be noted that a timer overflow is one of the wake up sources Also in the Event Counting mode the Timer Event Counte...

Страница 23: ...will not function however the pin can still be used as a normal input pin The PFD output will only be activated if bit PA3 is set to 1 This output data bit is used as the on off control bit for the P...

Страница 24: ...an be turned on and off by controlling the en able bit in the timer control register Note that setting the timer enable bit high to turn the timer on should only be executed after the timer mode bits...

Страница 25: ...cycles enables the generation of higher PWM frequencies which allow a wider range of applications to be served As long as the periods of the generated PWM pulses are less than the time constants of th...

Страница 26: ...used as an on off control for the PWM function Note that if the configuration options have selected the PWM function but a 1 has been written to its corresponding bit in the PDC control register to c...

Страница 27: ...high byte register ADRH utilises its full 8 bit contents The low byte register utilises only 1 bit of its 8 bit contents as it contains only the lowest bit of the 9 bit converted value In the followi...

Страница 28: ...S0 bits in the ACSR register Although the A D clock source is determined by the sys tem clock fSYS and by bits ADCS1 and ADCS0 there are some limitations on the maximum A D clock source speed that can...

Страница 29: ...on bits have changed then within a time frame of one to ten instruction cycles the START bit in the ADCR register must first be set high and then immediately cleared to zero This will ensure that the...

Страница 30: ...ry powered applications Another important programming consideration is that when the A D channel selection bits change value the A D converter must be re initialised This is achieved by pulsing the ST...

Страница 31: ...I disable ADC interrupt mov a 00000001B mov ACSR a setup the ACSR register to select fSYS 8 as the A D clock mov a 00100000B setup ADCR register to configure Port PB0 PB3 as A D inputs mov ADCR a and...

Страница 32: ...wing START signal 0 1 0 must be issued within 10 instruction cycles Start_conversion clr START set START reset A D clr START start A D clr ADF clear ADC interrupt request flag set EADI enable ADC inte...

Страница 33: ...ut value for the A D converters Note that to reduce the quantisation error a 0 5 LSB off set is added to the A D Converter input Except for the digitised zero value the subsequent digitised values wil...

Страница 34: ...p to another section of program which is known as the interrupt service routine Here is located the code to control the appropriate interrupt The interrupt service routine must be terminated with a RE...

Страница 35: ...utine call to the external interrupt vector at location 04H will take place When the interrupt is serviced the external inter rupt request flag EIF will be automatically reset and the EMI bit will be...

Страница 36: ...voltage falls below a certain threshold Reset Functions There are five ways in which a microcontroller reset can occur through events occurring both internally and ex ternally Power on Reset The most...

Страница 37: ...ways These flags known as PDF and TO are located in the status register and are controlled by various microcontroller operations such as the Power Down function or Watchdog Timer The reset flags are s...

Страница 38: ...u u u u INTC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 u u u u u u u TMR x x x x x x x x x x x x x x x x x x x x x x x x u u u u u u u u TMRC 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 u u u u u u u P...

Страница 39: ...u INTC 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 u u u u u u u TMR x x x x x x x x x x x x x x x x x x x x x x x x u u u u u u u u TMRC 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 u u u u u u u PA 1 1 1...

Страница 40: ...u u u u u u TMR x x x x x x x x x x x x x x x x x x x x x x x x u u u u u u u u TMRC 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 u u u u u u u PA 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 u u u u...

Страница 41: ...u u u u u u u u TMRC 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 u u u u u u u PA 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 u u u u u u u u PAC 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 u u...

Страница 42: ...crystal manufacturer specified load capacitor value Crystal Recommended Capacitor Values Resonator C1 and C2 Values Resonator Frequency C1 C2 3 58MHz TBD TBD 1MHz TBD TBD 455kHz TBD TBD Note C1 and C...

Страница 43: ...en into account by the circuit designer if the power consumption is to be minimized Special atten tion must be made to the I O pins on the device All high impedance input pins must be connected to eit...

Страница 44: ...der chain for this reason the actual division ratio and corresponding Watchdog Timer time out can vary by a factor of two The exact division ratio depends upon the residual value in the Watchdog Timer...

Страница 45: ...evelopment tools As these options are programmed into the device using the hardware programming tools once they are selected they cannot be changed later as the application software has no control ove...

Страница 46: ...re a range of add and subtract instruction mnemonics to enable the necessary arithmetic to be carried out Care must be taken to ensure correct handling of carry and borrow data when results exceed 255...

Страница 47: ...related sections Instruction Set Summary The following table depicts a summary of the instruction set categorised according to function and can be con sulted as a basic instruction reference using th...

Страница 48: ...emory 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 inter...

Страница 49: ...in the Accumulator Operation ACC ACC x Affected flag s OV Z AC C ADDM A m Add ACC to Data Memory Description The contents of the specified Data Memory and the Accumulator are added The result is store...

Страница 50: ...T Clear Watchdog Timer Description The TO PDF flags and the WDT are all cleared Operation WDT cleared TO 0 PDF 0 Affected flag s TO PDF CLR WDT1 Pre clear Watchdog Timer Description The TO PDF flags a...

Страница 51: ...flag is set then a value of 6 will be added to the high nibble Essentially the decimal conversion is performed by add ing 00H 06H 60H or 66H depending on the Accumulator and flag conditions Only the...

Страница 52: ...d flag s None MOV A m Move Data Memory to ACC Description The contents of the specified Data Memory are copied to the Accumulator Operation ACC m Affected flag s None MOV A x Move immediate data to AC...

Страница 53: ...the restored address Operation Program Counter Stack ACC x Affected flag s None RETI Return from interrupt Description The Program Counter is restored from the stack and the interrupts are re enabled...

Страница 54: ...RRA m Rotate Data Memory right with result in ACC Description Data in the specified Data Memory and the carry flag are rotated right by 1 bit with bit 0 ro tated into bit 7 The rotated result is store...

Страница 55: ...remented by 1 If the result is 0 the following instruction is skipped As this requires the insertion of a dummy instruction while the next instruction is fetched it is a two cycle instruction If the r...

Страница 56: ...instruction is fetched it is a two cycle instruction If the result is 0 the program proceeds with the following instruction Operation Skip if m i 0 Affected flag s None SUB A m Subtract Data Memory f...

Страница 57: ...the insertion of a dummy instruc tion while the next instruction is fetched it is a two cycle instruction If the result is not 0 the program proceeds with the following instruction Operation ACC m Sk...

Страница 58: ...tion Data in the specified Data Memory and the Accumulator perform a bitwise logical XOR op eration The result is stored in the Data Memory Operation m ACC XOR m Affected flag s Z XOR A x Logical XOR...

Страница 59: ...mil Outline Dimensions MS 012 Symbol Dimensions in mil Min Nom Max A 228 244 B 150 157 C 12 20 C 386 394 D 69 E 50 F 4 10 G 16 50 H 7 10 a 0 8 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 59 December 30...

Страница 60: ...22 F 45 70 G 100 H 300 325 I 430 MS 001d see fig1 Symbol Dimensions in mil Min Nom Max A 845 880 B 240 280 C 115 195 D 115 150 E 14 22 F 45 70 G 100 H 300 325 I 430 HT46R46 C46 R47 C47 R48A C48A R49...

Страница 61: ...MO 095a see fig2 Symbol Dimensions in mil Min Nom Max A 845 885 B 275 295 C 120 150 D 110 150 E 14 22 F 45 60 G 100 H 300 325 I 430 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 61 December 30 2008...

Страница 62: ...Dimensions MS 013 Symbol Dimensions in mil Min Nom Max A 393 419 B 256 300 C 12 20 C 447 463 D 104 E 50 F 4 12 G 16 50 H 8 13 a 0 8 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 62 December 30 2008 1 8 1...

Страница 63: ...2 F 45 70 G 100 H 300 325 I 430 MO 095a see fig2 Symbol Dimensions in mil Min Nom Max A 945 985 B 275 295 C 120 150 D 110 150 E 14 22 F 45 60 G 100 H 300 325 I 430 HT46R46 C46 R47 C47 R48A C48A R49 Re...

Страница 64: ...imensions MS 013 Symbol Dimensions in mil Min Nom Max A 393 419 B 256 300 C 12 20 C 496 512 D 104 E 50 F 4 12 G 16 50 H 8 13 a 0 8 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 64 December 30 2008 2 0 1...

Страница 65: ...e Dimensions Symbol Dimensions in mil Min Nom Max A 228 244 B 150 158 C 8 12 C 335 347 D 49 65 E 25 F 4 10 G 15 50 H 7 10 a 0 8 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 65 December 30 2008 2 0 1 1 1...

Страница 66: ...22 F 45 70 G 100 H 300 325 I 430 MS 001d see fig2 Symbol Dimensions in mil Min Nom Max A 1160 1195 B 240 280 C 115 195 D 115 150 E 14 22 F 45 70 G 100 H 300 325 I 430 HT46R46 C46 R47 C47 R48A C48A R49...

Страница 67: ...MO 095a see fig2 Symbol Dimensions in mil Min Nom Max A 1145 1185 B 275 295 C 120 150 D 110 150 E 14 22 F 45 60 G 100 H 300 325 I 430 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 67 December 30 2008...

Страница 68: ...imensions MS 013 Symbol Dimensions in mil Min Nom Max A 393 419 B 256 300 C 12 20 C 598 613 D 104 E 50 F 4 12 G 16 50 H 8 13 a 0 8 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 68 December 30 2008 2 4 1...

Страница 69: ...e Dimensions Symbol Dimensions in mil Min Nom Max A 228 244 B 150 157 C 8 12 C 335 346 D 54 60 E 25 F 4 10 G 22 28 H 7 10 a 0 8 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 69 December 30 2008 2 4 1 1 3...

Страница 70: ...ne Dimensions Symbol Dimensions in mil Min Nom Max A 1375 1395 B 278 298 C 125 135 D 125 145 E 16 20 F 50 70 G 100 H 295 315 I 375 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 70 December 30 2008 2 8 1...

Страница 71: ...imensions MS 013 Symbol Dimensions in mil Min Nom Max A 393 419 B 256 300 C 12 20 C 697 713 D 104 E 50 F 4 12 G 16 50 H 8 13 a 0 8 HT46R46 C46 R47 C47 R48A C48A R49 Rev 1 41 71 December 30 2008 2 8 1...

Страница 72: ...2 D Key Slit Width 2 0 0 5 T1 Space Between Flange 16 8 0 3 0 2 T2 Reel Thickness 22 2 0 2 SOP 18W SOP 20W SOP 24W SOP 28W 300mil Symbol Description Dimensions in mm A Reel Outer Diameter 330 0 1 0 B...

Страница 73: ...0 1 SOP 18W Symbol Description Dimensions in mm W Carrier Tape Width 24 0 0 3 0 1 P Cavity Pitch 16 0 0 1 E Perforation Position 1 75 0 1 F Cavity to Perforation Width Direction 11 5 0 1 D Perforatio...

Страница 74: ...0 1 t Carrier Tape Thickness 0 30 0 05 C Cover Tape Width 21 3 0 1 SSOP 20S 150mil Symbol Description Dimensions in mm W Carrier Tape Width 16 0 0 3 0 1 P Cavity Pitch 8 0 0 1 E Perforation Position 1...

Страница 75: ...1 t Carrier Tape Thickness 0 35 0 05 C Cover Tape Width 21 3 0 1 SSOP 24S 150mil Symbol Description Dimensions in mm W Carrier Tape Width 16 0 0 3 0 1 P Cavity Pitch 8 0 0 1 E Perforation Position 1...

Страница 76: ...tion 11 5 0 1 D Perforation Diameter 1 5 0 1 0 0 D1 Cavity Hole Diameter 1 50 0 25 0 00 P0 Perforation Pitch 4 0 0 1 P1 Cavity to Perforation Length Direction 2 0 0 1 A0 Cavity Length 10 85 0 10 B0 Ca...

Страница 77: ...ts in life support devices or systems 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...

Отзывы: