Basic Information Functional Description Application Description Points to Note Others

Basic Information

 

Question 1

What are the contents of the HT46 A/D type MCUs?

Answer

The HT46 series of A/D type MCUs have a selection of 1K,  2K, 4K, 8K and 16K OTP and Mask Type memory capacities. Among the series, the HT46R22/HT46C22, HT46R23/HT46C23, HT46R24/HT46C24 and HT46R25/HT46C25 devices also incorporate an I2C serial I/O interface. The HT46R51A, HT46R52A, HT46R53A and HT46R54A devices have a 12-bit A/D converter. For more information please consult the relevant datasheet.


Question 2

What are the differences between the various devices in the HT46 A/D type MCUs?

Answer

Please check on the table below for the differences. For more detailed information consult the data sheet.
Part No. VDD System
Clock
Program
Memory
Data
Memory
I/O 8-bit
Timer
Interrupt A/D PWM PFD Stack Package
Ext. Int.
HT46R01* 2.2V~
5.5V
400kHz~
12MHz
1Kx14 64x8 8 1 1 2 8-bitx4 8-bitx1 v 4 10MSOP
HT46R02* 2.2V~
5.5V
400kHz~
12MHz
2Kx14 96x8 8 2 1 3 9-bitx4 8-bitx1 v 6 10MSOP
HT46R03* 2.2V~
5.5V
400kHz~
12MHz
4Kx15 160x8 8 2 1 3 12-bitx4 8-bitx1 v 6 10MSOP
Part No. VDD System
Clock
Program
Memory
Data
Memory
I/O Timer Interrupt I2C A/D PWM PFD UART Stack Package
8-bit 16-bit Ext. Int.
HT46R22
HT46C22
2.2V~
5.5V
400kHz~
8MHz
2Kx14 64x8 19 1 -- 1 3 v 9-bitx8 8-bitx1 v -- 6 24SKDIP,
24SOP
HT46RU22 v
HT46R23
HT46C23
2.2V~
5.5V
400kHz~
8MHz
4Kx15 192x8 23 -- 1 1 3 v 10-bitx8 8-bitx2 v -- 8 24SKDIP,
24SOP,
28SKDIP,
28SOP
HT46R232
HT46C232
2.2V~
5.5V
400kHz~
8MHz
4Kx16 192x8 40 -- 2 1 4 v 10-bitx8 8-bitx4 v -- 8 28SKDIP,
28SOP,
48SSOP
HT46R24
HT46C24
2.2V~
5.5V
400kHz~
8MHz
8Kx16 384x8 40 -- 2 1 4 v 10-bitx8 8-bitx4 v -- 16 28SKDIP,
28SOP,
48SSOP
HT46RU25
HT46CU25*
2.2V~
5.5V
400kHz~
8MHz
16Kx16 576x8 48 1 2 1 5 v 12-bitx8 8-bitx4 v v 16 48SSOP,
56SSOP
Part No. VDD System
Clock
Program
Memory
Data
Memory
I/O 8-bit
Timer
Interrupt A/D PWM PFD Stack Package
Ext. Int.
HT46R46-H 3.3V~
5.5V
400kHz~
8MHz
1Kx14 64x8 13 1 1 2 8-bitx4ch 8-bitx1 v 4 18DIP/SOP
HT46R47-H 3.3V~
5.5V
400kHz~
8MHz
2Kx14 64x8 13 1 1 2 9-bitx4ch 8-bitx1 v 6 18DIP/SOP
Part No. VDD System
Clock
Program
Memory
Data
Memory
I/O 8-bit
Timer
Interrupt A/D PWM PFD Stack Package
Ext. Int.
HT46R51A 2.2V~
5.5V
400kHz~
8MHz
1Kx15 96x8 14 1 1 2 12-bitx5 8-bitx1 v 6 18DIP,
20SOP/SSOP
HT46R52A 2.2V~
5.5V
400kHz~
8MHz
2Kx15 128x8 14 1 1 2 12-bitx5 8-bitx1 v 6 18DIP,
20SOP/SSOP
HT46R53A 2.2V~
5.5V
400kHz~
8MHz
2Kx15 192x8 22 1 1 2 12-bitx8 8-bitx1 v 6 28SKDIP/SOP
HT46R54A 2.2V~
5.5V
400kHz~
8MHz
4Kx15 208x8 22 1 1 2 12-bitx8 8-bitx1 v 6 28SKDIP/SOP
Part No. VDD System
Clock
Program
Memory
Data
Memory
I/O 8-bit
Timer
Interrupt A/D Comparator PPG PFD Stack Package
Ext. Int.
HT46R12A 2.2V~
5.5V
400kHz~
8MHz
2Kx14 88x8 16 2 2 3 9-bitx4 2 1 v 8 24SKDIP,
24SOP
HT46R14A 2.2V~
5.5V
400kHz~
8MHz
4Kx15 192x8 20 2 3 3 9-bitx8 2 2 v 8 28SKDIP,
28SOP


Question 3

What are the various packages available in the HT46 A/D type MCUs?

Answer

Please see table below. Mask type MCU HT46CXX have the identical packaging forms.

HT46R22 : 24 SKDIP & SOP
HT46R23 : 24 SKDIP & SOP (compatible pinouts with the HT46R22 for convenient MCU upgrade)
28 SKDIP & SOP
HT46R24 :  28 SKDIP & SOP (compatible pinouts with the HT46R23 for convenient MCU upgrade)
48 SSOP
HT46R25 :  48/56SSOP
HT46R51A: 18 DIP
20 SOP & SSOP 
HT46R52A : 18DIP (compatible pinouts with the HT46R51A for convenient MCU upgrade)
20 SOP & SSOP (compatible pinouts with the HT46R51A for convenient MCU upgrade)
HT46R53A :  28 SKDIP & SOP 
HT46R54A :  28 SKDIP & SOP (compatible pinouts with the HT46R53A for convenient MCU upgrade)

Question 4

What is the operating frequency of the HT46 A/D type MCUs?

Answer

For 5V/3.3V or 3-cell battery applications, the maximum operating frequency is 8MHz (3.3V). For 3V or 2-cell battery applications the maximum operating frequency is 4MHz (2.2V)


Question 5

What is the system frequency tolerance if an RC oscillator is used as the system clock?

Answer

If the RC oscillator is selected, due to tolerances in the device processing, a nominal ±20% frequency tolerance from lot to lot is expected. Assuming that the external resistor has a ±5% tolerance, then the overall frequency tolerance would be ±25%.

The above specified tolerance is provided as a reference only and is not guaranteed. For applications where a more precise frequency source is required it is recommended that either a resonator or crystal frequency source is used.


Question 6

When using assembly language for the HT46R4 device, which is a Multi Ram Bank MCU, is it possible to directly implement a direct address operation for variables defined in banks other than BANK 0?

Answer

This is not possible. In assembly language, even if the BP can be directly addressed, direct addressing only applies to registers in BANK 0. For Banks other than BANK 0, the MP1 Memory Pointer must be used to access any registers located here.


Question 7

Why does the 18-pin DIP-A package for the HT46R51A/HT46R52A not have a VREF pin?

Answer

The HT46R51A and HT46R52A devices have two package types, an 18-pin DIP-A and 20-pin SOP-A/SSOP-A. On the 18-pin package, the VREF pin is connected internally to the VDD pin, therefore externally there is no VREF pin, whereas on the 20-pin package there is an external VREF pin.


Functional Description

 


Question 1

How to use the indirect memory addressing mode?

Answer

First the address to be read or written must be placed in the relevant memory pointer, known as MP. After this any instruction that refers to the Indirect Register, known as IAR, (e.g. MOV a, IAR) will result in action taking place on data pointed to by the memory pointer (MP). Indirect memory addressing is particularly useful for operations on data arrays by first placing the first array address in the memory pointer. Data can then be read or written from different places in the array by manipulating the data pointer.


Question 2

What are the special features and characteristics of the HT46 A/D type MCUs?

Answer

Operating Voltage range of 2.2V ~ 5.5V
Industrial standard temperature range of -40°C ~ +85°C
Low Voltage Reset function
Fully compatible OTP and Mask Types
For further details consult the relevant Holtek data sheet


Question 3

The HT46R23/HT46C23 have two memory pointers, what is the difference between them?

Answer

MP0/IAR0 and MP1/IAR1 are pairs of registers that need to be used together. MP0/IAR0 can only be used by RAM BANK 0 while MP1/IAR1 can be used by any RAM BANK.


Question 4

How are the table read instructions used and are there any special points to note?

Answer

There are two kinds of table read instructions, the first is the TABRDC instruction which is used to read data from the present program memory page. The second is the TABRDL statement which can read data from the last page of program memory. When reading data from tables it is first necessary to place the low byte of the program memory address where the data is stored, into the table pointer register TBLP. The table read instruction can then be executed which will place the low byte of the table data into the register indicated by the table read instruction. The high byte of the table data will be placed into the TBLH register. Note that the highest unimplemented bits in the data high byte will read as "0".


Question 5

What is the difference between choosing the WDT oscillator or the fSYS/4 clock as the WDT clock source?

Answer

If the WDT oscillator clock is chosen as the clock source then if the system enters a HALT condition the WDT timer will continue to function. When the WDT time-outs the system will be woken up from its HALT state. If the fSYS/4 clock is chosen as the WDT clock source then the WDT will cease to function and system will not be woken up when a HALT state is entered. The cost in choosing the WDT oscillator is that some power will be consumed by its clock. For systems that operate with HALT feature and need not to be woken up from HALT by WDT overflow, in this case the fSYS/4 clock source should be selected.


Question 6

How is the 8-bit timer setup?

Answer

The 8-bit timer/counter is a count up timer which upon reaching a count of 255 (0FFH) will reset itself to 00H and generate an internal interrupt signal. To obtain different timer counts, say N, of less than 256, the timer should be first preset with a fixed value of 256-N. After setting up this preset value the timer should be activated which will enable it to count from this preset value to 255. The value that the timer is to count N, is therefore given by the formula 256-(256-N)=N.


Question 7

How is the 16-bit timer setup?

Answer

The 16-bit timer/counter is a count up counter, which upon reaching a value of 65535 (0FFFFH) will reset itself to 0000H and generate an internal interrupt signal. To obtain different timer counts, say N, of less than 65536, the timer should be first preset with a fixed value of 65536-N. After setting up this preset value the timer should be activated which will enable it to count from this preset value to 65535. The value that the timer is to count N, is therefore given by the formula 65536-(65536-N)=N.


Question 8

What is the access sequence of the 16-bit Timer/Counter?

Answer

For the HT46 A/D type MCU, the internal data bus is 8-bit wide, therefore for the 16-bit Timer/Counter, the user has to write the Low Byte data first and then write the high byte data. To read the Timer/Counter contents, the user has to first read the High Byte data first and then the Low Byte data.


Question 9

When the 8-bit Timer/Counter clock is sourced from the Prescaler, can the Prescaler be reset?

Answer

The Prescaler will start to count after a Power On Reset, so there is no means for the user to reset the Prescaler contents.


Question 10

How is 8-bit Timer/Counter setup in the Timer Mode?

Answer

There are three modes available for the 8-bit Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To setup in the Timer Mode, the following process should be followed:

  1. Set to Timer Mode by writing 10H to TM1, TM0

  2. According to the user timer period requirements set the Prescaler by writing the appropriate values to the bits PSC2~PSC0

  3. Set the initial timer TMR value

  4. Enable the corresponding interrupt by setting the ETI and EMI bit

  5. Start the Timer by setting the TON bit of the TMRC

Once the Timer is enabled, it will count up and will be stopped when the TON bit in the TMRC register is cleared. If the Timer is enabled once again, the counter will start counting from the value where it was stopped. If the Timer overflows, an internal interrupt request will be issued and the TMR will be reloaded with the initial value.


Question 11

How is 16-bit Timer/Counter setup in the Timer Mode?

Answer

There are three modes available for the 16-bit Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To setup in the Timer Mode, the following process should be followed:

  1. Set to Timer Mode by writing 10H to TM1, TM0

  2. Set the initial timer TMR value

  3. Enable the corresponding interrupt by setting the ETI and EMI bit

  4. Start the Timer by setting the TON bit of the TMRC

Once the Timer is enabled, it will count up and will be stopped when the TON bit in the TMRC register is cleared. If the Timer is enabled once again, the counter will start counting from the value where it was stopped. If the Timer overflows, an internal interrupt request will be issued and the TMR will be reloaded with the initial value.


Question 12

How is the Timer/Counter setup in the Event Counter Mode?

