![Nations N32G43 Series User Manual Download Page 623](http://html1.mh-extra.com/html/nations/n32g43-series/n32g43-series_user-manual_3408051623.webp)
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
600
/
631
Figure 26-3 The relationship between the buffer description table and the endpoint packet buffer
Double-buffered endpoints
Double buffer endpoint function introduction
When a large amount of data needs to be transmitted between the PC host and the USB device, the use of bulk
transmission allows the PC host to transmit data with maximum efficiency within one frame. However, when the
transmission speed is too fast, the USB device will receive a new data packet when the USB device is processing the
previous data transmission. In order to correctly complete the previous data transmission, the USB can only reply the
NAK handshake signal to the PC host. Due to the retransmission mechanism of bulk transfer, the PC host will
continue to retransmit the same data packet until the USB device can process the data packet and reply to the PC host
with an ACK handshake signal, the PC host will stop retransmitting the data packet. Such retransmission will occupy
a lot of bandwidth, thereby reducing the rate of bulk transfer. In order to solve this problem, a double buffering
mechanism is introduced to improve the efficiency of bulk transfer, and flow control is implemented.
When the unidirectional endpoint uses the double buffer mechanism, both the receive buffer and the transmit buffer
on the endpoint will be used, one of the buffers is used by the USB module, and the other buffer is used by the
microcontroller, use the data toggle bit in the endpoint register to select which buffer is currently used, and introduce
two flags for this: DATTOG and SW_BUF. DATTOG indicates the buffer currently being used by the USB module,
ADDR0_TX
CNT0_TX
ADDR0_RX
CNT0_RX
ADDR1_TX
CNT1_TX
ADDR1_RX
CNT1_RX
CNT2_TX_1
ADDR2_TX_1
CNT2_TX_0
ADDR2_TX_0
Endpoint 0 TX buffer
in single buffer mode
Endpoint 0 RX buffer
in single buffer mode
Endpoint 1 RX buffer
in single buffer mode
Buffer for IN
endpoint 2 in double
buffer mode
Buffer for OUT
endpoint 3 in double
buffer mode
Buffer description table
Endpoint packet buffer
Offset 0x00
Offset 0x02
Offset 0x04
Offset 0x06
Offset 0x08
Offset 0x0A
Offset 0x0C
Offset 0x0E
Offset 0x10
Offset 0x12
Offset 0x14
Offset 0x16
Offset 0x18
Offset 0x1A
Offset 0x1C
Offset 0x1E
CNT3_RX_1
ADDR3_RX_1
CNT3_RX_0
ADDR3_RX_0
Packet Buffer Memory