|
Basic Information
Question 1
Why, when the USB SIE in the HT82A851R device is reset, the MCU is not also reset?
Answer
When bit 7 of the USC register in the HT82A851R device is cleared to zero, then when the USB SIE in the HT82A851R is reset, the MCU will not be reset. However if bit 7 of the USC register is set high, then when the USB SIE in the HT82A851R is reset, the MCU will also be reset.
Question 2
How many endpoints are there for the USB interface in the HT82A851R? What kind of transmission type does each endpoint support and what is the FIFO capacity?
Answer
The USB Interface in the HT82A851R has a total of 5 endpoints, EP0~EP4.
Endpoint 0 (EP0), supports control transmission and its FIFO capacity is 8 bytes.
Endpoint 1 (EP1), supports interrupt transmission and its FIFO capacity is 8 bytes.
Endpoint 2 (EP2), supports synchronous output transmission and its FIFO capacity is 384 bytes.
Endpoint 3 (EP3), supports synchronous input transmission and its FIFO capacity is 32 bytes.
Endpoint 4 (EP4), supports interrupt transmission and its FIFO capacity is 32 bytes.
Question 3
How does the HT82A851R MCU know if the Host has transmitted a 0-sized data packet?
Answer
If the Host sends a 0-sized data packet to the HT82A851R MCU, then the SIE will set the MISC register bit 7 high. When the MCU examines the MISC register and sees that bit 7 is high, then it knows that the host has sent a 0-sized data packet.
Question 4
As the HT82A851R can be a USB device, how can endpoint 1 become the main controller input endpoint?
Answer
For endpoint 1 to become the main controller input endpoint, the following should take place:
1. In the program, during enumeration it is necessary to setupt the endpoint address bEndpointAddress as 1000 0001B.
Bits 3~0 of the bEndpointAddress are the endpoint number, 0001 indicates that it is reporting the endpoint 1 condition to the host.
Bits 6~bit4 of the bEndpointAddress remain unused.
Bit 7 of the bEndpointAddress is the direction bit and is equal to 1, indicating that endpoint 1 is an input endpoint.
Functional Description
Question 1
The RAM in the HT82A822R is read only RAM so what it is used for?
Answer
This RAM is used to store the spectrum or right/left channel volume values (using the USF register bit 2 for Mode Select selection, with Mode Select = 0 then the RAM contents is the spectrum values, with Mode Select = 1 the RAM contents is the right/left channel volume value) These values are loaded from the USB interface FIFO.
Question 2
How is the PFD frequency setup in the HT82A832R?
Answer
The PFD Output Frequency = Prescaler Output / (2 * (N+1)) where:
1. The Prescaler Output = PFD Frequency / Prescaler
2. The PFD Frequency is (Fsys/4) / 16
3. The Prescaler value is set using the PRES1 and PRES0 bits (bits 5 and 6 of the PFDC register) and can be set to values of :
1: PRES1 = 0, PRES0 = 0
2: PRES1 = 0, PRES0 = 1
4: PRES1 = 1, PRES0 = 0
8: PRES1 = 1, PRES0 = 1
4, The value of N is the register PFDD value
Question 3
How can the popping sound from the speaker be eliminated?
Answer
To eliminate the popping sounds from the speaker, the MCU initialisation program, should ensure that the power amplifier outputs a level of VDD/2 (DAC value of 8000H). The actual steps to do this are as follows:
Step 1: Setup the WDT register highest four bits to 0101b, to setup the DAC Write
Data Mode
Step 2: At register location 2DH (DAC lowest 8-bits) setup a value of 00H and at register location 2EH (DAC highest 8-bits) setup a value of 80H.
Step 3: Set bit 3 of register at location 2FH, first high and then low which is the DAC_WR_TRIG bit, to create a low going edge.
Step 4: Setup the WDT register highest four bits to 0101b to leave the DAC Write Data Mode.
Question 4
As the HT82A851R can be a USB device, what situations will cause the SIE to send an interrupt request to the MCU and how can the corresponding interrupt be recognised?
Answer
The HT82A851R can be a USB device. Under the following USB situations, SIE can send an interrupt request to the MCU.
1.USB SUSPEND
2.USB RESET
3.USB RESUME
4.USB every terminal if accessed
When the above USB incidents generate an interrupt, the following method can be used for recognition:
1. When the USB enters the suspend mode, bit 0, which is the SUSP bit in the USC register will be set high by the SIE and will generate a USB interrupt. If the USB interrupt service routine sees that this bit is equal to 1, then it knows that it is a USB suspend that has generated the interrupt.
2. When the USB is reset, bit 2, which is the URST bit in the USC register will be set high by the SIE and will generate a USB interrupt. If the USB interrupt service routine sees that this bit is equal to 1, then it knows that it is a USB reset that has generated the interrupt.
3. When the USB leaves the suspend state and is resumed, bit 3, which is the RESUME bit in the USC register, will be set high by the SIE and will generate a USB interrupt. If the USB interrupt service routine sees that this bit is equal to 1, then it knows that it is a USB resume that has generated the interrupt..
4. When any of the endpoints 0~4 in the HT82A851R are interrogated, they can generate a USB interrupt. Their corresponding interrupt flags, EP0F~EP4F, which are bits 0~4 in the USR register, will be set to 1 by the SIE. By examining these bits in the USB interrupt service routine, the corresponding endpoint which generated the interrupt can be identified.
Question 5
The HT82A851R can be a USB device, however how is the remote host wake up function implemented?
Answer
The HT82A851R can be a USB device, and if required to implement a remote host wake up function, the following should take place:
1. When listing out the devices, in the configuration description, bit 5 of the bmAttributes should be set to 1. This is to inform the host that the HT82A851R is a USB device and that it has a remote host wake up function.
2. The HT82A851R MCU must set bit 0, which is the WKEN bit of the AWR register, to 1, to enable the device remote wake up.
3. When the HT82A851R is required to wake up the host, the HT82A851R MCU must generate a wake up pulse on bit1, which is the RMWK bit in the USC, in order to wake up the host. The instructions are as follows:
SET USC.RMWK
NOP
NOP
NOP
NOP
NOP
CLR USC. RMWK 。
4. When the USB host receives a wake up signal from the HT82A851R, it will transmit a reset signal to the device. In this way communication can be restarted.

