你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

【实战经验】HID与音频冲突问题

[复制链接]
zero99 发布时间:2016-11-18 16:30
前言
! y* `% s- R. y5 fDemo 程序中,HID 和 Audio 单独运行都不会有问题,把 HID 和 Audio 整合在一起,同进传送数据时,会出现Audio 不能传送数据的情况。
6 i! c) c1 ^; L' @0 J8 h) ~6 M. D
& p: ]* G5 O: E3 A) \( T2 B' ^; s+ p: M根本原因8 w8 L8 e9 p4 q( a# I" Z" s

. N4 L6 a/ @/ z' z5 D2 J基本情况:
0 E( p! ^8 Z6 E0 G             1. 当增加HID 的传输频率时,这种情况更容易出现。
- A. n* G, _, _" s             2. 当HID 包在帧开始时,不会出现这个问题。) S" c4 ~/ }# L# \
根本原因是相关的参考手册中描述的一个已知的问题。- c4 a* @. X5 T) b6 i  i# k
                      35.13.8 Worst case response time
5 c* l. h( X* U0 c  `                      When the OTG_HS controller acts as a device, there is a worst case response time for any/ e9 X# }  o0 f# z
                      tokens that follow an isochronous OUT. This worst case response time depends on the AHB
7 Z3 h  w1 s$ u2 }% b5 D                      clock frequency.
7 {% r: V( i0 O                      The core registers are in the AHB domain, and the core does not accept another token
+ N6 ^, L9 ?2 {& G- n! _. C                      before updating these register values. The worst case is for any token following an, ?9 H  R) ~2 \+ Y1 K2 {3 U, i. G
                      isochronous OUT, because for an isochronous transaction, there is no handshake and the; |8 t- K/ X9 v) `
                      next token could come sooner. This worst case value is 7 PHY clocks when the AHB clock# G5 H) l- [: ?  P! k; ^  b
                      is the same as the PHY clock. When the AHB clock is faster, this value is smaller.* s1 V$ `$ o8 `: [$ X' r
                      If this worst case condition occurs, the core responds to bulk/interrupt tokens with a NAK
5 X4 L/ S; _# j8 x                      and drops isochronous and SETUP tokens. The host interprets this as a timeout condition) L7 N- ^, O8 W3 q5 ?% o! _
                      for SETUP and retries the SETUP packet. For isochronous transfers, the Incomplete
0 W+ U! t/ ~& m. l0 M3 w& U# W                      isochronous IN transfer interrupt (IISOIXFR) and Incomplete isochronous OUT transfer
5 N4 @2 ^9 D4 S* ]                     interrupt (IISOOXFR) inform the application that isochronous IN/OUT packets were
0 L! z4 f* f' s& v' n& X                     dropped., ]9 S" Q8 l7 X2 t3 _
因此,建议在帧开始的时候或帧结束前开始发送HID 数据包。. [& C) e5 [# i' I- q6 Z5 s+ J

3 F& \% n2 z# @
4 [8 g  a) n) M8 ~9 {9 ]解决方案:
; z& L9 ^7 @% r5 h- b              1. 在帧开始的时候发送数据。0 m+ U; g% {; u7 B& d2 f" B$ l% X( M" u
              2. 在帧80%,85%,90%,95%时发送数据。通过设置6 r# K* K4 ]( }  h4 ?0 F9 }
              #define DCFG_FRAME_INTERVAL_80                        0
9 I4 n  K. c* |& F2 b( [" j              #define DCFG_FRAME_INTERVAL_85                        12 W' ^1 [$ k. f; E
              #define DCFG_FRAME_INTERVAL_90                        2
0 K$ k$ U7 U# I              #define DCFG_FRAME_INTERVAL_95                        3  : r$ P/ T' q9 B2 c6 F; w: U* d2 ^# \

, r$ Q& b  d4 k, g: P              USBx_DEVICE->DCFG |= DCFG_FRAME_INTERVAL_80;: x( c" w  f3 M) G$ R
. c5 a/ R. G+ i& c/ N2 Q

. k$ l) [; [+ E: k3 F+ C$ V& N8 p             RM0090
4 ]+ d; W; I. j6 g. k              34.16.4 Device-mode registers
8 ?! k# K* J* {1 ^              OTG_FS device configuration register (OTG_FS_DCFG)
* v$ ?3 v6 n0 @4 h6 ?! q3 `5 ], I
8 l* I* X! `0 N* G- c: a; _4 [. d                     Bits 12:11 PFIVL: Periodic frame interval0 v/ r5 W$ E+ ]5 w( w
                     Indicates the time within a frame at which the application must be notified using7 Y) e/ F7 [$ c) X2 l
                     the end of' y: p# M8 |4 c$ y9 z1 i
                     periodic frame interrupt. This can be used to determine if all the isochronous- M; f$ S/ s! s6 v$ G0 Q. p
                     traffic for that# X9 y/ e* t  U
                     frame is complete.1 T5 d  t" O: q) b& R2 |1 n
                     00: 80% of the frame interval5 J' g( G- w+ q- `% q
                     01: 85% of the frame interval) T  r8 H# B9 T* L4 t
                     10: 90% of the frame interval% w; l+ W5 N9 [
                     11: 95% of the frame interval
" I' Y: L( J" F

) ?  t/ L5 {+ O1 x: g

, n- N' j( ~* m HID与音频冲突问题.pdf (74.99 KB, 下载次数: 18)
1 收藏 1 评论1 发布时间:2016-11-18 16:30

举报

1个回答
feixiang20 回答时间:2017-7-1 21:45:03
这些实验的视频介绍比较重要

所属标签

相似分享

关于意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新和工艺
招聘信息
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
关注我们
st-img 微信公众号
st-img 手机版