Answer

There are three modes available for the Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To set in the Event Counter Mode, the following process should be followed:

  1. Set to Event Counter Mode by writing 01H to TM1, TM0

  2. Select TE=1 to count on the falling edge and TE=0 to count on the rising edge

  3. Set the Timer initial value into TMR

  4. Enable the corresponding interrupt by setting the ETI and EMI bits

  5. Start the Timer by setting the TON bit in the TMRC register


Question 13

How is the 8-bit Timer/Counter setup in the Pulse Width Mode?

Answer

There are three modes available for the Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To set in the Pulse Width Mode, the following process should be followed:

  1. Set to Pulse Width Mode by writing 11H to TM1, TM0

  2. Select TE=1 to measure a High Pulse Width and TE=0 to measure a Low Pulse Width

  3. According to the Pulse Measurement width requirements set the Prescaler value ( PSC2~PSC0=n)

  4. Set the Timer initial value, TMR, usually set to 0H for Pulse Width Measurements

  5. Enable the corresponding interrupt by setting the ETI and EMI bits

  6. Start the Timer by setting the TON bit in the TMRC

After the Timer/Counter is enabled, the user can poll the TON bit, if one pulse measurement is complete, the TON bit will be cleared to 0 and the count value multiplied by 2n is the measured pulse width.


Question 14

How is the 16-bit Timer/Counter setup in the Pulse Width Mode?

Answer

There are three modes available for the Timer/Counter, i.e. Timer Mode, Event Counter Mode and Pulse Width Mode. To set in the Pulse Width Mode, the following process should be followed:

  1. Set to Pulse Width Mode by writing 11H to TM1, TM0

  2. Select TE=1 to measure a High Pulse Width and TE=0 to measure a Low Pulse Width

  3. Set the Timer initial value, TMR, usually set to 0H for Pulse Width Measurements 

  4. Enable the corresponding interrupt by setting the ETI and EMI bits

  5. Start the Timer by setting the TON bit in the TMRC

After the Timer/Counter is enabled, the user can poll the TON bit, if one pulse measurement is complete, the TON bit will be cleared to 0 and the value in the counter will be the pulse width measured.


Question 15

How is the HT46X22 8-bit PFD setup?

Answer

To utilize the PFD function of HT46X22, the following process should be followed:

  1. Choose PFD enabled in the configuration option

  2. Set the Prescaler (PSC2~PSC0=n) value and TMR initial value from the formula fPFD = (fSYS / (2nx(256-TMR)x2))

  3. Start the Timer by setting the TON bit in the TMRC

  4. Set PA bit 3 in Output Mode, i.e.PAC.3=0

After these steps are taken, set PA.3=1 to turn on the PFD and PA.3=1 to turn off the PFD.


Question 16

How is the HT46X23 16-bit PFD setup?

Answer

To utilize the PFD function of HT46X23, the following process should be followed:

  1. Choose PFD enabled in the configuration option

  2. Set the TMR initial value from the formula fPFD = (fSYS / ((65536-TMR)x2))

  3. Start the Timer by setting the TON bit in the TMRC

  4. Set PA bit 3 in Output Mode, i.e.PAC.3=0

After these steps are taken, set PA.3=1 to turn on the PFD and PA.3=1 to turn off the PFD.


Question 17

What is the PWM frequency under (6+2) mode and (7+1) mode?

Answer

For PWM (6+2) mode, the PWM cycle is divided into 4 modulation cycles. Each modulation cycle has 64 PWM input clock periods, and the PWM frequency will be fSYS/26. For PWM (7+1) mode, the PWM cycle is divided into 2 modulation cycles. Each modulation cycle has 128 PWM input clock periods, and the PWM frequency will be fSYS/27. In comparison with the 8-bit mode, the (6+2) Mode PWM frequency is 4 times higher and (7+1) mode is 2 times higher than that of the 8-bit mode.


Question 18

What are the HT46 A/D type MCU I2C Bus features?

Answer

Except HT46X47, the HT46 A/D Type MCU series is featured with slave mode I2C Bus. Via SCL and SDA lines, MCU can receive data or transmit data upon Master device's request.


Question 19

How to calculate the A/D Conversion clock frequency?

Answer

Each A/D conversion needs 76 AD clocks which is selected by ADCS1and ADCS0. Please refer to the table:

ADCS1 ADCS0 TAD Frequency
0 0 fSYS/2
0 1 fSYS/8
1 0 fSYS/32
1 1 Undefined

Question 20

How is the ADCLK calculated and what are its restrictions?

Answer

For the HT46 A/D Type MCUs, the minimum A/D Clock Period (tAD) is 1us. Therefore, the A/D Clock Period chosen by programming bits ADCS1 and ADCS0 must be carefully chosen to ensure that the selected A/D clock period is not less than 1us. The values are shown in the table below:

fSYS

A/D Clock Period (tAD)

ADCS1, ADCS0 = 00
(fSYS/2)
ADCS1, ADCS0 = 01
(fSYS/8)
ADCS1, ADCS0 = 10
(fSYS/32)
ADCS1, ADCS0 =11
1 MHz 2 us 8 us 32 us Undefine
2 MHz 1 us 4 us 16 us
4 MHz *500 ns 2 us 8 us
8 MHz *250 ns 1 us 4 us

* indicates the ADCS1 and ADCS0 bit settings that are not permitted as they will give a tAD value that is less than 1us .


Question 21

How long is the A/D sampling time?

Answer

The A/D Sampling Time requires 32tAD. For example, if the A/D Clock Period is 4us, then the A/D Sampling Time will be 128us.


Question 22

What is the equivalent circuit of the A/D type MCU to its external analog signal source?

Answer

The equivalent circuit of the A/D type MCU to its external analog signal source is drawn as below:

Notations:
VA : external analog signal source
RA : external analog signal output impedance
AN0~AN7 : analog signal input pins
CPIN : analog signal input pin input capacitance CPIN = 5pF
D1, D2 : protection diodes on pad, VT=0.6V
II  : leakage current on pad, II  = ±1μA (max.)
SS : analog signal sampling switch
RSS : analog signal sampling switch equivalent impedance; ca.100/200Ω at 5V/3V
CS/H : sampling and hold capacitance shown as below;

  HT46R23, HT46R24, HT46R64, HT46R65  HT46C23, HT46C24, HT46C64, HT46C65 HT46R47, HT46R22, HT46R62 HT46C47, HT46C22, HT46C62 HT46R63 HT46C63
CS/H 225.3pF 94.2pF 112.6pF 71.3pF 56.32pF 35.6pF
A/D resolution 10-bit 10-bit 9-bit 9-bit 8-bit 8-bit
A/D conversion time 76tAD 76tAD 76tAD 76tAD 64tAD 64tAD
A/D sampling time 32tAD 32tAD 32tAD 32tAD 32tAD 32tAD

Note: tAD is the A/D clock period detailed in the datasheet.


Question 23

The HT46R23 and HT46R24 have 2 and 4 PWM channels respectively. By writing the same values into the PWM registers and enabling them at different times, will PWM output waveforms with different phases be generated?

Answer

No, PWM waveforms with different phases will not be generated as the waveforms are derived from the same PWM counter.


Question 24

When using the HT46R22 with a 4MHz system clock, what is the frequency of the source clock for the internal timer?

Answer

The internal timer source clock frequency for this device is the same as the system clock, therefore in this case it is 4MHz.


Question 25

What is the function of the WDT?

Answer

The WDT is designed to monitor the MCU software and hardware operations. Users should employ the CLEAR WDT (CLR WDT or CLR WDT1 and CLR WDT2 ) instructions should any abnormal operation or malfunction happens when a WDT overflow would occur which will then reset the MCU to resume normal operation. The WDT monitoring effects mainly depend on the software program design.


Question 26

Is the value of conversion in the 8-bit A/D MCUs equal to N*Vref/255 or N*Vref/256?

Answer

Because the conversion value is of a discrete nature, it does not express an absolute value, it rather expresses a range instead. For example "0" can indicate a voltage between 0 Volts and Vref/256 while "1" can indicate a voltage between Vref/256 and 2Vref/256 etc. When using the N*Vref/256 formula, the largest error value will be Vref/256. When using the N*Vref/255 formula, the error lies between a value of -Vref/256 and Vref/256. In both cases the actual error range is the same. Therefore both the /255 or /256 value are acceptable.


Question 27

