|
Basic Information
Question 1
What's the difference among PHONE MCU series?
Answer
PHONE MCU can be divided into three series:
-
HT95A series:HT95Axxx - I/O type, for basic applications.
-
HT95L series:HT95Lxxx - LCD type, for LCD applications.
-
HT95C series:HT95Cxxx - Caller ID type, for Caller ID applications.
Question 2
How many subtypes do I/O type Phone MCU have?
Answer
PHONE MCU I/O type contains four different subtypes.
| Part No. |
VDD |
Program
Memory |
Data
Memory |
General
I/O |
Dialer
I/O |
Timer |
External
Interrupt |
Stack |
DTMF
Generator |
Package |
HT95A100
HT95A10P |
2.4V~5.5V |
4Kx16 |
384x8 |
20 |
6 |
16-bitx2 |
3 |
4 |
v |
28SOP |
HT95A200
HT95A20P |
2.4V~5.5V |
4Kx16 |
1152x8 |
28 |
8 |
16-bitx2 |
4 |
8 |
v |
48SSOP |
HT95A300
HT95A30P |
2.4V~5.5V |
8Kx16 |
2112x8 |
28 |
8 |
16-bitx2 |
4 |
8 |
v |
48SSOP |
HT95A400*
HT95A40P |
2.4V~5.5V |
16Kx16 |
2880x8 |
44 |
8 |
16-bitx2 |
4 |
12 |
v |
64QFP |
Note:
(1)Part No. suffixed with 0 is Mask type.
(2)Part No. suffixed with p is OTP type.
(3)Part No. marked with * is under development.
Question 3
Is LVR (Low Voltage Reset) is provided in Phone MCU series?
Answer
No. Instead of the LVR (Low Voltage Reset) feature, the Phone MCUs are featured with the Low Battery Detector function. Please refer to data sheet.
Question 4
What is the power consumption of the low voltage detector LBD?
Answer
The low voltage detect circuitry will naturally consume some power. For example, it requires 50µA at 5V.
Functional Description
Question 1
How many operation modes do Phone MCU series have?
Answer
Phone MCU series has four operation modes:
-
Normal Mode:system OSC 3.58MHz enabled, 32768Hz OSC enabled, MCU working at 3.58MHz.
-
Green Mode:system OSC 3.58MHz disabled, 32768Hz OSC enabled, MCU working at 32768Hz.
-
Sleep Mode:system OSC 3.58MHz disabled, 32768Hz OSC enabled, MCU stopped (power-saving).
-
Idle Mode:system OSC 3.58MHz disabled, 32768Hz OSC disabled, MCU stopped (power-saving).
Question 2
Does the RTC still work when the MCU is in the Idle Mode?
Answer
No. The Clock source of RTC is from the 32768Hz crystal. Once getting into the Idle Mode, 32768Hz oscillator will be turned off.
Question 3
Do the Timer Mode of Timer 0 and Timer 1 still work in Sleep Mode?
Answer
In Sleep Mode, both the system frequency and fSYS/4 stop. Meanwhile the 32768Hz
oscillator continues oscillating. The clock source of Timer 0 is fSYS/4, so Timer 0 won't function in Sleep Mode. While the clock source of Timer 1 is 32768Hz, so it will still work after getting into Sleep Mode.
Question 4
Do the Time Mode of Timer 0 and Timer 1 still work in Idle Mode?
Answer
No. In Idle Mode, both 32768Hz and fSYS/4 stop, therefore the Timer 0 and Timer 1 will not function.
Question 5
Under what situations will the Phone MCUs be reset?
Answer
The Phone MUCs will be reset when Power-on, External reset and WDT overflow reset.
Question 6
What will happen to the registers if reset occurs in different operation modes?
Answer
According to the operation mode, there are 5 reset situations:
-
Power-on reset
-
External reset, in the Normal Mode and Green Mode
-
External reset, in the Sleep Mode and Idle Mode
-
WDT reset, in the Normal Mode and Green Mode
-
WDT reset, in the Sleep Mode and Idle Mode
Phone MCUs have the TO and PDF flags to judge different reset conditions. The influence to the internal registers:
| |
TO |
PD |
General Memory |
Stack |
Program Counter |
Special Register |
| 1 |
0 |
0 |
unknown |
Back to origin |
Back to 0000h |
Partly unknown, Partly initial |
| 2 |
u |
u |
unchanged |
Back to origin |
Back to 0000h |
Partly unchanged, Partly initial |
| 3 |
0 |
1 |
unchanged |
Back to origin |
Back to 0000h |
Partly unchanged, Partly initial |
| 4 |
1 |
u |
unchanged |
Back to origin |
Back to 0000h |
Partly unchanged, Partly initial |
| 5 |
1 |
1 |
unchanged |
Back to origin |
Back to 0000h |
All unchanged |
Note: the "u" in the table means unchanged. For more details please refer to Data sheet.
Question 7
What interrupt resources are available in the Phone MCUs?
Answer
There are 6 interrupt vectors in the Phone MCUs:
| |
Name |
Description |
Interrupt Vector |
| 1 |
External interrupt |
Falling Edge signal on exteranl INT Pin |
04h |
| 2 |
TIMER 0 interrupt |
For 3 operation modes (note 1), Clock Source =
fSYS/4 |
08h |
| 3 |
TIMER 1 interrupt |
For 3 operation modes (note 1), Clock Source = 32768Hz |
0Ch |
| 4 |
Peripheral interrupt |
For FSK Receiver (note 2) |
10h |
| 5 |
RTC interrupt |
For 1Hz, Clock Source produced by 32768Hz |
14h |
| 6 |
Dialer I/O interrupt |
For triggering on HKS,
HDI or HFI Pin (note
3) |
18h |
Note:
-
Timer Mode, Event Counter Mode and Pulse Width Measurement Mode
-
For HT95C series with FSK Receiver
-
Falling or Rising edge on HKS, Rising edge on HFI or Falling edge on
HDI
Question 8
What's the Priority of the six Phone MCU interrupts?
Answer
The priority from high to low: External interrupt, TIMER 0 interrupt, TIMER 1 interrupt, Peripheral interrupt, RTC interrupt, and Dialer I/O interrupt.
Question 9
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 10
What is the access sequence of the 16-bit Timer/Counter?
Answer
For the HT95 Phone MCUs, 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 11
How is the Timer/Counter setup in the Timer Mode?
Answer
The Timer 0 uses the 1/4 system frequency as clock source which will be different in the Normal Mode and Green Mode, while the Timer 1 uses 32768Hz as clock source which won't change in the Normal Mode and Green Mode.
There are three modes available for the Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. Take Timer 0 for example. 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 TMR0 value
-
Assume in the Normal Mode, then Clock Source of Timer 0 is 3.58MHz/4 = 895KHz
-
Assume Timer 0 to be interrupted in every 23ms
-
23ms / (1/895K) = 20585 = 5069h
-
10000H - 5069H = 0AF97h
-
Write 97H into TMR0L and then 0AFh into TMR0H
-
Enable the corresponding interrupt by setting the ET0I and EMI bit
-
Start the Timer by setting the TON bit of the TMR0C
Once the Timer is enabled, it will count up and will be stopped when the TON bit in the TMR0C 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 TMR0 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. Take Timer 0 for example. 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 TMR0
-
Enable the corresponding interrupt by setting the ET0I and EMI bits
-
Start the Timer by setting the TON bit in the TMR0C register
Question 13
How is the 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 to TMR0, usually set to 0H for Pulse Width Measurements
-
Enable the corresponding interrupt by setting the ET0I and EMI bits
-
Start the Timer by setting the TON bit in the TMR0C
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 14
How is the RTC interrupt setup?
Answer
The clock source of the RTC is 32768Hz. Therefore all operation modes will work except for the Idle Mode. To use the RTC interrupt, the following process should be followed:
-
Set the EMI ([0Bh].0) and the ERTCI ([1Eh].1) to 1
-
Set the RTCEN ([24h].5) to 1 to enable RTC function
After the RTC is enabled, an interrupt will occur every second. The RTC interrupt vector is 14h.
Question 15
The data sheet selection table states that there are four sources for the external interrupt, but in the interrupt instruction, it states that that the external interrupt is triggered only by a high to low transition on the
INT/TMR1 pin. Why is this the case?
Answer
The phone MCU has four sources of interrupt, INT/TMR1,
HKS, HFI and HDI, all of which are triggered by external signals. This is the reason the selection table states that there are four external interrupt sources.
Question 16
What WDT options does the phone MCUs have?
Answer
There are four WDT options available:
-
Use the internal WDT OSC as the WDT clock source: the WDT period at 5V is about 78µs, therefore the WDT overflow time will be 78µs x
2(WS2WS1WS0)+9. For example, if WS2,WS1,WS0=7, then the WDT overflow time will be 78µs x
27+9 = 5.11s.
-
Use fSYS/4 as the WDT clock source: the WDT period in the Normal Mode is 1.117µs x
29, in the Green Mode is 122.07µs x 29, therefore the WDT overflow time will be
fSYS/4 x 2(WS2WS1WS0)+9. In the Sleep and Idle Mode, the WDT will cease to function.
-
Use the 32768Hz oscillator as the WDT clock source: the WDT period in the Normal Mode, Green Mode and Sleep Mode is 30.52µs x
29, therefore the WDT overflow time will be 30.52 x
2(WS2WS1WS0)+9. In the Idle Mode, the WDT will cease to function.
-
The WDT is disabled.
Question 17
How is the PFD Mode setup?
Answer
To utilize the PFD or Buzzer Mode, the following process should be followed:
-
Set FPFD ([2Eh].7) to 1 to select the 3.58MHz/4 as PFD clock source, while set the FPFD to 0 to select the 32768Hz as PFD clock source. In the Green Mode and Sleep Mode, only the 32768Hz clock source is available.
-
Set the prescaler division ratio (PRES1~PRES0)=n by the formual
fIN=PFD clock source / 2n
-
Set the PFDEN=1 to enable the PFD
-
Set the PFDD register with division value m (ranging from 0 ~255) ; the PFD output frequency formula is
fPFD = FIN /(2 x (m+1)).
After these steps are taken, the MUSIC pin will have the PFD output. If set
FPDEN=0 will turn off the PFD, clear the PFDD contents to 0 automatically, and MUSIC pin output low. Please note that if
FPDEN=0, i.e. the PFD is off, the PFDD contents cannot be modified.
Question 18
How many different types of dual tone multi-frequencies do the DTMF Generators have?
Answer
By writing a suitable value to the DTMFD ([21h]) register a choice of 16 dual-tone-multi-frequency signals can be generated as shown in the table.
| DTMFD |
DTMF Output frequency |
DTMF Code |
DTMFD |
DTMF Output frequency |
DTMF Code |
| 11h |
697+1209 |
1 |
41h |
852+1209 |
7 |
| 12h |
697+1336 |
2 |
42h |
852+1336 |
8 |
| 14h |
697+1477 |
3 |
44h |
852+1477 |
9 |
| 18h |
697+1633 |
A |
48h |
852+1633 |
C |
| 21h |
770+1209 |
4 |
81h |
941+1209 |
* |
| 22h |
770+1336 |
5 |
82h |
941+1336 |
0 |
| 24h |
770+1477 |
6 |
84h |
941+1477 |
# |
| 28h |
770+1633 |
B |
88h |
941+1633 |
D |
More details can be found in the data sheet.
Question 19
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 MP0 or MP1. After this any instruction that refers to the Indirect Register, known as IAR0 or IAR1, (e.g. MOV a, IAR0) 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. Please note that MP0, IAR0 and MP1, IAR1 should be used in pairs.
Question 20
How is indirect addressing used to write/read to BANKS other than RAM BANK0?
Answer
First switch the Bank Pointer to the target BANK and then save the read/write memory address in MP1 and read/write the data indirectly through IAR1.
Example:write the data 55h to the RAM BANK1 address [60h].
| MOV |
A,1 |
|
| MOV |
BP,A |
; set the Bank Pointer address to Bank1 |
| MOV |
A,60H |
; |
| MOV |
MP1,A |
; set the address pointer register MP1 to the address 60H |
| MOV |
A,55H |
; |
| MOV |
IAR1,A |
; write the value 55h to the memory pointed to by BP and MP1 |
Question 21
The HT95 Phone MCUs 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 22
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.
Question 23
Concerning the relationship between the HFI and HFC lines on the HT95168, can HFI be used to control
HFC? If so what is the way to implement this?
Answer
This is not possible. The HFC is an I/O pin, which has already been setup as an output by software to control the HFI input. HFI is triggered by a positive edge therefore when the HFC pin outputs as positive edge the HFI line will be triggered.
Question 24
Does the HT95168 device have a low battery voltage function?
Answer
The HT96168 is designed only for basic telephone sets therefore it has no low battery detect function.
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.
Application Description
- Question 1
How to connect external crystal of an MCU?
- Question 2
Can I input the external CLOCK signal directly to X1 PIN to change the system frequency of the
MCU?
- Question 3
How to switch the MCU in the Normal Mode?
- Question 4
How to switch the MCU from high frequency to low frequency to make the MCU working in the Green Mode?
- Question 5
If I don't care about the MODE0 value, can I set [26h] for 0 directly to switch the system frequency from high to low?
- Question 6
How to switch the MCU into the Sleep Mode?
- Question 7
How to switch the MCU into Idle Mode?
- Question 8
In my application program, I examine the state of UPEN bit (bit 5 of the MODE register) to determine if the system clock should be toggled between its two values of 32768Hz and 3.58MHz, however why after a power-on reset takes place, the expected toggle action does not occur?
- Question 9
Are the Reset circuits provided in the data sheets suitable for all applications?
- Question 10
How to use the external interrupt?
- Question 11
How do I measure the external signal frequency by using the pulse width mode of the Timer 0 and Timer 1?
- Question 12
What are the sources of the peripheral interrupt?
- Question 13
How is the Dialer I/O interrupt setup?
- Question 14
Why is there no interrupt when the HFI pin is used to detect an external high pulse?
- Question 15
As there are no Push and POP instructions, when an interrupt occurs how is the data backed-up?
- Question 16
Can the Call instruction be used within an interrupt routine?
- Question 17
When an interrupt is being serviced will other occurring identical interrupts be effective?
- Question 18
What are the points to note when selecting the different WDT clock sources?
- Question 19
What is the purpose of 2 CLR WDT instructions?
- Question 20
Does the Dialer I/O operate in any mode?
- Question 21
What are the state changes in the dialer I/O?
- Question 22
Why does the Dialer I/O still work when in the Idle Mode?
- Question 23
How is the low voltage detector LBD used in the phone MCU?
- Question 24
Why is it not practically possible for the current to be smaller than 2µA, as the data sheet said, when the MCU is in the Idle Mode?
- Question 25
How should unused I/O pins be managed?
- Question 26
How is theDTMF Generator output setup?
- Question 27
After Power on, and after EMI and PERI has been set to 1, why is an FSK ring detect interrupt not generated?
- Question 28
For Holtek's MCUs, is there any way to reset the stack pointer other than by a chip RESET?
- Question 29
When using a 3-pin resonator/crystal in my MCU application can the capacitor be connected to VDD instead of
VSS?
- Question 30
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 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 HT95X40X devices, how can I setup table data in the last page of the program memory to ensure the correct use of the TABRDL instruction.
- Question 33
When using the HT95X40X how can the program be located in rombank 1?
Question 1
How to connect external crystal of an MCU?
Answer
-
connect 32768Hz crystal across X1 and X2 Pin.
-
connect 3nF, 50nF(or 47nF) capacitor and 15K resistor to XC pin as the diagram below.
Question 2
Can I input the external CLOCK signal directly to X1 PIN to change the system frequency of the MCU?
Answer
User can input external clock signal directly through X2 pin. Please note that the internal clock source for DTMF Generator and FSK Receiver is from 3.58MHz. Any other frequency input might result in malfunctions.
Question 3
How to switch the MCU in the Normal Mode?
Answer
After power-on (or Reset), the MCU is in the Green Mode. To switch to the high frequency Normal Mode, the following process should be followed:
-
Set UPEN ([26h].5) for 1 to open high frequency.
-
Delay 20ms(or longer) to stabilized the high frequency.
-
Set MODE1 ([26h].7) for 1 after stabilizing the high frequency.
Example:
| Line 1: |
SET [26h].5 |
; enable high frequency |
| Line 2: |
MOV ACC,40 |
|
| Line 3: |
DEC ACC |
|
| Line 4: |
SNZ Z |
|
| Line 5: |
JMP $-2 |
|
| Line 6: |
SET [26h].7 |
; switch to high frequency
|
Explanation:
Line 1: after high frequency is opened, the system frequency is 32768Hz, instruction cycle time=122µs, the default delay time is 20ms by calculating the delay time with instruction cycle time.
Line3~Line5 execute 4 instruction time. 20ms/(122µs*4) = 41, therefore, in Line2, save 41 into ACC
when ACC decrease gradually to 0, program will execute Line6, switch the system frequency to high frequency mode.
when ACC decrease gradually to 0, program will execute Line3, proceed decreasing function.
decreasing time=20ms.
Question 4
How to switch the MCU from high frequency to low frequency to make the MCU working in the Green Mode?
Answer
In the Normal Mode, to switch to the low frequency, the following process should be followed:
-
Set the MODE1 ([26h].7) to 0 to choose the low frequency operate in the Green Mode.
-
Set UPEN ([26h].5) for 0 to turn off the high frequency oscillator.
Question 5
If I don't care about the MODE0 value, can I set [26h] for 0 directly to switch the system frequency from high to low?
Answer
It is not recommended. The MODE1([26h].7) decides the system frequency, UPEN([26h].5) decides if 3.58MHz frequency operates. If these two values are set to 0 in the same time, it's possible that 3.58MHz has been turned off while the system frequency still remains choosen the 3.58MHz. That will cause the missing of the MCU system frequency and the result is unpredictable. The system must be switched to low frequency first and then turn off the high frequency oscillator.
Question 6
How to switch the MCU into the Sleep Mode?
Answer
In the Normal Mode or Green Mode, to switch to the Sleep Mode, the following process should be followed:
-
Set MODE0 ([26h].6) to 0 to make the MCU into Sleep Mode at the HALT mode.
-
Execute HALT instruction.
Question 7
How to switch the MCU into Idle Mode?
Answer
In the Normal Mode or Green Mode, to switch to the Idle Mode, the following process should be followed:
-
Set MODE0 ([26h].6) to 1 to make the MCU into Idle Mode at HALT mode.
-
Execute HALT instruction.
Question 8
In my application program, I examine the state of UPEN bit (bit 5 of the MODE register) to determine if the system clock should be toggled between its two values of 32768Hz and 3.58MHz, however why after a power-on reset takes place, the expected toggle action does not occur?
Answer
This problem is normally caused by an abnormal power-on reset
condition, which causes the UPEN bit to be in an error condition.
If a power-on reset has not properly executed the UPEN bit may
display the wrong value. It is recommended that the MODE1 bit
which is bit 7 of the MODE (address 26H) register to be used for
the toggle function.
Question 9
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 10
How to use the external interrupt?
Answer
Set EMI ([0Bh].0 and EEI ([0Bh].1) bit to 1, when the Falling-Edge occurs on the
INT Pin, the MCU will branch to the interrupt routine at address 04h. Note that
INT Pin has no internal Pull-high resistor which should be added externally.
Question 11
How do I measure the external signal frequency by using the pulse width mode of the Timer 0 and Timer 1?
Answer
The Pulse Width mode can measure only a complete High or Low pulse. If you want to measure an external signal frequency, then you have to use two timers with one timer for the high pulse measurement and the other for low pulse measurement.
Question 12
What are the sources of the peripheral interrupt?
Answer
When the FSK decoder detects a ringer, FSK carrier signal or FSK packet data, the FSK interrupt is generated.
Question 13
How is the Dialer I/O interrupt setup?
Answer
To use the Dialer I/O interrupt, the following process should be followed:
-
Set the master interrupt flag EMI ([0Bh].0) and Dialer I/O interrupt master flag EDRI ([1Eh].2) to
1.
-
Three Dialer I/O pins will influence the interrupts: HKS,
HDI and HFI. Changes when the
HKS occurs Falling or Rising edge, the
HDI occurs Falling edge and HFI occurs Rising edge will all cause interrupts. The Dialer I/O interrupt vector is 18h.
-
When the Dialer I/O is in On-Hook or Hold-Line state, a falling edge on
HDI pin will not trigger the interrupt.
Question 14
Why is there no interrupt when the HFI pin is used to detect an external high pulse?
Answer
Check that the interrupt master flag EMI ([0Bh].0) and the Dialer I/O interrupt flag EDRI ([1Eh].2) are set to 1. On the other hand, note that
HKS, HFI and HDI
are designed for receiving signals of hook (HKS) and buttons
(HFI,
HDI ). Their reaction will be slow. If no debounce circuit is added on these pins, it is suggested that the pulse width should be larger than 130us. If a debounce circuit is added, the pulse width should be larger than the debounce time.
Question 15
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 16
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 17
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 18
What are the points to note when selecting the different WDT clock sources?
Answer
The WDT has user selectable clock sources, namely the internal WDT
OSC,
fSYS/4 and the 32768Hz oscillator.
-
If the internal WDT OSC is selected, the WDT will remain functioning in any mode.
-
If fSYS/4 is selected, the WDT will cease to function when in the Sleep and Idle Mode.
-
If the 32768Hz oscillator is selected, the WDT will cease to function when in the Idle Mode.
If the MCU is operating in a noisy environment, the WDT OSC clock source is preferred as it will not be affected by the MCU status. The WDT OSC is an additional circuit which increases slightly the power consumption when enabled. If the MCU does not operate in a noisy environment and power consumption is required, then it is not recommended to use the WDT OSC clock.
Question 19
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 20
Does the Dialer I/O operate in any mode?
Answer
The Dialer I/O only operates with the 32768Hz source. Therefore it operates only in the Normal Mode, Green Mode and Idle Mode. Please note the Dialer I/O will not function normally when in the Idle Mode.
Question 21
What are the state changes in the dialer I/O?
Answer
-
The Dialer I/O is designed to operate according to normal telephone operations. The trigger pins are
HKS, HFI, HDI which have six various status given by
PO, HFO, and
HDO.
-
When an HKS occurs on either a falling or rising edge variation, an interrupt signal will appear and at the same time the output level of the
PO, HFO, HDO pins will be influenced. See the following diagram for detailed logic variation. The following diagram gives more details
-
When an HFI occurs on the rising edge, an interrupt signal will appear and at the same time the output level of the
PO, HFO, HDO pins will be influenced. The following diagram gives more details.
-
When an HDI occurs on the falling edge, an interrupt signal will appear and at the same time the output level of the
PO, HFO, HDO pins will be influenced. The following diagram gives more details.
|
| The State Macnine of the Dialer I/O in Normal, Green and Sleep Mode
|
Question 22
Why does the Dialer I/O still work when in the Idle Mode?
Answer
-
When the phone MCU is in the Idle Mode, the 32768Hz oscillator will stop. In such cases the state change of the Dialer I/O will be different from the normal operations. The diagram below is the state machine of the Dialer I/O when in the Idle Mode.
-
Note that some of the output combinations are against normal telephone operations. The Dialer I/O has to be treated carefully when in the Idle Mode.
|
| The State Machine of the Dialer I/O in the Idle Mode
|
Question 23
How is the low voltage detector LBD used in the phone MCU?
Answer
-
The LBIN Pin in the phone MCU is used to detect an external voltage lower than 1.15V.
-
It is recommended that a precision resistor voltage divider is used as shown in the diagram. To detect the external
VDET voltage, the formula is 1.15 = VDET x (R2/(R1+R2)). For example, if it is desired to detect an external voltage
VDET=2.4V, by using the formula a value of R2=0.92R1 is achieved. If
R1 is chosen to be 2.2Mohm, then R2=2.0Mohm.
-
During the design process it is only required to set LBEN to 1 and check the LBFG using software instructions. If
LBFG=1, the voltage of the LBIN Pin will be less than 1.15V. If
LBFG=0, the voltage of the LBIN Pin will be larger than 1.15V.
(LBEN is located at [2Dh].5, LBFG located at [2Dh].4)
Question 24
Why is it not practically possible for the current to be smaller than 2µA, as the data sheet said, when the MCU is in the Idle Mode?
Answer
When in the Idle Mode, the detected 2µA power supply current conditions are as follows:
-
Switch the LCD off. If the LCD is on, their will be 30~40µA more power supply current at 5V.
-
Switch of the WDT source. If the WDT source is WDT
OSC, it will keep working under Idle Mode. The power consumption is about 3~6µA at 5V.
-
The LBD (Low battery detect) should be disabled. If on, there will be
50µA more power suuply current at 5V.
-
The levels of the INT,
HKS, TMR0, TMR1 and
RES pins must be set from the outside. Make sure the levels are all fixed. If left floating, this will create extra power supply current.
-
The connections to the output pins should be checked in case there is a DC current path. For example, output pins with pull-high resistors that are set to a low condition will increase power consumption.
-
All input pins must have non-floating fixed levels or power consumption will occur.
Question 25
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 26
How is the DTMF Generator output setup?
Answer
-
First place the MCU into the Normal Mode, high frequency mode.
-
Set the D_PWDN ([20h].0) to 1 to enable the DTMF Generator. The DTMF pins obtain a 1/2
VDD bias voltage.
-
Write a suitable value to the DTMFD ([21h]) register.
-
Set the TONE ([20h].2) register to 1 to enable the DTMF pins to transmit a DTMF output.
-
The output time of the DTMF Tone must be controlled by the program.
Question 27
After Power on, and after EMI and PERI has been set to 1, why is an FSK ring detect interrupt not generated?
Answer
All peripheral interrupts have their own interrupt mask bit. The Interrupt Mask bit must be 0 so as to allow the interrupt to function normally. In such situations, in addition to the EMI ([0Bh].0) and EPERI ([1Eh].0) bits being set to 1, the RMSK ([29h].3) also has to be cleared to 0 which will then allow the ring detect interrupt to function normally. The Ring or Line reversal detect explanation in the data sheet should be consulted for more information.
Question 28
For Holtek's MCUs, is there any way to reset the stack pointer
other than by a chip RESET?
Answer
The stack pointer is affected by the execution of interrupts as
well as by any subroutine calls which occur in the application
program. In addition, any return instructions will also affect the
stack pointer. However, it is not possible for the user to
directly reset the stack pointer by any means other than the chip
RESET.
Question 29
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 30
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 31
How can I use C language to read the serial number written into an OTP by the OTP writer?
Answer
When using the C language you must use inline assembly to read the IC serial number, which is written by the OTP writer. An example program is shown below:
First declare a variable to indicate a ram address.
unsigned long serial_num @0x80;
Then read out the serial number to this variable.
| #asm |
|
| tblp equ [07h] |
; define table address |
| mov a,20h |
|
| mov tblp,a |
; set table pointer to 20h (series number at 20h of last page) |
| tabrdl [80h] |
; load first byte of series number to series_num (0x80h); |
| inc tblp |
|
| tabrdl [81h] |
; second byte of series number |
| inc tblp |
|
| tabrdl [82h] |
; third byte of series number |
| inc tblp |
|
| tabrdl [83h] |
; fourth byte of series number |
| #endasm |
|
Question 32
When using the HT95X40X devices, how can I setup table data in the last page of the program memory to ensure the correct use of the TABRDL instruction.
Answer
The HT95X40X devices have 16K of program memory with a total address range from 0000h to 3fffh. This area of program memory is subdivided into several banks, with the last page of program memory being located in the second bank, which is rombank 1. Within the total program memory, the last page memory address range is from 3F00H to 3FFFH. To place data into a table in the last page, the first step is to define the rombank 1 program section, after which the table data addresses can be defined. It must be noted that when defining a table data address, the address will be relative to the first address of the present memory bank. In this case therefore, the address of the last page will be have the address range from 1f00h to 1fffh. The following actual example will explain things in more detail:
ROMBANK 1 LASTPAGE
LASTPAGE .SECTION AT 1FC0H 'CODE'
LASTTABLE: DC 01H,02H,03H,04H,05H,06H,07H,08H
Question 33
When using the HT95X40X how can the program be located in rombank 1?
Answer
The HT95X40X has 16K of program memory which is subdivided into two 8K banks. The SECTION statement can be used to place the program into rombank 1, however before doing so the ROMBANK instruction should be used to assign the section to the correct bank. If this ROMBANK directive is not declared, bank 0 will be assumed. The following should be used as an example of how to achieve this:
ROMBANK 1 TT
TT .SECTION 'CODE'
Points to Note
Question 1
What's the difference between the development system and the actual phone MCU devices?
Answer
There are four differences between the development system and the actual phone MCU devices:
| Difference |
Actual IC |
Development System (emulator) |
| LCD output signal |
Actual LCD signal, COM/SEG output No LCD signal output |
Use LCD simulator |
| Low voltage detect function |
LVR provided |
Not supported |
| 32768Hz and 3.58MHz system frequency |
Generates the 3.58MHz system frequency by the 32768Hz crystal oscillator |
Both 32768Hz and 3.58MHz exist. Set the switch from the development system |
| LCD output and I/O common pins |
Either the LCD output or the I/O output |
When pin-shared, the I/O function still exists |
| 32768Hz oscillator starting time |
The starting time affected by the crystal, pin capacitance, current, voltage etc. |
Except the 1024 clock delay, the actual starting time won't be emulated |
Question 2
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 3
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 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.
Others
Question 1
What is the constraints on VDD during Power On?
Answer
To allow a power on cycle to effectively execute it is
recommended that the rise time of VDD is limited to less than
80ms.
Question 2
How is the VDD rise time defined?
Answer
The voltage levels which define the VDD rise time are those between 0V and the lowest operating voltage of the MCU. For the Phone Controller MCU devices, the VDD rise time is defined as the time between the 0V and 2.4V levels.
Question 3
If the VDD rise time is too long, can this lead to any errors?
Answer
If the VDD rise time is too long, the power-on reset function may not be properly executed, which may give rise to some MCU functions not operating correctly.
Question 4
If a reset does not execute correctly what can be done to correct the situation?
Answer
Generally speaking, a reset signal applied to the external reset pin will cause a full MCU reset to occur and permit the MCU to return to normal operation.
Question 5
When a reset does not properly occur, why even when I use the reset pin to again reset the device, some functions do not return to normal operation?
Answer
The internal registers in the MCU will be initialized by the different types of reset, the details of which can be found in the relevant Phone Controller MCU datasheets. From the register reset table in the datasheet it can be seen that, with the exception of the warm reset, most of the registers are
initialized by the different types of reset. However some of the registers are only
initialized by a power-on reset and are not influenced by other other types of reset. These registers are shown in the following table.
| Register Name |
Address |
Bit |
| LINE |
22H |
7 |
| RTCC |
24H |
7,5 |
| MODE |
26H |
5 |
| LCDIO |
28H |
7,6,5 |
| LCDC |
2DH |
7,6,5,4,2,1,0 |
If the VDD rise-time is excessively long, it is recommended that after a power-on, to use the application program to setup the correct values in these registers. This will prevent erroneous data in these registers creating faulty operation.
Question 6
After powering on, why does the /PO pin sometimes go high?
Answer
Until the present time, the only reason found for this problem, results from the fact that an excessively long VDD rise time can give rise to abnormal reset condition. An abnormal reset condition in turn will lead to abnormal operation of the Dialer I/O circuitry which can cause the /PO line to give an abnormal high output.
Question 7
When using the MACRO assembly directive can I save Program Memory
space? Also does it affect the MCU execution speed?
Answer
After the assembly process, all of the instructions belonging
to the MACRO will be written into Program Memory area, therefore
there is no influence on either the Program Memory space or on the
speed of execution. However as the code has been simplified
program maintenance will be easier.
|