Question 6
The HT82A851R can be a USB device. When the MCU receives a SET_CONFIGURATION instruction from the host, what action should the MCU take?
Answer
When the HT82A851R receives a host generated SET_CONFIGURATION instruction, the MCU will take the instruction configuration value, and will compare it with the configuration descriptor value (bConfigurationValue). If they are the same, then this means that the host configuration device is successful and the HT82A851R MCU will send a single 0-sized data packet to the host to act as a receive SET_CONFIGURATION instruction acceptance reply. If they are different, this means that the host configuration device has failed, and the HT82A851R MCU will send a STALL instruction to the host. After the host device is successful, the device and host listing process will terminate and they can continue with normal communication.
Question 7
As the HT82A851R is a USB device how can the device send a 0-sized data packet to the main controller?
Answer
When the microcontroller sends a 0-sized data packet to the main controller, this is in effect just sending a handshake signal to the main controller. The method of transmission is as follows:
1. Set bit 1, which is the TX bit, of the MISC register to 1 to put the FIFO into the write mode.
2. Delay 4us.
3. Set bit 0, which is the REQUEST bit, of the MISC register to 1, this will send a FIFO request.
4. Delay 28us
5. Determine if bit 6, which is the READY bit, of the MISC register is equal to 1. If not equal to 1 then proceed to step 1, if equal to 1 then proceed to step 6.
6. Clear bit 1, the TX bit, of the MISC register to 0. This will place the FIFO into the read mode.
7. Delay 4us
8. Clear bit 0, the REQUEST bit, of the MISC register to 0. This will end the FIFO request.
When the above operation has completed, then the microcontroller has just sent a 0-sized data packet to the main controller.
Application Description
Points to Note
Others
Question 1
The HT82A851R can be a USB device. When the MCU receives a SET_ADDRESS instruction from the host, what action should it take?
Answer
The HT82A851R can be a USB device, so when it receives a SET_ADDRESS instruction from the host it should do the following:
1. The ASET bit, which is bit 0, of the SIES register in the HT82A851R MCU should be set to 1. If this bit is 1, it means that after the transmission ends, the HT82A851R SIE will use the AWR register address to reset the device address.
2. The HT82A851R MCU will write the just received new device address into the AWR register bit1~bit7.
3. The HT82A851R MCU will return a 0-sized data packet to the host to act as the SET_ADDRESS instruction accept signal.
When the HT82A851R MCU has completed the above operation, during the next transmission, the host and device can use a new address for communication.
|