|
Basic Information
Question 1
What are the contents of the HT46 A/D type MCUs?
Answer
The HT46 series of A/D type MCUs have a selection of 1K, 2K, 4K, 8K and 16K OTP and Mask Type memory capacities. Among the series, the HT46R22/HT46C22, HT46R23/HT46C23, HT46R24/HT46C24 and HT46R25/HT46C25 devices also incorporate an
I2C serial I/O interface. The HT46R51A, HT46R52A, HT46R53A and HT46R54A devices have a 12-bit A/D converter. For more information please consult the relevant datasheet.
Question 2
What are the differences between the various devices in the HT46 A/D type MCUs?
Answer
Please check on the table below for the differences. For more detailed information consult the data sheet.
| Part No. |
VDD |
System
Clock |
Program
Memory |
Data
Memory |
I/O |
8-bit
Timer |
Interrupt |
A/D |
PWM |
PFD |
Stack |
Package |
| Ext. |
Int. |
| HT46R01* |
2.2V~
5.5V |
400kHz~
12MHz |
1Kx14 |
64x8 |
8 |
1 |
1 |
2 |
8-bitx4 |
8-bitx1 |
v |
4 |
10MSOP |
| HT46R02* |
2.2V~
5.5V |
400kHz~
12MHz |
2Kx14 |
96x8 |
8 |
2 |
1 |
3 |
9-bitx4 |
8-bitx1 |
v |
6 |
10MSOP |
| HT46R03* |
2.2V~
5.5V |
400kHz~
12MHz |
4Kx15 |
160x8 |
8 |
2 |
1 |
3 |
12-bitx4 |
8-bitx1 |
v |
6 |
10MSOP |
| Part No. |
VDD |
System
Clock |
Program
Memory |
Data
Memory |
I/O |
Timer |
Interrupt |
I2C |
A/D |
PWM |
PFD |
UART |
Stack |
Package |
| 8-bit |
16-bit |
Ext. |
Int. |
HT46R22
HT46C22 |
2.2V~
5.5V |
400kHz~
8MHz |
2Kx14 |
64x8 |
19 |
1 |
-- |
1 |
3 |
v |
9-bitx8 |
8-bitx1 |
v |
-- |
6 |
24SKDIP,
24SOP |
| HT46RU22 |
v |
HT46R23
HT46C23 |
2.2V~
5.5V |
400kHz~
8MHz |
4Kx15 |
192x8 |
23 |
-- |
1 |
1 |
3 |
v |
10-bitx8 |
8-bitx2 |
v |
-- |
8 |
24SKDIP,
24SOP,
28SKDIP,
28SOP |
HT46R232
HT46C232 |
2.2V~
5.5V |
400kHz~
8MHz |
4Kx16 |
192x8 |
40 |
-- |
2 |
1 |
4 |
v |
10-bitx8 |
8-bitx4 |
v |
-- |
8 |
28SKDIP,
28SOP,
48SSOP |
HT46R24
HT46C24 |
2.2V~
5.5V |
400kHz~
8MHz |
8Kx16 |
384x8 |
40 |
-- |
2 |
1 |
4 |
v |
10-bitx8 |
8-bitx4 |
v |
-- |
16 |
28SKDIP,
28SOP,
48SSOP |
HT46RU25
HT46CU25* |
2.2V~
5.5V |
400kHz~
8MHz |
16Kx16 |
576x8 |
48 |
1 |
2 |
1 |
5 |
v |
12-bitx8 |
8-bitx4 |
v |
v |
16 |
48SSOP,
56SSOP |
| Part No. |
VDD |
System
Clock |
Program
Memory |
Data
Memory |
I/O |
8-bit
Timer |
Interrupt |
A/D |
PWM |
PFD |
Stack |
Package |
| Ext. |
Int. |
| HT46R46-H |
3.3V~
5.5V |
400kHz~
8MHz |
1Kx14 |
64x8 |
13 |
1 |
1 |
2 |
8-bitx4ch |
8-bitx1 |
v |
4 |
18DIP/SOP |
| HT46R47-H |
3.3V~
5.5V |
400kHz~
8MHz |
2Kx14 |
64x8 |
13 |
1 |
1 |
2 |
9-bitx4ch |
8-bitx1 |
v |
6 |
18DIP/SOP |
| Part No. |
VDD |
System
Clock |
Program
Memory |
Data
Memory |
I/O |
8-bit
Timer |
Interrupt |
A/D |
PWM |
PFD |
Stack |
Package |
| Ext. |
Int. |
| HT46R51A |
2.2V~
5.5V |
400kHz~
8MHz |
1Kx15 |
96x8 |
14 |
1 |
1 |
2 |
12-bitx5 |
8-bitx1 |
v |
6 |
18DIP,
20SOP/SSOP |
| HT46R52A |
2.2V~
5.5V |
400kHz~
8MHz |
2Kx15 |
128x8 |
14 |
1 |
1 |
2 |
12-bitx5 |
8-bitx1 |
v |
6 |
18DIP,
20SOP/SSOP |
| HT46R53A |
2.2V~
5.5V |
400kHz~
8MHz |
2Kx15 |
192x8 |
22 |
1 |
1 |
2 |
12-bitx8 |
8-bitx1 |
v |
6 |
28SKDIP/SOP |
| HT46R54A |
2.2V~
5.5V |
400kHz~
8MHz |
4Kx15 |
208x8 |
22 |
1 |
1 |
2 |
12-bitx8 |
8-bitx1 |
v |
6 |
28SKDIP/SOP |
| Part No. |
VDD |
System
Clock |
Program
Memory |
Data
Memory |
I/O |
8-bit
Timer |
Interrupt |
A/D |
Comparator |
PPG |
PFD |
Stack |
Package |
| Ext. |
Int. |
| HT46R12A |
2.2V~
5.5V |
400kHz~
8MHz |
2Kx14 |
88x8 |
16 |
2 |
2 |
3 |
9-bitx4 |
2 |
1 |
v |
8 |
24SKDIP,
24SOP |
| HT46R14A |
2.2V~
5.5V |
400kHz~
8MHz |
4Kx15 |
192x8 |
20 |
2 |
3 |
3 |
9-bitx8 |
2 |
2 |
v |
8 |
28SKDIP,
28SOP |
Question 3
What are the various packages available in the HT46 A/D type MCUs?
Answer
Please see table below. Mask type MCU HT46CXX have the identical packaging forms.
|
HT46R22 : |
24 SKDIP & SOP |
| HT46R23 : |
24 SKDIP & SOP (compatible pinouts with the HT46R22 for convenient MCU upgrade) |
|
28 SKDIP & SOP |
| HT46R24 : |
28 SKDIP & SOP (compatible pinouts with the HT46R23 for convenient MCU upgrade) |
|
48 SSOP |
| HT46R25 : |
48/56SSOP |
|
HT46R51A: |
18 DIP |
|
20 SOP & SSOP |
| HT46R52A : |
18DIP (compatible pinouts with the HT46R51A
for convenient MCU upgrade) |
|
20 SOP & SSOP (compatible pinouts with the HT46R51A for convenient MCU upgrade) |
| HT46R53A : |
28 SKDIP & SOP |
| HT46R54A : |
28 SKDIP & SOP (compatible pinouts with the
HT46R53A for convenient MCU upgrade) |
Question 4
What is the operating frequency of the HT46 A/D type MCUs?
Answer
For 5V/3.3V or 3-cell battery applications, the maximum operating frequency is 8MHz (3.3V). For 3V or 2-cell battery applications the maximum operating frequency is 4MHz (2.2V)
Question 5
What is the system frequency tolerance if an RC oscillator is used as the system clock?
Answer
If the RC oscillator is selected, due to tolerances in the device processing, a nominal
±20% frequency tolerance from lot to lot is expected. Assuming that the external resistor has a
±5% tolerance, then the overall frequency tolerance would be ±25%.
The above specified tolerance is provided as a reference only and is not guaranteed. For applications where a more precise frequency source is required it is recommended that either a resonator or crystal frequency source is used.
Question 6
When using assembly language for the HT46R4 device, which is a Multi Ram Bank MCU, is it possible to directly implement a direct address operation for variables defined in banks other than BANK 0?
Answer
This is not possible. In assembly language, even if the BP can be directly addressed, direct addressing only applies to registers in BANK 0. For Banks other than BANK 0, the MP1 Memory Pointer must be used to access any registers located here.
Question 7
Why does the 18-pin DIP-A package for the HT46R51A/HT46R52A not have a VREF pin?
Answer
The HT46R51A and HT46R52A devices have two package types, an 18-pin DIP-A and 20-pin SOP-A/SSOP-A. On the 18-pin package, the VREF pin is connected internally to the VDD pin, therefore externally there is no VREF pin, whereas on the 20-pin package there is an external VREF pin.
Functional Description
- Question 1
How to use the indirect memory addressing mode?
- Question 2
What are the special features and characteristics of the HT46 A/D type
MCUs?
- Question 3
The HT46R23/HT46C23 have two memory pointers, what is the difference between them?
- Question 4
How are the table read instructions used and are there any special points to note?
- Question 5
What is the difference between choosing the WDT oscillator or the fSYS/4 clock as the WDT clock source?
- Question 6
How is the 8-bit timer setup?
- Question 7
How is the 16-bit timer setup?
- Question 8
What is the access sequence of the 16-bit Timer/Counter?
- Question 9
When the 8-bit Timer/Counter clock is sourced from the
Prescaler, can the Prescaler be reset?
- Question 10
How is 8-bit Timer/Counter setup in the Timer Mode?
- Question 11
How is 16-bit Timer/Counter setup in the Timer Mode?
- Question 12
How is the Timer/Counter setup in the Event
Counter Mode?
- Question 13
How is the 8-bit Timer/Counter setup in the Pulse Width Mode?
- Question 14
How is the 16-bit Timer/Counter setup in the Pulse Width Mode?
- Question 15
How is the HT46X22 8-bit PFD setup?
- Question 16
How is the HT46X23 16-bit PFD setup?
- Question 17
What is the PWM frequency under (6+2) mode and (7+1) mode?
- Question 18
What are the HT46 A/D type MCU I2C Bus features?
- Question 19
How to calculate the A/D Conversion clock frequency?
- Question 20
How is the ADCLK calculated and what are its restrictions?
- Question 21
How long is the A/D sampling time?
- Question 22
What is the equivalent circuit of the A/D type MCU to its external analog signal source?
- Question 23
The HT46R23 and HT46R24 have 2 and 4 PWM channels respectively. By writing the same values into the PWM registers and enabling them at different times, will PWM output waveforms with different phases be generated?
- Question 24
When using the HT46R22 with a 4MHz system clock, what is the frequency of the source clock for the internal timer?
- Question 25
What is the function of the WDT?
- Question 26
Is the value of conversion in the 8-bit A/D MCUs equal to
N*Vref/255 or N*Vref/256?
- Question 27
Many of the Holtek MCUs have a Low Voltage Reset function. When this operates what is the condition of the I/O, OSC pins etc?
- Question 28
What is the difference between the activation of an LVR function and pulling the RES pin low?
- Question 29
In the HT46R65, how can variables in bank2 be defined? When the data db is used to define variables, when the number of variables exceeds 192, the compiler generates an "exceed RAM capacity error message."
- Question 30
Can all pins on the HT46R22 be used as A/D inputs? Can any remaining pins be used as I/O pins?
- Question 31
The HT46R22 RAM space exists in the range 0x40--0x7f, however as the system has 6 stack levels, do they also exist within this 0x40--0x7f area?
- Question 32
In the HT46R47 is it possible not to use the A/D interrupt? After initiating a START pulse, by looking at the EOC flag to see if it has been reset to zero, can I determine that the conversion had ended?
- Question 33
What are the special features of the UART in the HT46RU25?
- Question 34
What are the conditions for the generation of a UART interrupt?
- Question 35
How can the HT46RU25 UART serial data transmission frequency be calculated?
- Question 36
Why is it when I use the Baud Rate formula to calculate the Baud Rate it is different from the actual rate?
- Question 37
What is the transmit and receive data types and waveforms for the UART?
- Question 38
What are the steps to initialise the UART?
- Question 39
What steps are required to initialise the UART receiver?
- Question 40
What is the meaning of an overrun error in the UART function, and if it occurs how does the UART handle such an error?
- Question 41
How many registers does the UART have and what functions do they have?
- Question 42
How does the UART transmit data?
- Question 43
What kinds of receive errors does the UART generate?
- Question 44
How is the RAM in the HT6R454A and HT46R54 differentiated?
- Question 45
Can the LVR be simulated in the ICE?
- Question 46
What are the differences between the HT46R49E and the HT46R49?
- Question 47
When the Timer/Counter has been started and is running, can data be written to it?
- Question 48
Can more than one A/D converter channel in the AD type MCUs be open at one time?
Question 1
How to use the indirect memory addressing mode? Answer
First the address to be read or written must be placed in the relevant memory pointer, known as MP. After this any instruction that refers to the Indirect Register, known as
IAR, (e.g. MOV a, IAR) will result in action taking place on data pointed to by the memory pointer (MP). Indirect memory addressing is particularly useful for operations on data arrays by first placing the first array address in the memory pointer. Data can then be read or written from different places in the array by manipulating the data pointer.
Question 2
What are the special features and characteristics of the HT46 A/D type MCUs?
Answer
Operating Voltage range of 2.2V ~ 5.5V
Industrial standard temperature range of -40°C ~ +85°C
Low Voltage Reset function
Fully compatible OTP and Mask Types
For further details consult the relevant Holtek data sheet
Question 3
The HT46R23/HT46C23 have two memory pointers, what is the difference between them?
Answer
MP0/IAR0 and MP1/IAR1 are pairs of registers that need to be used together. MP0/IAR0 can only be used by RAM BANK 0 while MP1/IAR1 can be used by any RAM BANK.
Question 4
How are the table read instructions used and are there any special points to note?
Answer
There are two kinds of table read instructions, the first is the TABRDC instruction which is used to read data from the present program memory page. The second is the TABRDL statement which can read data from the last page of program memory. When reading data from tables it is first necessary to place the low byte of the program memory address where the data is stored, into the table pointer register TBLP. The table read instruction can then be executed which will place the low byte of the table data into the register indicated by the table read instruction. The high byte of the table data will be placed into the TBLH register. Note that the highest unimplemented bits in the data high byte will read as "0".
Question 5
What is the difference between choosing the WDT oscillator or the fSYS/4 clock as the WDT clock source?
Answer
If the WDT oscillator clock is chosen as the clock source then if the system enters a HALT condition the WDT timer will continue to function. When the WDT time-outs the system will be woken up from its HALT state. If the fSYS/4 clock is chosen as the WDT clock source then the WDT will cease to function and system will not be woken up when a HALT state is entered. The cost in choosing the WDT oscillator is that some power will be consumed by its clock. For systems that operate with HALT feature and need not to be woken up from HALT by WDT overflow, in this case the fSYS/4 clock source should be selected.
Question 6
How is the 8-bit timer setup?
Answer
The 8-bit timer/counter is a count up timer which upon reaching a count of 255 (0FFH) will reset itself to 00H and generate an internal interrupt signal. To obtain different timer counts, say N, of less than 256, the timer should be first preset with a fixed value of 256-N. After setting up this preset value the timer should be activated which will enable it to count from this preset value to 255. The value that the timer is to count N, is therefore given by the formula 256-(256-N)=N.
Question 7
How is the 16-bit timer setup?
Answer
The 16-bit timer/counter is a count up counter, which upon reaching a value of 65535 (0FFFFH) will reset itself to 0000H and generate an internal interrupt signal. To obtain different timer counts, say N, of less than 65536, the timer should be first preset with a fixed value of 65536-N. After setting up this preset value the timer should be activated which will enable it to count from this preset value to 65535. The value that the timer is to count N, is therefore given by the formula 65536-(65536-N)=N.
Question 8
What is the access sequence of the 16-bit Timer/Counter?
Answer
For the HT46 A/D type MCU, the internal data bus is 8-bit wide, therefore for the 16-bit Timer/Counter, the user has to write the Low Byte data first and then write the high byte data. To read the Timer/Counter contents, the user has to first read the High Byte data first and then the Low Byte data.
Question 9
When the 8-bit Timer/Counter clock is sourced from the Prescaler, can the Prescaler be reset?
Answer
The Prescaler will start to count after a Power On Reset, so there is no means for the user to reset the Prescaler contents.
Question 10
How is 8-bit Timer/Counter setup in the Timer Mode?
Answer
There are three modes available for the 8-bit Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To setup in the Timer Mode, the following process should be followed:
-
Set to Timer Mode by writing 10H to TM1, TM0
-
According to the user timer period requirements set the Prescaler by writing the appropriate values to the bits PSC2~PSC0
-
Set the initial timer TMR value
-
Enable the corresponding interrupt by setting the ETI and EMI bit
-
Start the Timer by setting the TON bit of the TMRC
Once the Timer is enabled, it will count up and will be stopped when the TON bit in the TMRC register is cleared. If the Timer is enabled once again, the counter will start counting from the value where it was stopped. If the Timer overflows, an internal interrupt request will be issued and the TMR will be reloaded with the initial value.
Question 11
How is 16-bit Timer/Counter setup in the Timer Mode?
Answer
There are three modes available for the 16-bit Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To setup in the Timer Mode, the following process should be followed:
-
Set to Timer Mode by writing 10H to TM1, TM0
-
Set the initial timer TMR value
-
Enable the corresponding interrupt by setting the ETI and EMI bit
-
Start the Timer by setting the TON bit of the TMRC
Once the Timer is enabled, it will count up and will be stopped when the TON bit in the TMRC register is cleared. If the Timer is enabled once again, the counter will start counting from the value where it was stopped. If the Timer overflows, an internal interrupt request will be issued and the TMR will be reloaded with the initial value.
Question 12
How is the Timer/Counter setup in the Event Counter Mode?
Answer
There are three modes available for the Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To set in the
Event Counter Mode, the following process should be followed:
-
Set to Event Counter Mode by writing 01H to TM1, TM0
-
Select TE=1 to count on the falling edge and TE=0 to count on the rising edge
-
Set the Timer initial value into TMR
-
Enable the corresponding interrupt by setting the ETI and EMI bits
-
Start the Timer by setting the TON bit in the TMRC register
Question 13
How is the 8-bit Timer/Counter setup in the Pulse Width Mode?
Answer
There are three modes available for the Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To set in the
Pulse Width Mode, the following process should be followed:
-
Set to Pulse Width Mode by writing 11H to TM1, TM0
-
Select TE=1 to measure a High Pulse Width and TE=0 to measure a Low Pulse Width
-
According to the Pulse Measurement width requirements set the Prescaler value
( PSC2~PSC0=n)
-
Set the Timer initial value, TMR, usually set to 0H for
Pulse Width Measurements
-
Enable the corresponding interrupt by setting the ETI and EMI bits
-
Start the Timer by setting the TON bit in the TMRC
After the Timer/Counter is enabled, the user can poll the TON bit, if one pulse measurement is complete, the TON bit will be cleared to 0 and the count value multiplied by 2n
is the measured pulse width.
Question 14
How is the 16-bit Timer/Counter setup in the Pulse Width Mode?
Answer
There are three modes available for the Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To set in the
Pulse Width Mode, the following
process should be followed:
-
Set to Pulse Width Mode by writing 11H to TM1, TM0
-
Select TE=1 to measure a High Pulse Width and TE=0 to measure a Low Pulse Width
-
Set the Timer initial value, TMR, usually set to 0H for Pulse Width Measurements
-
Enable the corresponding interrupt by setting the ETI and EMI bits
-
Start the Timer by setting the TON bit in the TMRC
After the Timer/Counter is enabled, the user can poll the TON bit, if one pulse measurement is complete, the TON bit will be cleared to 0 and the value in the counter will be the pulse width measured.
Question 15
How is the HT46X22 8-bit PFD setup?
Answer
To utilize the PFD function of HT46X22, the following process should be followed:
-
Choose PFD enabled in the configuration option
-
Set the Prescaler (PSC2~PSC0=n) value and TMR initial value from the formula
fPFD = (fSYS / (2nx(256-TMR)x2))
-
Start the Timer by setting the TON bit in the TMRC
-
Set PA bit 3 in Output Mode, i.e.PAC.3=0
After these steps are taken, set PA.3=1 to turn on the PFD and PA.3=1 to turn off the PFD.
Question 16
How is the HT46X23 16-bit PFD setup?
Answer
To utilize the PFD function of HT46X23, the following process should be followed:
-
Choose PFD enabled in the configuration option
-
Set the TMR initial value from the formula fPFD =
(fSYS /
((65536-TMR)x2))
-
Start the Timer by setting the TON bit in the TMRC
-
Set PA bit 3 in Output Mode, i.e.PAC.3=0
After these steps are taken, set PA.3=1 to turn on the PFD and PA.3=1 to turn off the PFD.
Question 17
What is the PWM frequency under (6+2) mode and (7+1) mode? Answer
For PWM (6+2) mode, the PWM cycle is divided into 4 modulation cycles. Each modulation cycle has 64 PWM input clock periods, and the PWM frequency will be fSYS/26. For PWM (7+1) mode, the PWM cycle is divided into 2 modulation cycles. Each modulation cycle has 128 PWM input clock periods, and the PWM frequency will be fSYS/27. In comparison with the 8-bit mode, the (6+2) Mode PWM frequency is 4 times higher and (7+1) mode is 2 times higher than that of the 8-bit mode.
Question 18
What are the HT46 A/D type MCU I2C Bus features?
Answer
Except HT46X47, the HT46 A/D Type MCU series is featured with slave mode I2C Bus. Via SCL and SDA lines, MCU can receive data or transmit data upon Master device's request.
Question 19
How to calculate the A/D Conversion clock frequency?
Answer
Each A/D conversion needs 76 AD clocks which is selected by ADCS1and ADCS0. Please refer to the table:
| ADCS1 |
ADCS0 |
TAD Frequency |
| 0 |
0 |
fSYS/2 |
| 0 |
1 |
fSYS/8 |
| 1 |
0 |
fSYS/32 |
| 1 |
1 |
Undefined |
Question 20
How is the ADCLK calculated and what are its restrictions?
Answer
For the HT46 A/D Type MCUs, the minimum A/D Clock Period
(tAD) is 1us. Therefore, the A/D Clock Period chosen by programming bits ADCS1 and ADCS0 must be carefully chosen to ensure that the selected A/D clock period is not less than 1us. The values are shown in the table below:
| fSYS |
A/D Clock Period (tAD) |
ADCS1, ADCS0 = 00
(fSYS/2) |
ADCS1, ADCS0 = 01
(fSYS/8) |
ADCS1, ADCS0 = 10
(fSYS/32) |
ADCS1, ADCS0 =11 |
| 1 MHz |
2 us |
8 us |
32 us |
Undefine |
| 2 MHz |
1 us |
4 us |
16 us |
| 4 MHz |
*500 ns |
2 us |
8 us |
| 8 MHz |
*250 ns |
1 us |
4 us |
* indicates the ADCS1 and ADCS0 bit settings that are not permitted as they will give a
tAD value that is less than 1us .
Question 21
How long is the A/D sampling time?
Answer
The A/D Sampling Time requires 32tAD. For example, if the A/D Clock Period is 4us, then the A/D Sampling Time will be 128us.
Question 22
What is the equivalent circuit of the A/D type MCU to its external analog signal source?
Answer
The equivalent circuit of the A/D type MCU to its external analog signal source is drawn as below:

