background image

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

Rev. 1.41

44

December 30, 2008

takes place. If an interrupt request flag is set to

²

1

²

be-

fore entering the Power Down Mode, the wake-up func-
tion of the related interrupt will be disabled.

No matter what the source of the wake-up event is, once
a wake-up situation occurs, a time period equal to 1024
system clock periods will be required before normal sys-
tem operation resumes. However, if the wake-up has
originated due to an interrupt, the actual interrupt sub-
routine execution will be delayed by an additional one or
more cycles. If the wake-up results in the execution of

the next instruction following the

²

HALT

²

instruction, this

will be executed immediately after the 1024 system
clock period delay has ended.

Watchdog Timer

The Watchdog Timer is provided to prevent program mal-
functions or sequences from jumping to unknown loca-
tions, due to certain uncontrollable external events such
as electrical noise. It operates by providing a device reset
when the WDT counter overflows. The WDT clock is sup-
plied by one of two sources selected by configuration op-
tion: its own self contained dedicated internal WDT
oscillator or f

SYS

/4. Note that if the WDT configuration op-

tion has been disabled, then any instruction relating to its
operation will result in no operation.

I n

t h e

C o s t - E ff e c t i v e

A / D

Ty p e

s e r i e s

o f

microcontrollers, all Watchdog Timer options, such as
enable/disable, WDT clock source and clear instruction
type all selected through configuration options. There
are no internal registers associated with the WDT in the
Cost-Effective A/D Type MCU series. One of the WDT
clock sources is an internal oscillator which has an ap-

proximate period of 65

m

s at a supply voltage of 5V. How-

ever, it should be noted that this specified internal clock
period can vary with VDD, temperature and process
variations. The other WDT clock source option is the
f

SYS

/4 clock. Whether the WDT clock source is its own

internal WDT oscillator, or from f

SYS

/4, it is further di-

vided by 16 via an internal 15-bit counter and a clearable
single bit counter to give longer Watchdog time-outs. As
this ratio is fixed it gives an overall Watchdog Timer
time-out value of 2

15

/f

S

to 2

16

/f

S

. As the clear instruction

only resets the last stage of the divider 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 counter before the clear instruc-
tion is executed. It is important to realise that as there
are no independent internal registers or configuration
options associated with the length of the Watchdog
Timer time-out, it is completely dependent upon the fre-
quency of f

SYS

/4 or the internal WDT oscillator.

If the f

SYS

/4 clock is used as the WDT clock source, it

should be noted that when the system enters the Power
Down Mode, then the instruction clock is stopped and
the WDT will lose its protecting purposes. For systems
that operate in noisy environments, using the internal
WDT oscillator is strongly recommended.

Under normal program operation, a WDT time-out will
initialise a device reset and set the status bit TO. How-
ever, if the system is in the Power Down Mode, when a
WDT time-out occurs, the TO bit in the status register
will be set and only the Program Counter and Stack
Pointer will be reset. Three methods can be adopted to
clear the contents of the WDT. The first is an external
hardware reset, which means a low level on the RES
pin, the second is using the watchdog software instruc-

tions and the third is via a

²

HALT

²

instruction.

There are two methods of using software instructions to
clear the Watchdog Timer, one of which must be chosen
by configuration option. The first option is to use the sin-

gle

²

CLR WDT

²

instruction while the second is to use the

two commands

²

CLR WDT1

²

and

²

CLR WDT2

²

. For the

first option, a simple execution of

²

CLR WDT

²

will clear

the WDT while for the second option, both

²

CLR WDT1

²

and

²

CLR WDT2

²

must both be executed to successfully

clear the WDT. Note that for this second option, if

²

CLR

WDT1

²

is used to clear the WDT, successive executions

of this instruction will have no effect, only the execution of

a

²

CLR WDT2

²

instruction will clear the WDT. Similarly

after the

²

CLR WDT2

²

instruction has been executed,

only a successive

²

CLR WDT1

²

instruction can clear the

Watchdog Timer.

W D T   C l o c k   S o u r c e

C o n f i g u r a t i o n

O p t i o n

C l e a r   W D T   T y p e

C o n f i g u r a t i o n   O p t i o n

C L R   W D T 1   F l a g

C L R   W D T 2   F l a g

C L R  

W D T   T i m e - o u t

2

1 5

/ f

S

~ 2

1 6

/ f

S

1 5 - b i t   C o u n t e r

¸

2

W D T   O s c i l l a t o r

f

S Y S

/ 4

1   o r   2   I n s t r u c t i o n s

W D T   C l o c k   S o u r c e

f

S

Watchdog Timer

Содержание 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...

Отзывы: