Basic Information Functional Description Application Description Points to Note Others

Basic Information


Question 1

Can the HT46RB70 system clock be generated by an RC oscillator?

Answer

The HT46RB70 system clock can only be generated by a crystal oscillator of either 6MHz or 12MHz frequency.


Question 2

How many endpoints does the HT46RB70 have?

Answer

The HT46RB70 has 6 endpoints including endpoint 0. In addition to endpoint 0, endpoints 1~5 can utilise the SETIO register to setup the input/output pipe. Endpoints 0,1,2 and 4 have a fifo size of 8 bytes while endpoints 3 and 5 have a fifo size of 64 bytes.


Question 3

How many EndPoints are in the HT46RB50?

Answer

The HT46RB50 has four EndPoints, among which endpoint0~endpoint2 FIFO size is 8-bytes while endpoint3 has the largest size of 64bytes.

 


Functional Description


Question 1

When the USB on the HT46RB50 is reset is the MCU also reset?

Answer

The 7th bit in the USC control register can be used to decide if a USB reset signal will also reset the MCU. When the bit is equal to 1, then a USB reset signal will also reset the MCU. If the bit is equal to 0, then a USB reset signal will not reset the MCU


Question 2

When a USB interrupt is generated on the HT46R50, how can it be determined which endpoint has been accessed?

Answer

When a USB interrupt occurs, the related USB register related endpoint access flag, EPXIF, will be set high. Note that X denotes the endpoint number,. By reading the USR register the accessed endpoint can be determined.


Question 3

How does the HT46RB50 enter the Suspend Mode and in this mode how much current is consumed?

Answer

If, when connected, there is no signal for 3ms, the HT46RB50 will enter the Suspend Mode. In this mode the third bit of the UCC register, USBCKEN, will be cleared and the USB clock stopped. Here the current consumption will be around 400μA.


Question 4

In the HT46RB50 how can the required operational FIFO?

Answer

By using the lowest three bits in the UCC register (EPS0~EPS2), it is possible to selected the indicated FIFO to implement operations. The following illustrates the relationship:
If EPS0~EPS2 is setup as “000” then endpoint 0 FIFI is selected
If EPS0~EPS2 is setup as “001” then endpoint 1 FIFI is selected
If EPS0~EPS2 is setup as “010” then endpoint 2 FIFI is selected
If EPS0~EPS2 is setup as “011” then endpoint 3 FIFI is selected


Question 5

How is data written to the FIFO?

Answer

1. Setup the FIFO, setup in the write mode (MISC TX bit = 1), setup the REQ bit = 1.
2. Check that the ready bit is = 1
3. Use the FIFO pointer register to write. At the same time record the amount of already read data.
4. Repeat steps 2 and 3 until the ready bit is equal to 0, which means that the FIFO data has all been written.
5. Set the MISC TX bit = 0
6. Clear the REQ bit to 0 to complete the write operation.


Question 6

How is the FIFO data read?

Answer

1. Select a FIFO group, setup in the read mode (MISC TX bit = 0), setup the REQ bit as 1.
2. Check the Ready bit value is = 1.
3. By using the FIFO pointer register, read the FIFO data. At the same time record the amount of already read data.
4. Repeat steps 2 and 3 until the ready bit is equal to 0, which means that the FIFO data has been fully read.
5. Set MISC TX bit = 1.
6. Clear the REQ bit to 0 to complete the read operation.


Question 7

When the HT46RB50 is used as a USB device, why is it necessary to connect a 1.5K pull-high resistor between the UDP (D+) pin and V330?

Answer

Because the HT46RB50, when used as a USB device, is in the full speed mode, this mode requires that the USB equipment data line D+ is connected to a pull-high resistor which is in turn connected to a 3.3V voltage level. For this reason a 1.5K pull-high resistor is connected between the UDP pin (D+) and V330.


Question 8

What are the operating steps for HT46RB50 serial interface transmit mode ?

Answer

Step 1: Select CKS and M1,M0 = 00, 01, 10
Step 2: Select CSEN, MLS (Same as Slave Mode)
Step 3: Set SBEN
Step 4: Write data to the SBDR register → Data stored in the TXRX register → Output CLK signal → Goto Step 5 → (SIO internal control→ Data Memory is in the TXRX buffer, SDI received data moved to the TXRX register → when data transmission has ended, the TXRX buffer will be written to the SBDR register
Step 5: Check WCOL: WCOL = 1 → clear WCOL and jump to Step 4; WCOL = 0 → jump to Step 6
Step6: Check TRF or wait for SBI (Serial Interface Interrupt)
Step7: Get data from the SBDR register
Step8: Clear TRF
Step9: Jump to Step 4


Question 9

What are the operating steps for the slave mode serial port on the HT46RB50?

Answer

1. Setup M1, M2 as “11”
2. Select CSEN, MLS – Same Master Mode
3. Set SBEN
4. Write data to the SBDR register → store data in TXRX register → wait for main controller clock (and SCS): CLK → jump to step 5 → (SIO internal control → CLK(SCS) receive → output data to TXRX register, SDI received data moded to TXRX buffer → after data transmission ended, TXRX buffer data placed into SBDR register)
5. Check that WCOL:WCOL = 1 → Clear WCOL and jump to Step 4, WCOL = 0 → Jump to Step 6
6. Check TRF or wait for SBI (Serial Interface Interrupt)
7. Obtain data from the SBDR register
8. Clear TRF


Question 10

How is a NAK packet generated for the USB Host?

Answer

After entering the USB interrupt, do not implement any operation, but directly leave the interrupt. Here the MCU will automatically return the USB host with a NAK packet.


Question 11

After the USB host has been suspended, how can the HT46RB50 wake up the host?

Answer

If the HT46RB50 is to wake up the host, when listing the USB configuration, in the configuration descriptor, it is necessary to open the remotewakeup function. After the USB host is suspended, when the HT46RB50 detects a wake-up signal, then the USB host can be woken up via the RMWK (USC first bit). After the USB host receives this it will transmit a resume signal to the HT46RB50.


Question 12

What is the purpose of bit 7 (LEN0) in the MISC register?

Answer

This bit shows the FIFO read data LEN0 handshake signal. When the host transmits zero length handshake data to the MCU, the MISC register bit LEN0 will be set to 1. However this bit will not be automatically cleared and the programmer must clear this bit to zero.

 


Application Description


Question 1

When using the demo program supplied on Holtek’s website for communication between the HT46RB50 and the USB mainboard, the HT46RB50 and the USB main board communication is normal. However, when using this demo program as a basis for other applications, after adding new functions are added, why does the HT46RB50 and USB mainboard communication not operate normally.

Answer

In ensuring that the program has no errors there is one point that should be noted. This is, that in the demo program, when using the PCL pointer to implement a move, it is important to take into account any page jumps which might occur. This may account for the error that is encountered.
Example :
ORG 0EFCH
MOV A,M_RAM ;0EFCH
ADDM A,PCL ;0EFDH
JMP L_BRATCH0 ;0EFEH
JMP L_BRATCH1 ;0EFFH
JMP L_BRATCH2 ;0F00H
JMP L_BRATCH3 ;0F01H
JMP L_BRATCH4 ;0F02H
JMP L_BRATCH5 ;0F03H
……

With M_RAM = 5, will result in PCL+5 = 0EFEH+5 = 03. Therefore in this instance the PCL pointer will indicate the address 0E03H, which will not execute the instruction JMP L_BRATCH5 as expected, leading to erroneous operation.


Question 2

In the HT46B50 simulator configuration option section, why is it not possible to setup the system frequency?

Answer

It is not possible using configuration options to select the system frequency in the simulator as a jumper is used on the simulator to select a frequency of either 12MHz or 6MHz.


Question 3

When using the crystal oscillator and the resonator oscillator in the HT46RB50 what are the oscillator circuit difference?

Answer

When the HT46RB50 is using a crystal oscillator, then a 22pf capacitor is not required to be connected between each of the OSC1 and OSC2 pins and ground. If a resonator is used, then a 22pfcapacitor should be connected between each of the OSC1 and OSC2 pins and ground.


Question 4

When the SPI function in the HT46RB70 is setup in the Master Mode, how is CSn controlled?

Answer

When the SPI is setup in the Master mode, if the SIO CDEN configuration option is enabled, then when CSEN (bit 2 of the SBCR register) is setup as a 1, CSn is automatically controlled by the MCU. Here, if SBEN, which is bit 4 of the SBCR register is 1, CSn will output a LOW. When SBEN is 0, CSn will output a HIGH. When CSEN is setup to 0, or if SIO CSEN configuration option is disabled, then CSn is controlled manually.