![ARTERY AT32WB415 Series Скачать руководство пользователя страница 298](http://html1.mh-extra.com/html/artery/at32wb415-series/at32wb415-series_reference-manual_2977599298.webp)
AT32WB415
Series Reference Manual
2022.04.13
Page 298
Ver 2.00
20.5.3.5 Special cases
(1) Handling babble conditions
The OTGFS controller handles two cases of babble: packet babble and port babble. Packet babble
occurs if the device sends more than the largest packet size for the channel. Port babble occurs if the
controller continues to receive data from the device at EOF2 (the end of frame 2, which is very close to
SOF)
When the OTGFS controller detects a packet babble, it stops writing data to the receiver buffer and waits
for the completion of packet. When it detects the end of packet, the OTGFS flushes the data already
written in the receiver buffer and generates a babble interrupt.
When the OTGFS controller detects a port babble, it flushes the receive FIFO and disables the port.
Then the controller generates a Port disable interrupt. Once receiving the interrupt, the application must
determine that this is not caused by an overcurrent condition (another cause of the port disable
interrupt )by checking the PRTOVRCACT bit in the OTGFS_HPRT register, then perform a software
reset. The controller does not send any more tokens if a port babble signal is detected.
(2) Handling device disconnected conditions
If the device is suddently disconnected, an interrupt is generated on a disconnect event (DISCONINT bit
in the OTGFS_GINTSTS register). Upon receiving this interrupt, the application must start a software
reset through the CSFTRST in the OTGFS_GRSTCTL register.
20.5.3.6 Host HFIR feature
The host frame interval register (HFIR) defines an interval between two consecutive SOFs (full-speed)
or Keep-Alive tokens. This field contains the number of PHY clock for the required frame interval. This
is maily used to adjust the SOF duration based on PHY clock frequencies.
shows the HFIR behavior when the HFIRRLDCTRL = 0x0 in the OTGFS_HFIR register.
Figure 20-5 HFIR behavior when HFIRRLDCTRL=0x0
(4)HFIR Counter
restarts
SOF
HFIR DN
Counter
Application Load
Of HFIR
HFIR
1
0 400 399
450
1
0 400
********************
********************
1
*************
450
0
******************** 1
450
0
499
(1)Old HFIR Value
(2)HFIR Reloaded
(3)SOF Lost
Synchronization Due
to HFIR Reload
(5)New HFIR Value
(6)SOF back in
Synchronization
400
450
The sequence of operation is as follows:
1.
After power-on reset, the current HFIR value set by the application is shown
2.
The application loads a new value into the HFIR register
3.
The HFIR downcounter is reloaded, so it will immediately restart counting to cause SOF
synchronization loss
4. Restart HFIR counter