Many of the Holtek MCUs have a Low Voltage Reset function. When this operates what is the condition of the I/O, OSC pins etc?

Answer

When the power supply voltage falls below the specified LVR voltage, the LVR function will be activated. When this happens the I/O pins will revert to an input condition, and the oscillator will start up. The LVR voltage will vary according to the process, for details consult the DC characteristics section of the datasheet.


Question 28

What is the difference between the activation of an LVR function and pulling the RES pin low?

Answer

The difference is that in the case of the LVR, if the operating voltage falls below the LVR voltage but remains higher than the lowest operating voltage, the oscillator will continue running. However if the RES pin is pulled low the oscillator will be always be stopped.


Question 29

In the HT46R65, how can variables in bank2 be defined? When the data db is used to define variables, when the number of variables exceeds 192, the compiler generates an "exceed RAM capacity error message." 

Answer

It is necessary to use the RAMBANK banknum section-name[,section-name,...] to declare the data memory sections. This directive is used to declare the data sections in the data memory block.

banknum defines the number of the data memory divisions, the range is from 0 to the maximum size of data memory block. section-name is name given to the previously defined data memory divisions. This enables more than one section to be declared within the same data memory blocks.

For more details on how to use this consult the following: 
http://www.holtek.com.tw/english/literature/ht-ide3k.pdf


Question 30

Can all pins on the HT46R22 be used as A/D inputs? Can any remaining pins be used as I/O pins?

Answer

The ADCR register is used to determine which pins are to be used as A/D inputs and which are to be used as I/O pins. If the PCR2, PCR1 and PCR0 bits in the ADCR register are set to "1XX" then all PB pins will be used as A/D inputs. If these bits are set to "001" then only PB0 will be used as an A/D input, the other PB pins will be used as standard I/O pins. For more details see the following table:

Name(ADCR)

Bit 

Function

ACS0
ACS1
ACS2

0
1
2

ACS2,ACS2,ACS0:A/D channel choice
0,0,0:AN0
0,0,1:AN1
0,1,0:AN2
0,1,1:AN3
1,x,x:undefined, do not use

PCR0
PCR1
PCR2

3
4
5

PCR2,PCR1,PCR0:PB3~PB0 definition
0,0,0:PB3,PB2,PB1,PB0
0,0,1:PB3,PB2,PB1,AN0
0,1,0:PB3,PB2,AN1,AN0
0,1,1:PB3,AN2,AN1,AN0
1,x,x:AN3,AN2,AN1,AN0

EOC

6

A/D conversion end flag(0:A/D conversion ended)

START

7

A/D conversion start control
0→1→0:start
1→0:A/D conversion reset, set to "1"


Question 31

The HT46R22 RAM space exists in the range 0x40--0x7f, however as the system has 6 stack levels, do they also exist within this 0x40--0x7f area?

Answer

The stack area has its own memory space and does not lie within the RAM or ROM memory area.


Question 32

In the HT46R47 is it possible not to use the A/D interrupt? After initiating a START pulse, by looking at the EOC flag to see if it has been reset to zero, can I determine that the conversion had ended?

Answer

Yes, this is possible.


Question 33

What are the special features of the UART in the HT46RU25?

Answer

The UART uses full duplex asynchronous communication, and can choose either an 8 or 9-bit character length, with odd or even parity and with a choice of either one or two stop bits. The UART also has its own baud rate generator with an 8-bit frequency division register, various error checking functions as well as various interrupts and address checking. There is also a two level FIFO receiver buffer as well as transmit and receive interrupts.


Question 34

What are the conditions for the generation of a UART interrupt?

Answer

When the UART meets any of the following conditions, an interrupt will be generated: when a transmission has ended, when the transmit register is idle, when a data reception has ended, the occurrence of an overrun error or an address match.


Question 35

How can the HT46RU25 UART serial data transmission frequency be calculated?

Answer

The UART function contains an internal baud rate generator which is controlled by both the BRG register and bit 2 of the UCR2 register which is known as the BRGH bit. If the BRGH bit is set to "0" the baud generator frequency will be governed by the equation Fsys/[64*(N+1)]. If the BRGH bit is set to "1" the baud generator frequency will be governed by the equation Fsys/[16*(N+1)]. The value of N is from 0~255.


Question 36

Why is it when I use the Baud Rate formula to calculate the Baud Rate it is different from the actual rate?