Notations:
VA : external analog signal source
RA : external analog signal output impedance
AN0~AN7 : analog signal input pins
CPIN : analog signal input pin input capacitance CPIN = 5pF
D1, D2 : protection diodes on pad, VT=0.6V
II : leakage current on pad,
II = ±1μA (max.)
SS : analog signal sampling switch
RSS : analog signal sampling switch equivalent impedance; ca.100/200Ω at 5V/3V
CS/H : sampling and hold capacitance shown as below;
| |
HT46R23, HT46R24, HT46R64, HT46R65 |
HT46C23, HT46C24, HT46C64, HT46C65 |
HT46R47, HT46R22, HT46R62 |
HT46C47, HT46C22, HT46C62 |
HT46R63 |
HT46C63 |
| CS/H |
225.3pF |
94.2pF |
112.6pF |
71.3pF |
56.32pF |
35.6pF |
|
A/D resolution |
10-bit |
10-bit |
9-bit |
9-bit |
8-bit |
8-bit |
|
A/D conversion time |
76tAD |
76tAD |
76tAD |
76tAD |
64tAD |
64tAD |
|
A/D sampling time |
32tAD |
32tAD |
32tAD |
32tAD |
32tAD |
32tAD |
Note: tAD is the A/D clock period detailed in the datasheet.
Question 23
The HT46R23 and HT46R24 have 2 and 4 PWM channels respectively. By writing the same values into the PWM registers and enabling them at different times, will PWM output waveforms with different phases be generated?
Answer
No, PWM waveforms with different phases will not be generated as the waveforms are derived from the same PWM counter.
Question 24
When using the HT46R22 with a 4MHz system clock, what is the frequency of the source clock for the internal timer?
Answer
The internal timer source clock frequency for this device is the same as the system clock, therefore in this case it is 4MHz.
Question 25
What is the function of the WDT?
Answer
The WDT is designed to monitor the MCU software and hardware operations. Users should employ the CLEAR WDT
(CLR WDT or CLR WDT1 and CLR WDT2 ) instructions should any abnormal operation or malfunction happens when a WDT overflow would occur which will then reset the MCU to resume normal operation. The WDT monitoring effects mainly depend on the software program design.
Question 26
Is the value of conversion in the 8-bit A/D MCUs equal to
N*Vref/255 or N*Vref/256?
Answer
Because the conversion value is of a discrete nature, it does not express an absolute value, it rather expresses a range instead. For example "0" can indicate a voltage between 0 Volts and
Vref/256 while "1" can indicate a voltage between Vref/256 and 2Vref/256 etc. When using the
N*Vref/256 formula, the largest error value will be Vref/256. When using the
N*Vref/255 formula, the error lies between a value of -Vref/256 and
Vref/256. In both cases the actual error range is the same. Therefore both the /255 or /256 value are acceptable.
Question 27
Many of the Holtek MCUs have a Low Voltage Reset function. When this operates what is the condition of the I/O, OSC pins etc?
Answer
When the power supply voltage falls below the specified LVR voltage, the LVR function will be activated. When this happens the I/O pins will revert to an input condition, and the oscillator will start up. The LVR voltage will vary according to the process, for details consult the DC characteristics section of the datasheet.
Question 28
What is the difference between the activation of an LVR function and pulling the RES pin low?
Answer
The difference is that in the case of the
LVR, if the operating voltage falls below the LVR voltage but remains higher than the lowest operating voltage, the oscillator will continue running. However if the RES pin is pulled low the oscillator will be always be stopped.
Question 29
In the HT46R65, how can variables in bank2 be defined? When the data db is used to define variables, when the number of variables exceeds 192, the compiler generates an "exceed RAM capacity error message."
Answer
It is necessary to use the RAMBANK banknum
section-name[,section-name,...] to declare the data memory sections. This directive is used to declare the data sections in the data memory block.
banknum defines the number of the data memory divisions, the range is from 0 to the maximum size of data memory block.
section-name is name given to the previously defined data memory divisions. This enables more than one section to be declared within the same data memory blocks.
For more details on how to use this consult the following:
http://www.holtek.com.tw/english/literature/ht-ide3k.pdf
Question 30
Can all pins on the HT46R22 be used as A/D inputs? Can any remaining pins be used as I/O pins?
Answer
The ADCR register is used to determine which pins are to be used as A/D inputs and which are to be used as I/O pins. If the PCR2, PCR1 and PCR0 bits in the ADCR register are set to "1XX" then all PB pins will be used as A/D inputs. If these bits are set to "001" then only PB0 will be used as an A/D input, the other PB pins will be used as standard I/O pins. For more details see the following table:
|
Name(ADCR)
|
Bit
|
Function
|
|
ACS0
ACS1
ACS2
|
0
1
2
|
ACS2,ACS2,ACS0:A/D channel choice
0,0,0:AN0
0,0,1:AN1
0,1,0:AN2
0,1,1:AN3
1,x,x:undefined, do not use
|
|
PCR0
PCR1
PCR2
|
3
4
5
|
PCR2,PCR1,PCR0:PB3~PB0 definition
0,0,0:PB3,PB2,PB1,PB0
0,0,1:PB3,PB2,PB1,AN0
0,1,0:PB3,PB2,AN1,AN0
0,1,1:PB3,AN2,AN1,AN0
1,x,x:AN3,AN2,AN1,AN0
|
|
EOC
|
6
|
A/D conversion end flag(0:A/D conversion ended)
|
|
START
|
7
|
A/D conversion start control
0→1→0:start
1→0:A/D conversion reset, set to "1"
|
Question 31
The HT46R22 RAM space exists in the range 0x40--0x7f, however as the system has 6 stack levels, do they also exist within this 0x40--0x7f area?
Answer
The stack area has its own memory space and does not lie within the RAM or ROM memory area.
Question 32
In the HT46R47 is it possible not to use the A/D interrupt? After initiating a START pulse, by looking at the EOC flag to
see if it has been reset to zero, can I determine that the conversion had ended?
Answer
Yes, this is possible.
Question 33
What are the special features of the UART in the HT46RU25?
Answer
The UART uses full duplex asynchronous communication, and can choose either an 8 or 9-bit character length, with odd or even parity and with a choice of either one or two stop bits. The UART also has its own baud rate generator with an 8-bit frequency division register, various error checking functions as well as various interrupts and address checking. There is also a two level FIFO receiver buffer as well as transmit and receive interrupts.
Question 34
What are the conditions for the generation of a UART interrupt?
Answer
When the UART meets any of the following conditions, an interrupt will be generated: when a transmission has ended, when the transmit register is idle, when a data reception has ended, the occurrence of an overrun error or an address match.
Question 35
How can the HT46RU25 UART serial data transmission frequency be calculated?
Answer
The UART function contains an internal baud rate generator which is controlled by both the BRG register and bit 2 of the UCR2 register which is known as the BRGH bit. If the BRGH bit is set to "0" the baud generator frequency will be governed by the equation Fsys/[64*(N+1)]. If the BRGH bit is set to "1" the baud generator frequency will be governed by the equation Fsys/[16*(N+1)]. The value of N is from 0~255.
Question 36
Why is it when I use the Baud Rate formula to calculate the Baud Rate it is different from the actual rate?
Answer
According to the Baud Rate formula, the value of N that is calculated will be a normal floating point number. However the actual value that will be placed into the BRG register will be the closest value to this number and not the actual value. Because of this it is difficult to avoid errors between the actual value and the theoretical value.
Question 37
What is the transmit and receive data types and waveforms for the UART?
Answer
For the transmit and receive mode consult the following table.

