|
Basic Information
Question 1
What are the contents of the HT48 I/O type MCUs?
Answer
Together there are a total of 8 devices in the Holtek I/O MCU series. Made up from different memory sizes of 1K, 2K, 4K and 8K and supplied in both OTP and Mask versions. They are known by name as the HT48R10A-1/HT48C10-1, HT48R30A-1/HT48C30-1, HT48R50A-1/HT48C50-1,
HT48R70A-1/HT48C70-1, HT48R52 and 48R53. The specifications and description of each device can be found in its relevant data
sheet.
Question 2
What are the various packages available in the HT48 I/O type MCUs?
Answer
Please see table below. Mask type MCU HT48CXX-1 have the identical packaging forms.
HT48R52 : 52QFP
HT48R53 : 52QFP
| HT48R10A-1 |
: 24 SKDIP & SOP |
| HT48R30A-1 |
: 24 SKDIP & SOP ( compatible pinouts with HT48R10A-1 for convenient MCU
upgrade)
: 28 SKDIP & SOP |
| HT48R50A-1 |
: 28 SKDIP & SOP (compatible pinouts with HT48R30A-1 for convenient MCU
upgrade)
: 48 SSOP |
| HT48R70A-1 |
: 48 SSOP (compatible pinouts with HT48R50A-1 for convenient MCU
upgrade)
: 64 QFP |
| HT48R52 |
: 52QFP |
| HT48R53 |
: 52QFP |
Question 3
What are the special features and characteristics of the HT48 I/O type MCUs?
Answer
Operating Voltage range of 2.2V ~ 5.5V
Industrial standard temperature range of -40oC ~ +85oC
Low Voltage Reset function
Fully compatible OTP and Mask Types
For further details consult the relevant Holtek data sheet
Question 4
Are the HT48 I/O type MCUs available in Dice form?
Answer
Holtek provides a service to supply customers with high volume requirements for Dice Form MCUs. Available for the full range of devices it is important that customers take note of the special requirements of dice form devices for bonding and OTP programming.
Question 5
What is the operating frequency of the HT48 I/O 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 6
What are the system clock sources available for the HT48 I/O type MCUs?
Answer
For the HT48 I/O type MCU, there are three system clock resources available, namely:
-
External RC Oscillator
-
External Crystal Oscillator
- Internal RC Oscillator, if internal RC Oscillator is chosen, only 3.2MHz, 1.6MHz, 800kHz and 400kHz are available
Question 7
When UARTEN, TXEN and RXEN are set, what will be the conditions of the pin-shared TX and RX pins?
Answer
When the three bits UARTEN, TXEN and RXEN are set, the I/O pins will be automatically set to a TX output and an RX input. Also any pull high resistor option on the RX pin will be inhibited.
Functional Description
Question 1
What are the differences between the various devices in the HT48 I/O 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 |
Timer |
Interrupt |
PFD |
UART |
Stack |
Package |
| 8-bit |
16-bit |
RTC |
Ext. |
Int. |
HT48R10A-1
HT48C10-1 |
2.2V~
5.5V |
400kHz~
8MHz |
1Kx14 |
64x8 |
21 |
1 |
-- |
v |
1 |
1 |
v |
-- |
4 |
24SKDIP/SOP |
HT48R30A-1
HT48C30-1 |
2.2V~
5.5V |
400kHz~
8MHz |
2Kx14 |
96x8 |
25 |
1 |
-- |
v |
1 |
1 |
v |
-- |
4 |
24SKDIP/SOP,
28SKDIP/SOP |
HT48R50A-1
HT48C50-1 |
2.2V~
5.5V |
400kHz~
8MHz |
4Kx15 |
160x8 |
35 |
1 |
1 |
v |
1 |
2 |
v |
-- |
6 |
28SKDIP/SOP,
48SSOP |
HT48R70A-1
HT48C70-1 |
2.2V~
5.5V |
400kHz~
8MHz |
8Kx16 |
224x8 |
56 |
-- |
2 |
v |
1 |
2 |
v |
-- |
16 |
48SSOP,
64QFP |
HT48R90A-1*
HT48C90-1* |
2.2V~
5.5V |
400kHz~
8MHz |
16Kx16 |
576x8 |
56 |
1 |
2 |
v |
2 |
4 |
v |
v |
16 |
48SSOP,
64QFP |
|
Part No. |
VDD |
System
Clock |
Program
Memory |
Data
Memory |
I/O |
Timer |
Interrupt |
Buzzer
Output |
Stack |
Package |
| 8-bit |
RTC |
Ext. |
Int. |
| HT48R52 |
2.2V~5.5V |
400kHz~8MHz
or 32768Hz |
2Kx14 |
88x8 |
36 |
1 |
v |
1 |
1 |
v |
4 |
52QFP |
| HT48R53 |
2.2V~5.5V |
400kHz~8MHz
or 32768Hz |
4Kx15 |
88x8 |
36 |
1 |
v |
1 |
1 |
v |
4 |
52QFP |
Question 2
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 3
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 4
When in HALT mode why does the device continue to consume power?
Answer
When the MCU enters the HALT mode the oscillator is stopped. However if the WDT oscillator (if WDT is enabled in the options) or if the RTC oscillator is still running then some power will be consumed. In addition, the I/Os will maintain the condition they were in when the HALT instruction was executed. It is important to check if the I/Os inputs are floating or outputs remain loaded in the HALT mode that they might consume power.
Question 5
Why, when PA is low the device cannot wake up?
Answer
The PA port pins can all be configured to wake up the device but are activated only on a low going edge. If the corresponding PA pin was low when the HALT instruction was executed then the low logic state of this pin will have no wake up effect as no low going transition exists.
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 HT48 I/O 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
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 10
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 11
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 12
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 2
n+1 is the measured pulse width.
Question 13
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 14
How is the PFD and Buzzer Mode setup?
Answer
The PFD and Buzzer are identical in their operation. To utilize the PFD or Buzzer Mode, the following process should be followed:
-
To implement the PFD or Buzzer function, the corresponding configuration option should be chosen
-
Set the Prescaler (PSC2~PSC0=n) value and TMR initial value from the formula
fPFD = (fSYS / (2n+1x(256-TMR)x2))
-
Start the Timer by setting the TON bit in the TMRC
-
Set PB.0 and PB.1 to be in Output Mode, i.e.PBC.0 and PBC.1=0
After these steps are taken, set PB.0=1 which will turn on the PFD or the Buzzer ON. If set the PB.0=0 will turn the PFD or Buzzer OFF.
Question 15
What are the Timer Clock Source choices if the Internal RC Oscillator + RTC mode is chosen? Answer
If the internal RC Oscillator + RTC mode is chosen, the timer clock source can be either be fSYS/4 or the RTC OSC. If fSYS/4 is chosen as the timer clock, the Timer will stop counting in the HALT Mode, but if the RTC OSC is chosen as the system clock, the Timer will still count and may serve as a Real Time Clock (RTC).
Question 16
How is the Real Time Clock (RTC) function implemented?
Answer
First, the Internal RC Oscillator + RTC mode must be chosen, and an external 32768Hz Crystal connected to OSC1 and OSC2. Internally, the Timer/Counter should be selected to be in the Timer Mode with its clock sourced from the RTC OSC. This ensures that the timer keeps operating and generates a wake-up signal through an internal interrupt when in the HALT mode.
Question 17
What is the duration of the Power On Reset?
Answer
For the HT48 I/O type MCU at 3V operating voltage, the Power On Reset time range is 45ms~180ms; at 5V, the Power On Reset time range is 35ms~140ms.
Question 18
In the HALT mode, is there any power consumption associated with the Low Voltage Reset
(LVR) circuitry?
Answer
In the HALT mode, the Low Voltage Reset function has no effect, therefore, there is no power consumption considerations when in the HALT mode.
Question 19
How to use the timer auto-reload function of Holtek MCUs?
Answer
If you wish to assign the timer a start counting value that will be automatically reloaded after each timer overflow, the following steps may be taken;
If you wish to change the start counting value, you may simply save the new value to TMR, which will be loaded after the next timer overflow.
Question 20
What should I do to use an external crystal during my program
development?
Answer
Firstly, in selecting the Options for SYSFREQ, keep the
"Internal" not checked which will let you use external clock
source. Secondly, insert the crystal into Y1 position on the
Interface Card, meanwhile make sure that the jumper JP4 is set to
crystal. Now you can use the external crystal during your program
development.
Question 21
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 22
How can I/Os be used to measure temperature?
Answer
The I/Os can be used in a charge/discharge circuit to measure temperature, however 3 I/Os are required, 2 outputs and one input. One of the outputs is connected to a reference fixed value resistor R1 while the other output is connected to a temperature dependent resistor R2. The other sides of these two resistors are connected together and also connected to a capacitor C1. The other end of the capacitor is connected to ground. The threshold voltage of the input is used to check the charge and discharge times of the capacitor. R1 is used as a reference to make corrections to the measured value of temperature made by R2. The measurement principle is: ΔT1=R1C1 ΔT2=R2C1
--> R2=ΔT2R1/ΔT1
Question 23
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 24
If I want to use the timer to wake up the system when in the HALT mode, I encounter the following problem. The Holtek datasheet says that after the HALT instruction is executed the system clock will be stopped, if this happens how can the timer be used to wake up the system?
Answer
When in the HALT condition, the system clock is stopped, so if the timer source clock originates from the system clock, the timer will also cease its counting function when the system enters the HALT mode. However if the timer clock source originates from another clock source such as the
RTC, the timer will continue to function even when in the HALT mode. In this case when a counter overflow occurs, the system will be woken up if it is in the HALT mode.
Question 25
What are the special characteristics of the UART in the HT48RU80 and what are the conditions to generate a UART interrupt?
Answer
Characteristics: Full-duplex asynchronous communication, choice of 8 or 9-bit character length, choice of odd or even parity, choice of 1 or 2 stop bits, baud-rate generator with 8-bit prescaler, multi error detection, interrupt and address detect, 2-byte deep FIFO receive data buffer, transmit and receive interrupts.
Interrupt generation conditions: transmission complete, transmission register empty, receive complete, overrun error, address match.
Question 26
After a power-on reset, a RES pin reset and LVR reset, how is the Data Memory data affected?
Answer
In general after a power on reset, their general purpose registers will be initialised, the details of which can be found in the device datasheet, whereas the general purpose registers will have undefined values. After a RES pin reset the special purpose registers will be intialised while the general purpose registers will retain their data. The LVR reset has the same effect as the RES pin reset, however it must be noted that the LVR will only become active if the power supply voltage falls below the specified voltage for more than 1ms.
Application Description
- Question 1
In the HT48R10A-1/HT48C10-1 and HT48R30A-1/HT48C30-1, why is it, when a 0 is written to MP Bit7, when read back the value is 1?
- Question 2
As there are no Push and POP instructions, when an interrupt occurs how is the data backed-up?
- Question 3
Can the Call instruction be used within an interrupt routine?
- Question 4
When an interrupt is being serviced will other occurring identical interrupts be effective?
- Question 5
How should unused I/O pins be managed?
- 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
If the WDT oscillator clock is selected how is the WDT timing calculated?
- Question 9
What is the difference between choosing the WDT oscillator or the fSYS/4 clock as the WDT clock source?
- Question 10
What is the purpose of 2 CLR WDT instructions?
- Question 11
When the 8-bit Timer/Counter clock is sourced from the
Prescaler, can the Prescaler be reset?
- Question 12
For 2-cell battery applications (2.2V~3.8V), is the Low Voltage Reset
(LVR) still available?
- Question 13
Are the Reset circuits provided in the data sheets suitable for all applications?
- Question 14
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 15
What is the system frequency tolerance if an RC oscillator is used as the system clock?
- Question 16
Can the HT48 series of MCUs be used to implement an LCD driver?
- Question 17
When an RC type clock is chosen as the system clock, how can the actual frequency obtained from this RC clock be measured?
- Question 18
What are the OTP dice programming steps for COB form?
- Question 19
I want to produce my products with an OTP dice form on board, how do I program those OTP dice devices?
- Question 20
When in the low power mode, how should any unused inputs be managed? Also, what is meant by a no load condition?
- Question 21
When using a 3-pin resonator/crystal in my MCU application can the capacitor be connected to VDD instead of
VSS?
- Question 22
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 23
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 24
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 25
In the HT48X10A-1/HT48X30A-1 devices, in the Program Memory table data area, why is some high data high incorrectly read back? For example, for table data written as 0FFFFH, after reading the data 03FFFH is returned?
- Question 26
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 27
What will happen if data is written directly into the Timer?
-
Question 28
After a timer overflow and when data is written to the Timer, at this time if the Timer is counting, why does the value of the Timer?
-
Question 29
After the MCU is woken up by a WDT overflow, what will happen to data written into the Timer?
-
Question 30
After the MCU is woken up by a PA port pin from a Halt condition, what will happen when data is written to the timer?
-
Question 31
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 32
What is the maximum current that can be taken by an input port?
- Question 33
How is the baud-rate calculated for the UART in the HT48RU80?
- Question 34
How is the TBHP register used in the HT48RU80?
- Question 35
When using C-language to write code, and if the RAM is not completely used, why is it during compilation that an insufficient RAM space error message is generated?
- Question 36
What are the steps for initialising the UART transmitter and receiver in the HT48RU80?
- Question 37
When using the HT48RU80, why is the calculated baud rate different from the actual baud rate?
- Question 38
In devices with multi ram banks, how can variables be defined in banks other than Bank 0?
- Question 39
Is the result the same when using the assembly language statements RR and RL and the C language bit move operators >> and << ?
Question 1
In the HT48R10A-1/HT48C10-1 and HT48R30A-1/HT48C30-1, why is it, when a 0 is written to MP Bit7, when read back the value is 1?
Answer
The Data Memory of the HT48R10A-1/HT48C10-1 ranges from 40H to 7FH and in the HT48R30A-1/HT48C30-1 ranges from 20H to 7FH. Because the Data Memory does not exceed 80H, then the MP only requires 7-bits (Bit0~Bit6) to be effective. Therefore any data written to Bit 7 has no effect and will always be read back as 1. Although MP is written with the value 70H reading it back will give F0H, however the memory pointer will actually point to 70H and consequently the indirect addressing method of reading and writing will be correct.
Question 2
As there are no Push and POP instructions, when an interrupt occurs how is the data backed-up?
Answer
Although there are no PUSH or POP instructions, the programmer can still assign memory space. (Example db: ACCStack for ACC Storage) to store the interrupt backup data. To do this first store the ACC data in an area of memory, after which the status register and other data to be stored can be stored in similar dedicated memory locations. Before returning to the main program the data should be retrieved similarly but in a reverse order i.e. ACC is the last to be retrieved. When this is completed a RETI instruction should be executed to return to the main program.
Question 3
Can the Call instruction be used within an interrupt routine?
Answer
Because of the limitations in size of the MCU Stack, programmers must be exceptionally careful if using a call instruction inside an interrupt routine. If the program is in an interrupt routine and the stack is full, then executing a call instruction will result in a stack-over situation preventing the program from returning properly from the interrupt routine. Therefore if it is necessary to execute call instruction from within interrupt routines it is imperative that the worst case condition regarding stack requirements are considered. Before entering interrupt routines it is essential to verify that enough stack levels are available.
Question 4
When an interrupt is being serviced will other occurring identical interrupts be effective?
Answer
In normal operation when the MCU enters an interrupt routine the EMI flag will be cleared (EMI=0), which will prevent any corresponding interrupts from being serviced. However if the program is used to actively set the EMI flag (EMI=1) when an interrupt is being serviced then if the stack is not full, all other interrupts (including identical interrupts) will be effective. If multiple interrupts are necessary the programmer must take great care to ensure that the backed up data from the present interrupt is not corrupted by any following interrupts. Unless in cases of absolute necessity it is strongly recommended that multiple interrupts are not permitted.
Question 5
How should unused I/O pins be managed?
Answer
Any unused I/O pins should be managed properly so as to prevent from power consuming. The best method to prevent this is to set any unused pins as outputs however if set as inputs they should be selected to have a pull up option. If a pull-high option is not used then the pin should be tied to ground.
Question 6
Why, when a low going edge is presented on the external interrupt pin the MCU does not wake-up?
Answer
Although the MCU can be woken up by an external interrupt, the actual wake process takes place only when the Interrupt Request Flag EIF changes from "0" to "1". If when the MCU enters a HALT condition the EIF flag is already set to "1", then a further interrupt will have no effect on the status of the EIF flag, which will remain in its present "1" condition. As a transition a wake-up will not occur.
Question 7
Is it possible to disable the wake-up function of the external interrupt?
Answer
If before entering a HALT condition the EMI is first cleared and then if the EIF bit is set to "1" the external interrupt will have no wake-up function.
Question 8
If the WDT oscillator clock is selected how is the WDT timing calculated?
Answer
The WDT oscillator at an operating voltage of 5V has a typical
WDT period ranging from 8ms to 33ms. The watchdog time is calculated
from the formula: WDT period x 2(WS2~WS0).
For example if WS2~WS0 = 7H then the watchdog time will range
from 8 ms x 27=1 sec to 33 ms x 27=4.2 sec.
Question 9
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 10
What is the purpose of 2 CLR WDT instructions?
Answer
Two CLR WDT instructions feature increases the system reliability. If the program contains two loops in the main program a CLR WDT1 instruction can be placed in one loop and a CLR WDT2 instruction in the other loop. If a malfunction occurs, perhaps due to noise, and the program enters an infinite loop none of the CLR instructions in the other loop will be executed, therefore the WDT will overflow and generate a reset signal to reset the MCU.
Question 11
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 12
For 2-cell battery applications (2.2V~3.8V), is the Low Voltage Reset (LVR) still available?
Answer
For the HT48 I/O type MCU, the Low Voltage Reset (LVR) function operates in the range of 2.7V ~3.3V, therefore the LVR feature is not applicable. If a 2.2V voltage detection function needed in applications, an external Voltage Detector (HT70XX) is recommended.
Question 13
Are the Reset circuits provided in the data sheets suitable for all applications?
Answer
Usually, the Reset circuits provided in the data sheets are applicable for most applications. Under some circumstances, a noisy environment for example, the Reset circuit might need to be modified for special user considerations.
Question 14
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?
Answer
The external resistor on the OSC1 pin is used to generate bias to control the internal RC charge and discharge. The frequency of the RC oscillator is determined by the value of this external resistor. The recommended 470pF external capacitor, which is connected to the OSC1 pin, is added to avoid cross-talk to the OSC2 line. The OSC2 pin is provided to supply an output frequency of 1/4 system frequency. However, if this 1/4 system frequency output, OSC2, is not utilized, the external capacitor on OSC1 pin can be omitted.
Question 15
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 16
Can the HT48 series of MCUs be used to implement an LCD driver?
Answer
Yes they can, but the implementation will be limited to 1/2 bias with pull-high and pull low resistors connected to the I/O pin. Three different voltage levels can then be obtained by setting up the pin as an output and setting it high, setting up the pin as an input, and setting up the pin as an output and setting it low.
Question 17
When an RC type clock is chosen as the system clock, how can the actual frequency obtained from this RC clock be measured?
Answer
When the RC clock is chosen as the system oscillator, pin OSC2 will be configured as a frequency measurement output pin, which can be used to measure the actual frequency that is generated by the RC oscillator. This pin is designed to provide a signal that is equal to the system oscillator frequency divided by four. However it should be noted that because the OSC2 output is an open drain NMOS output structure, it is necessary to connect a resistor between this line and
VDD.
Question 18
What are the OTP dice programming steps for COB form?
Answer
-
Bond the dice to the COB
-
Program the dice on the COB
-
Conduct a COB functional test
-
Encapsulate the COB and afterwards solder the other devices
Question 19
I want to produce my products with an OTP dice form on board, how do I program those OTP dice devices?
Answer
To program OTP devices, 11 pins are required and they should be reserved on the PCB. Please check your local agent for detailed information of those pins. Users should prepare the connecting cable from those 11 pins to the 40-pin TEXTOOL on the programmer and then follow the standard programming procedure to burn the device on the PCB. Note that the tracks of those 11 pins on the PCB should be as short as possible and among them the PA0~PA6 should avoid connections to the outputs of other devices. If this situation cannot be avoided, a 1K ohm resistor in series with each line is recommended. In addition, the cable from the PCB to the programmer should be less than 15 cm.
Question 20
When in the low power mode, how should any unused inputs be managed? Also, what is meant by a no load condition?
Answer
Any unused I/O lines could be setup as inputs, but a pull-high resistor must be connected to these inputs, otherwise these floating inputs may consume power. Another method would be to setup any unused I/O lines as outputs and set these lines to
a "0" level. A no load condition means that no connection is made to the I/Os. In this situation the only connections to the MCU are VDD, VS OSC1/OSC2 and RES.
Question 21
When using a 3-pin resonator/crystal in my MCU application can the
capacitor be connected to VDD instead of VSS?
Answer
When using 3-pin resonator/crystals, for reasons of layout
convenience, the capacitor can be connected to VDD instead of VSS.
Question 22
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?
Answer
When using the ORG expression, this can only be used to
indicate the offset from the start address of the present section.
To overcome this problem the SECTION directive can be used to
establish a table at any specific address, for example:
table .section at 300 'code'
This statement can be used to indicate the specific address
where the table should begin.
Question 23
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.
Answer
Before writing to TMRL and TMRH the timer interrupt must be disabled.
Question 24
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?
Answer
The Holtek MCU range each contain different Program Memory widths, ranging from 14 bits to 16 bits. MCUs that contain 16 bit Program Memory widths can accept data as shown in TABLE1 above, however other MCUs can only define data tables that are either 14 or 15-bits wide.
Question 25
In the HT48X10A-1/HT48X30A-1 devices, in the Program Memory table data area, why is some high data high incorrectly read back? For example, for table data written as 0FFFFH, after reading the data 03FFFH is returned?
Answer
For the Program Memory area of the HT48X10A-1/HT48X30A-1 devices, each word has a width of 14 bits. Therefore, for the data mentioned above the highest bits cannot be stored and will be read back as zeros. For this reason, if we try to store the data 0FFFF, only 3FFF will actually be stored as it is only 14 bits wide. Reading back from bits that do not exist will give the value of "0". For the Program Memory in the HT48X50A-1,which is 15 bits wide, there will be one bit which cannot be stored or retrieved as data. For this reason, if we place the data 0FFFFH into a table in the Program Memory, the highest bit which is a "1" will be read back as a "0". Therefore when the data is read back a value of 07FFFH will be obtained. The HT48X70A-1 will not exhibit this problem as its Program Memory is 16-bits wide.
Question 26
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.
Answer
When changing a specific bit value on the PA data register, only bits that are setup as outputs will be changed. Bits to be changed must first be setup as outputs by writing a zero to the corresponding bit of the PAC register.
Question 27
What will happen if data is written directly into the Timer?
Answer
When data is written to the timer, what will happen is governed by the operating state of the timer.
When the Timer is switched off, the data will be directly written into both the timer register and the preload register.
If the timer is running, the data will only change the value in the preload register, the value in the timer register will remain unchanged. Not until an overflow occurs will the value in the preload register be loaded into the timer register.
Question 28
After a timer overflow and when data is written to the Timer, at this time if the Timer is counting, why does the value of the Timer?
Answer
The difference in time between the timer overflow and the loading of the preloaded value is 1/2 period. From the time where the timer overflows to the point where the preloaded value is loaded, there is a difference of half a timer period. If data is written to the timer before the preload value is loaded, because the timer is already running, the new value will only be written into the preload register. When the timer is actually loaded, it will now load in the new value, and because of this, will directly affect the value in the Timer register.
Question 29
After the MCU is woken up by a WDT overflow, what will happen to data written into the Timer?
Answer
After a WDT overflow wakes up the MCU a warm reset will be executed, at which point the Program Counter and Stack will be restored. The other registers will not be changed. At this point two things can happen:
- If the Timer is running, the data written to the Timer will only be placed in the preload register. The previous value will not be changed. Not until an overflow occurs will the timer load in the value in the preload register.
- When the Timer is switched off, data written to the Timer will directly overwrite the value already in the Timer register and in the preload register.
Question 30
After the MCU is woken up by a PA port pin from a Halt condition, what will happen when data is written to the timer?
Answer
When the MCU is woken up from a Halt condition by a PA wake up pin, there will be a delay of 1024 Tsys (Tsys=1/Fsys)system clock cycles after which normal running will continue.
At this time two things can occur:
- When the Timer is counting, data written to the timer will only be written to the preload register, the present value will not be changed. When the timer overflows, the new value in the preload register will be loaded into the timer register.
- When the Timer is switched off, data written to the Timer will directly overwrite the value already in the Timer register and in the preload register.
Question 31
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.
Answer
When connecting an AC power line directly to an MCU input, the most important consideration is the AC line surge voltage and high frequency signals which could create excess input current or input voltage destruction. With an AC line voltage of 110V, it is recommended that a 2M ohm resistor is used. For 220V/230V AC line voltages, a recommended value of between 4 and 5M ohm is used. If the resistors are SMD types, then because their breakdown voltage is 200V, it is necessary to use 2 series connected resistors, each with 2 to 2.5M ohm value.
Question 32
What is the maximum current that can be taken by an input port?
Answer
Please do not exceed 400ua.
Question 33
How is the baud-rate calculated for the UART in the HT48RU80?
Answer
The UART function contains an internal baud-rate generator. This is controlled using the BRG register and the second bit, BRGH, in the UCR2 register. When BRGH is 0, the baud rate is equal to Fsys/{64*(N+1)} and when BRGH is equal to 1, the baud rate is equal to Fsys/{16*(N+1)}. N has a value between 0 and 255.
Question 34
How is the TBHP register used in the HT48RU80?
Answer
The TBHP register is generally used with the table read instruction TABRDC. It is used to indicate the highest 8-bit address of the table data. The lower 8-bit address is indicated by the TBLP register.
Question 35
When using C-language to write code, and if the RAM is not completely used, why is it during compilation that an insufficient RAM space error message is generated?
Answer
When using the C-language for program generation, the compiler will automatically allocate registers for use in interrupts, multiplication and division calculations etc. When the registers are being defined and during the compilation process, when the registers are being allocated, if what is required exceeds the RAM space, then the compiler will issue an insufficient RAM space error message.
Question 36
What are the steps for initialising the UART transmitter and receiver in the HT48RU80?
Answer
Transmitter Initialisation Steps:
1. Setup the BN0, PRT, PREN and STOPS to determine the data length, parity type and stop bit length.
2. Setup the BRG register to choose the baud rate.
3. Set the TXEN bit to enable the UART transmit function.
4. Read the USR register, and place the data waiting to be transmitted into the TXR register. This step will clear the TXIF flag.
5. If more data is to be transmitted only the previous step needs to be repeated.
Receiver Initialisation Steps:
1. Setup the BN0, PRT, PREN and STOPS to determine the data length, parity type and stop bit length.
2. Setup the BRG register to choose the baud rate.
3. Set the RXEN bit to enable the UART receive function. Now the UART will start to examine the first data bit.
4. After the data has been properly read, read the USR register. This step will clear the RXIF flag.
5. Read the RXR register to obtain the data .
Question 37
When using the HT48RU80, why is the calculated baud rate different from the actual baud rate?
Answer
This is because the calculated value of N is a floating point number. When this is written into the BRG register the actual value is the nearest value to N. This accounts for the difference in this difficult to eliminate error.
Question 38
In devices with multi ram banks, how can variables be defined in banks other than Bank 0?
Answer
To do this the RAMBANK instruction can be used, for example: To define a variable in RAM BANK 1:
RAMBANK 1 dsec1
dsec1 .SECTION 'data'
SD DB ?
Question 39
Is the result the same when using the assembly language statements RR and RL and the C language bit move operators >> and << ?
Answer
The results will be different. Using the assembly language RR and RL instructions, will move the related register data one bit right or left with the result in the same register and the C register unaffected. Using the C language bit move operators >> and << will move the data to the left of the operand either right or left. The number of bits moved is determined by the number to the right of the operand. If a right move operation is executed, then the leftmost highest bit will be replaced by a 0. Similarly if a left operation is executed then the rightmost lowest bit will be replaced by a 0. It is important to note that the move right or move left bits will move into the carry flag and will change the original carry value.
Points to Note
Question 1
What is the constraints on VDD during Power On?
Answer
To ensure the Power On Reset operates successfully, the VDD rising voltage is recommended to be completed within 20ms. For battery applications, the internal resistance will increase due to the low battery condition and will slow the rising edge of the power supply increasing the possibility of Power On Reset failures.
Question 2
For household appliance applications, under what circumstances should the LVR function be used? Also under what circumstances should the LVR not be used?
Answer
The LVR voltage is set at around 3.3V. For most battery powered applications it is normally not required to use the LVR, however for applications supplied by the regular utility mains supply the LVR can be used.
Question 3
When using different writer tools to program the OTP devices why are different checksums obtained?
Answer
This is because different methods of checksum calculation are used by different writers.
Question 4
What could be the reasons for low yield programming of OTP DICE devices?
Answer
Firstly, you should exclude bonding failure possibilities, as these are the major reasons for poor programming yield. If you are not sure whether there is a bonding issue, you may get assistance from our technical support personnel by sending us the decapsulated samples.
Question 5
When I use the HT-Writer to program the OTP Dice, an "MCU: Cannot identify" message will pop up. Is this a bonding problem or an OTP defect?
Answer
For the package form of OTP devices, its product ID will be burnt into the device which can be used to display the device information in the message window, however, if the product ID code is missing, a warning message will pop up. This is usually the case for dice form OTP devices which have no product ID. To disable this warning function, deselect the Check ID option under the Options menu. If the HT-Writer is to be used in stand-alone mode, set the switch DIP1, which is located on the back of the HT-Writer to the OFF position.
Question 6
What precautions should I take in designing the MCU Reset and
Oscillator circuit?
Answer
Please refer to the "HA0075E"
in the Application Notes
section of our company web site.
Question 7
When using the internal RC oscillator as the system clock what is
the tolerance value?
Answer
Because of temperature and process influences, the tolerance of
the internal RC oscillator can be as much as 40%. Therefore if using
a buzzer output or if critical timing functions are required, it is
recommended that an external RC or crystal oscillator is used.
Question 8
When the HT-ICE is used to emulate the HT48 series of I/O type MCUs, PB is setup using the following statements:
| CLR TON |
;Disable timer counting |
| CLR PBC |
;PB setup as outputs |
| SET PB |
;PB outputs all set High |
| JMP $ |
|
When the above statements are executed, PB0 is found to be low and the other PB pins are high. However the software indicated that the PB0 output is high. However actual measurement indicates that the pin is low. What is causing this condition to occur?
Answer
The PB0 and PB1 pins in the HT48 series of I/O type MCUs, are dual function pins, functioning both as buzzer pins and normal I/O pins. To ensure that the pins function as normal I/O pins the correct configuration option must be selected.
Question 9
Are there are limitations on using the I/O pins of the HT48 series MCUs to drive an LCD?
Answer
Because the I/O pins can only generate three voltage levels, namely, VDD, VDD/2 and GND voltages, therefore only 1/2 bias LCD panels can be driven. For LCD panels that require other Bias types, it is not possible to use the I/Os.
Question 10
How can the software be used to minimise the problem of noise generating a reset?
Answer
The most effective method of eliminating the adverse effects of noise is to eliminate the noise sources and isolate the noisy lines, however this can often be difficult to achieve. In hostile environments, the MCU may be subject to excessive amounts of noise interference, and in such cases one of the most often experienced phenomenon is that of spurious resets. To prevent the program from erroneous jumps software traps can be set or the watchdog timer used to reset the device.
Holtek MCUs have a TO (temporary stop flag) and a PDF flag (watchdog timer overflow flag), which can be examined to determine the source of the reset. Additionally flags can be buried in the RAM. Each time the program resets, these flags can be examined and the source of the reset determined. According to the result of these flag examinations, the program can then jump to different program sections. In this way the program can continue running, and the user will not be aware of any spurious reset occurrences.
Others
Question 1
What are the ESD and Latch up features of the HT48 I/O type MCUs? Answer
As the HT48 I/O type series of MCUs possess exceptional ESD and Latch up protection they are suitable for industrial use. In the area of ESD protection the devices conform to the US military spec MIL-STD-883E 3015.7 and each I/O can withstand in excess of 5KV of body static.
Regarding latch-up, the devices conform to the JEDEC-NO.17 specification, when tested in current mode, each I/O can withstand in excess of 100mA.
Question 2
Why there is no /INT pull high resistor configuration option for the HT48R70A-1/HT48C70-1?
Answer
For the HT48R70A-1 and HT48C70-1 devices, the /INT is an independent pin and is not shared with another I/O line. As pull-high resistor options are only available for I/O pins, then if the user application requires that the /INT pin has to be pulled-high, an external resistor must be added.
|