Answer

According to the Baud Rate formula, the value of N that is calculated will be a normal floating point number. However the actual value that will be placed into the BRG register will be the closest value to this number and not the actual value. Because of this it is difficult to avoid errors between the actual value and the theoretical value.


Question 37

What is the transmit and receive data types and waveforms for the UART?

Answer

For the transmit and receive mode consult the following table.


For the data waveforms consult the following diagram.


Question 38

What are the steps to initialise the UART?

Answer

1. Setup the BN0, PRT, PREN and STOPS bits to determine the data length, parity type and stop bit length.
2. Setup the BRG register to determine the Baud Rate.
3. Set the TXEN bit to enable the UART function.


Question 39

What steps are required to initialise the UART receiver?

Answer

1. Setup the BN0, PRT, PREN and STOPS bits to determine the data length, parity type and stop bit length.
2. Setup the BRG register to determine the Baud Rate.
3. Set the RXEN bit to enable the UART function. AT this point the UART will await the detection of the first bit.
4. After normal reception of the data, the USR register can be read, this action will clear the RXIF bit.
5. Read the received data from the RXR register.


Question 40

What is the meaning of an overrun error in the UART function, and if it occurs how does the UART handle such an error?

Answer

The RXR register is a two level FIFO buffer area, where two bytes can be held while another third byte is being received. The application program needs to read the RXR register before the third data byte has been completely received, otherwise an overrun error will occur. When such an error occurs the following will take place: the OERR bit in the USR register will be set, the data in the RXR register will not be discarded and the RSR register data will be overwritten. Also if the RIE bit is set to 1, an interrupt will occur.


Question 41

How many registers does the UART have and what functions do they have?

Answer

The UART function has 5 associated registers known as USR, UCR1, UCR2, BRG and TXR/RXR. The USR is the UART's status register, which is read only and can be read using the program. The UCR1 and UCR2 registers are the control registers for the UART and are used to define the UART functions, such as the enable/disable, odd or even parity, transmission data length etc. 
The main function of the UCR2 register is to enable or disable the transmit or receive functions as well as the interrupt enable functions. It also controls the Baud Rate and enables or disables the receive data wake-up bit. 
The BRG register is used to setup the Baud Rate. The value of BRG is related to the condition of BRGH. 
The TXR/RXR register is used for the transmit and receive data.


Question 42

How does the UART transmit data?

Answer

When the UART is transmitting data, the data will be transferred from the shift register to the TX pin, starting with the LSB and ending with the MSB. When in the transmit mode, the internal TXR register and the shift register form a FIFO buffer. If the 9-bit data option is chosen, the MSB will be stored in bit TX8 of the UCR1 register.


Question 43

What kinds of receive errors does the UART generate?

Answer

The UART will generate four kinds of receive errors which are Overrun Error, Noise Error, Framing Error and Parity Error.


Question 44

How is the RAM in the HT6R454A and HT46R54 differentiated?

Answer

The HT46R54 has a RAM structure of 88 X 8, with memory pointers MP0 and MP1, 7-bits wide. The HT46R54A has a structure of 280 X 8 with MP0 and MP1 8-bits wide.


Question 45

Can the LVR be simulated in the ICE?

Answer

The ICE has a fixed VDD voltage of 5V, therefore it is not possible to simulate the operation of the LVR.


Question 46

What are the differences between the HT46R49E and the HT46R49?

Answer

The HT46R49E device uses modern packaging techniques to combine two chips into a single package. One device is the HT46R49 and the other device is a 1K bit Data EEPROM.
This category of products can reduce packaging costs and supply the user with a more economical solution in addition to reducing circuit board area, making it suitable for devices with space constraint limitations. Both the HT46R49 and HT46R49E are supplied in 24/28 pin SKDIP and SOP package forms.


Question 47

When the Timer/Counter has been started and is running, can data be written to it?

Answer

Yes this is possible, however any new data written to the timer will be first stored in the preload registers and not loaded immediately to the timer registers. When the next counter overload occurs the data will be written to the timer registers.


Question 48

Can more than one A/D converter channel in the AD type MCUs be open at one time?

Answer

This is not possible. However a polling method can be used to open each channel and then use interrogating or interrupt methods to read back the value.


Application Description