For the data waveforms consult the following diagram.

Question 38
What are the steps to initialise the UART?
Answer
1. Setup the BN0, PRT, PREN and STOPS bits to determine the data length, parity type and stop bit length.
2. Setup the BRG register to determine the Baud Rate.
3. Set the TXEN bit to enable the UART function.
Question 39
What steps are required to initialise the UART receiver?
Answer
1. Setup the BN0, PRT, PREN and STOPS bits to determine the data length, parity type and stop bit length.
2. Setup the BRG register to determine the Baud Rate.
3. Set the RXEN bit to enable the UART function. AT this point the UART will await the detection of the first bit.
4. After normal reception of the data, the USR register can be read, this action will clear the RXIF bit.
5. Read the received data from the RXR register.
Question 40
What is the meaning of an overrun error in the UART function, and if it occurs how does the UART handle such an error?
Answer
The RXR register is a two level FIFO buffer area, where two bytes can be held while another third byte is being received. The application program needs to read the RXR register before the third data byte has been completely received, otherwise an overrun error will occur. When such an error occurs the following will take place: the OERR bit in the USR register will be set, the data in the RXR register will not be discarded and the RSR register data will be overwritten. Also if the RIE bit is set to 1, an interrupt will occur.
Question 41
How many registers does the UART have and what functions do they have?
Answer
The UART function has 5 associated registers known as USR, UCR1, UCR2, BRG and TXR/RXR. The USR is the UART's status register, which is read only and can be read using the program. The UCR1 and UCR2 registers are the control registers for the UART and are used to define the UART functions, such as the enable/disable, odd or even parity, transmission data length etc.
The main function of the UCR2 register is to enable or disable the transmit or receive functions as well as the interrupt enable functions. It also controls the Baud Rate and enables or disables the receive data wake-up bit.
The BRG register is used to setup the Baud Rate. The value of BRG is related to the condition of BRGH.
The TXR/RXR register is used for the transmit and receive data.
Question 42
How does the UART transmit data?
Answer
When the UART is transmitting data, the data will be transferred from the shift register to the TX pin, starting with the LSB and ending with the MSB. When in the transmit mode, the internal TXR register and the shift register form a FIFO buffer. If the 9-bit data option is chosen, the MSB will be stored in bit TX8 of the UCR1 register.
Question 43
What kinds of receive errors does the UART generate?
Answer
The UART will generate four kinds of receive errors which are Overrun Error, Noise Error, Framing Error and Parity Error.
Question 44
How is the RAM in the HT6R454A and HT46R54 differentiated?
Answer
The HT46R54 has a RAM structure of 88 X 8, with memory pointers MP0 and MP1, 7-bits wide. The HT46R54A has a structure of 280 X 8 with MP0 and MP1 8-bits wide.
Question 45
Can the LVR be simulated in the ICE?
Answer
The ICE has a fixed VDD voltage of 5V, therefore it is not possible to simulate the operation of the LVR.
Question 46
What are the differences between the HT46R49E and the HT46R49?
Answer
The HT46R49E device uses modern packaging techniques to combine two chips into a single package. One device is the HT46R49 and the other device is a 1K bit Data EEPROM.
This category of products can reduce packaging costs and supply the user with a more economical solution in addition to reducing circuit board area, making it suitable for devices with space constraint limitations. Both the HT46R49 and HT46R49E are supplied in 24/28 pin SKDIP and SOP package forms.
Question 47
When the Timer/Counter has been started and is running, can data be written to it?
Answer
Yes this is possible, however any new data written to the timer will be first stored in the preload registers and not loaded immediately to the timer registers. When the next counter overload occurs the data will be written to the timer registers.
Question 48
Can more than one A/D converter channel in the AD type MCUs be open at one time?
Answer
This is not possible. However a polling method can be used to open each channel and then use interrogating or interrupt methods to read back the value.
Application Description
- Question 1
As there are no Push and POP instructions, when an interrupt occurs how is the data backed-up?
- Question 2
Can the Call instruction be used within an interrupt routine?
- Question 3
When an interrupt is being serviced will other occurring identical interrupts be effective?
- Question 4
How should unused I/O pins be managed?
- Question 5
Why, when PA is low the device cannot wake up?
- Question 6
Why, when a low going edge is presented on the external interrupt pin the MCU does not wake-up?
- Question 7
Is it possible to disable the wake-up function of the external interrupt?
- Question 8
What is the purpose of 2 CLR WDT instructions?
- Question 9
How is the HT46 A/D type MCU PWM setup?
- Question 10
How is the HT46 MCU A/D Converter setup?
- Question 11
How is the HT46 A/D Type MCU I2C Bus setup?
- Question 12
For 2-cell battery applications (2.2V~3.8V), is the Low Voltage Reset
(LVR) still available?
- Question 13
The system frequency is 4MHz and the ADCLK is
fsys/32 , why is the A/D conversion to a 250 us square wave sometimes incorrect?
- Question 14
For Holtek's MCUs, is there any way to reset the stack pointer other than by a chip RESET?
- Question 15
If the RC oscillator is selected as the system clock, what are the purposes of the external resistor and capacitor? Can the capacitor be omitted?
- Question 16
How to decide the RA value?
- Question 17
What is the A/D input impedance?
- Question 18
How can I find the minimum value of A/D Acquisition Time
(tAC)?
- Question 19
What is the input voltage range of the A/D input pins?
- Question 20
Can the I/O pins on the HT46 series of MCUs be used as LCD drive pins?
- Question 21
How to use the timer auto-reload function of
Holtek MCUs?
- Question 22
For HT46 series MCUs, how to adjust the PWM frequency on port D?
- Question 23
What should I do to use an external crystal during my program development?
- Question 24
What steps should be taken to reduce power consumption before entering the HALT mode if A/D Converter is used?
- Question 25
When in the low power mode, how should any unused inputs be managed? Also, what is meant by a no load condition?
- Question 26
As the A/D converter has multiple inputs, is interference a problem.
- Question 27
When using a 3-pin resonator/crystal in my MCU application can the capacitor be connected to VDD instead of
VSS?
- Question 28
When writing my program, if I want to create a Table in Program Memory, how do I start my table at a specific address? If the ORG statement is not suitable are their other methods of implementation?
- Question 29
How is the A/D converter activated and how can I obtain the contents of the converted value?
- Question 30
How can the PWM function in the HT46R22 device be used to generate different voltage output levels?
- Question 31
How can I use C language to read the serial number written into an OTP by the OTP writer?
- Question 32
When using the BZ/BZB function in the HT46/HT47/HT48/HT49 series devices, the sound emitted is not loud enough, what can I do about this?
- Question 33
After starting the TMR with a preloaded value of 240, and then immediately implementing a CLR TMR instruction, a timer interrupt seems to be generated at the wrong time and well before the overflow time should have been reached. Can you explain why this happens?
- Question 34
I have a problem using the oscillator on the HT46R64. When using the emulator everything works fine, however on the actual device, the 32768Hz oscillator will not oscillate. The problem remains even if the oscillator is replaced.
- Question 35
For applications where the I/O pin
connection to the application circuitry is rather long,
what external protection measures should be taken?
- Question 36
How do I determine which applications should
use which PWM mode, either the (6+2) mode or the (7+1)
mode?
- Question 37
In the HT46R64 device, how do I define an
LCD variable in the C language?
- Question 38
When using the HT46 emulator to emulate the
HT46R23 device, if an external crystal oscillator is used
and if "Internal" is not selected, when
compiling the following errors are displayed:
a."power_on reset has failed"
b."detect program counter overflow(2101h)
check:(1)last instruction (2) program flow (3) Tbhp (4) bp
usage"
What is the reason for this?
- Question 39
Why, when I write to TMRL and TMRH the contents do not change? The code I use is as follows:
mov a,131
mov tmrl,a
mov a,0ffh
mov tmrh,a
When the above code is executed, the TMRL and TMRH registers retain their original value and do not change.
- Question 40
When using a Holtek MCU in a voice application, within the software I wish to use look up table data as follows:
| TABLE1: |
DC 0FFE1H,0FE32H,0FA34H,0FC78H |
|
|
DC 0FECDH,0FEDCH,0FE57H,0FD87H |
; 16bit table values |
Is it possible for Look up table data definitions of 16-bits to accept the format of data given in TABLE1?
-
Question 41
When using the tools to change the value of bits in the PA port register from "0" to "1", why when after checking the content of the register, I cannot see that the PA pin has changed its value.
-
Question 42
In the HT46 A/D series of MCUs, how can I determine when the A/D conversion has finished?
-
Question 43
In the HT46R51/52 devices, how is the PWM used? Here the PWM register address is 1AH.
-
Question 44
When using the ICE to emulate the HT46R53A, bit 7 of MP0 is always 1, therefore if 00H is written to the register then its value will be 80H. If this is the case how can the full range of the IC RAM be indirectly addressed.
-
Question 45
When using a Crystal system oscillator, why is it necessary to connect two resistors to the crystal?
-
Question 46
When using the comparator function in the HT46R12A, after the comparator is enabled and a 2.8V signal input to the comparator input, the comparator input pin remains at 0V and seems like the comparator is not working?
-
Question 47
If an MCU input pin is to be used for zero crossing detection of 110V or 220V/230V power lines, what value of external resistor should be used to ensure the device is not damaged.
-
Question 48
What is the maximum current that can be taken by an input port?
-
Question 49
On the demo board, when implementing an A/D voltage conversion, the result of the conversion is unstable and fluctuates. How can this be remedied?
-
Question 50
How can the accuracy of the A/D function in the Holtek microcontrollers be improved?
-
Question 51
During the A/D converter conversion process, a certain amount of time is required for sampling and conversion. During this time can the MCU execute other instructions?
- Question 52
In the HT46RU25, from within ROM BANK0, how can a call to a ROM BANK1 subroutine be made?
- Question 53
How is ROM BANK1 used in the HT46RU25?
- Question 54
The interrupts in the Holtek MCUs have priorities. If a high interrupt occur will it override a low priority interrupt already in progress?
- Question 55
Before the HT46R22 starts to transmit data, when initializing the IIC bus, are there any special points to note?
- Question 56
As the HT46R22 is a slave device, when implementing IIC communication, how is control of SDA relinquished?
|